2011-07

Programming: the benefits of taking a break

[2011-07-14] dev, software engineering
This post lists several benefits of taking a break during programming.

SourceMap on Firefox: source debugging for languages compiled to JavaScript [update: WebKit, too]

[2011-07-10] dev, firefox, javascript
Update 2011-09-16: Source maps are coming to WebKit, too. Mozilla and WebKit implementers might even agree on a common format.

More and more languages are compiled to JavaScript. Mozilla has plans to let you debug those languages in their source code (no need to look at JavaScript).

2011-06

A JavaScript glossary: ECMAScript, TC39, etc.

[2011-06-27] esnext, dev, javascript, jslang
This blog post explains the difference between JavaScript and ECMAScript. And the differences between ECMAScript.next, ECMAScript 6 and ECMAScript Harmony.

Prototypes as classes – an introduction to JavaScript inheritance

[2011-06-25] esnext, dev, javascript, jslang
Updates – read first: JavaScript’s prototypal inheritance is hard to understand, especially for people coming from other languages that are used to classes. This post explains that it does not have to be that way: The proposal “prototypes as classes” is a simplification of classes and inheritance in JavaScript. It might become part of ECMAScript.next, a.k.a. “the next version of JavaScript” (after ECMAScript 5). But there is also a library that allows you to use its features in today’s JavaScript. What’s intriguing about prototypes as classes is that they aren’t a radical departure from current practices, but rather a clarification of them.

Incidentally, this post is also a good introduction to JavaScript inheritance, because the basics are easier to understand with prototypes as classes.

Translating CoffeeScript classes to JavaScript

[2011-06-23] dev, javascript, coffeescript, jslang
The post “Classes in Coffeescript” contains an interesting juxtaposition of CoffeeScript code and the JavaScript it is translated to. This post examines the result of the translation in more detail, which nicely illustrates how subclassing works in JavaScript. To understand the following, you should be familiar with JavaScript’s prototypal inheritance (explained here).

What’s up with the “constructor” property in JavaScript?

[2011-06-22] dev, javascript, jslang
All objects produced by built-in constructor functions in JavaScript have a property called constructor. This post explains what that property is all about.

Quick JavaScript tip: trailing commas inside an object literal

[2011-06-20] dev, javascript, jslang
It used to be that some JavaScript engines weren’t picky about trailing commas inside an object literals, while others threw a syntax error. The ECMAScript 5 language specification [1] has made trailing commas legal, via the following syntax rule (in Sect. 11.1.5):

ECMAScript.next: the “TXJS” update by Eich

[2011-06-17] esnext, dev, javascript
Updates: Brendan Eich held a talk [1] at the TXJS conference in which he detailed the latest updates on ECMAScript.next. This post lists the highlights of his slides and adds a few explanations.

Erich Gamma (Eclipse) joins Microsoft to work on JavaScript tools

[2011-06-15] dev, javascript, windows 8, microsoft
If you have ever read the “Gang of Four” book on design patterns [1] or worked with the Eclipse Java IDE (and platform) then you are probably familiar with the name Erich Gamma who was deeply involved in both. Recent news was that Gamma had left IBM and stopped working on Eclipse [4]. Now Microsoft announces that he will join them [source: Heise via Ludwig Adam]. Quote:

Equality in JavaScript

[2011-06-15] dev, javascript, jslang
Update 2011-12-02: When is it OK to use == in JavaScript?

There are two operators for comparing values in JavaScript: strict equality === and “normal” (or lenient) equality ==. Many style guides (correctly) tell programmers to avoid lenient equality and always use strict equality. This post explains why.