Coffeescript

Today’s blog post is about a programming language. Deal with it.

Our story begins one day, 1 million internet-years ago, during the dawn of the browser wars in the 90s (yes, gentle non-webby-reader, they actually call it that).

That day, something historic took place, web pages now had a way to be interactive. and the language to do this was called JavaScript (solely for marketing reasons - it had nothing to do with Java) This of course, was only available on the eternally popular Netscape Navigator web browser. In time, the language spread (IP laws be damned) to the eternally (un)popular Internet Explorer browser, and so to every browser since.

Programming in this language is what I do all day, and while it got a lot of things right, it gives you many ways to shoot yourself in the foot: defaultly scoping variables globally, weird assumptions about line-endings making semicolons necessary almost everywhere ‘just in case’, a simultaneously incomplete yet overenthusiastic reserved keywords list, overly generous falsy-coercion, fragile looping, and way. too. many. brackets.

Enter Coffeescript:

CoffeeScript is a pretty new programming language that is compiled (translated) into javascript to run ably and natively in browsers and in your head. Look at all the things it makes nicer

Its greatest achievement is the automatic generation of so much of the unnecessary boilerplate from javascript, leaving you to just write logic rather than having to deal an astonishment of brackets, braces, and parentheses, and the words ‘return’ and ‘function’ written out in full over and over and over again.

Why does this matter? when you’re programming you think in the programming language. The more verbose and unwieldy a programming language is, the more verbose and unwieldy your thoughts. (The same is probably true of human language too.) If the programming language will simplify complex ideas, then your thoughts can be simplified too. The same thing happens with mathematical notation. x + x + x + x is the same as 4x, but the latter is much easier to store in your head while doing other things to it. even having 4 × x introduces unnecessary complexity (not the least because x looks like times).

… I’m not sure where I’m going with this. Abrupt end.