2011-05

Why is the revenue of technical books declining?

[2011-05-01] life, media
Mark Pilgrim has written the post “The ‘book’ is dead” [via Daring Fireball] where he examines why revenue from technical books seems to be declining. It was triggered by a prior post from David Flanagan, in which he writes:
For 15 years I’ve been one of those lucky authors who has been able to support himself and his family almost entirely on book royalties. But the publishing industry has been in decline and my royalties checks have decreased more-or-less steadily since the dot-com bust, and I’ve now decided that I need to look for a salaried job.
Pilgrim’s post makes a few noteworthy points:

2011-04

Creating new programming languages is becoming easier ... and harder

[2011-04-29] programming languages, dev
In December 2010, Brendan Eich talked about Mozilla’s new programming language called Rust (that focuses on safety and concurrency, to replace C++ as Mozilla’s implementation language). He mentions that creating new languages is still important, because they can recycle old research, but repackage it so that it becomes more mainstream-compatible. One example is Clojure that continues the Lisp tradition, but on the Java Virtual Machine (JVM). There are two new aspects to modern language design:

ECMAScript.next features are taking shape

[2011-04-28] esnext, dev, javascript
The ECMAScript wiki has two pages with features that might make it into ECMAScript.next:

Patterns for modules and namespaces in JavaScript

[2011-04-27] dev, javascript, jslang
Update 2011-11-19: Bridging the module gap between Node.js and browsers

JavaScript does not come with support for modules. This blog post examines patterns and APIs that provide such support. It is split into the following parts:

  1. Patterns for structuring modules.
  2. APIs for loading modules asynchronously.
  3. Related reading, background and sources.

ECMAScript 5 spec: LexicalEnvironment versus VariableEnvironment

[2011-04-22] dev, javascript, jslang
This post examines some of the details of how environments are handled in the ECMAScript 5 (ES5) specification [1]. In particular, there isn’t a single “current environment” in ES5, but two: the LexicalEnvironment and the VariableEnvironment. A piece of code at the end exploits these ES5 internals to produce different results on Firefox and Chrome.

Iterating over arrays and objects in JavaScript

[2011-04-20] dev, javascript, jslang
This post explains three approaches for extracting information from arrays and objects:
  1. for loops,
  2. array methods (courtesy of ECMAScript 5 [1]),
  3. listing property keys.
It concludes with best practices for applying these approaches.

JavaScript: converting any value to an object

[2011-04-17] dev, javascript, jslang
This post is about converting between primitive values and wrapper objects [1]. Thankfully, one is usually not faced with this kind of task in JavaScript. The most frequent use case is to add properties to a primitive. As a primitive is immutable, you need to convert it to a wrapper object to do so. Read on if you want to see some of JavaScript’s more obscure corners.

Let us start with a short quiz:
What does ({}).valueOf.call(myvar) do?

Internet Explorer 10 is “native” and good for webapp developers

[2011-04-13]
The Internet Explorer 10 Preview (IE10) comes with many new features, two of them are especially good news for webapp developers:

The Singleton pattern in JavaScript: not needed

[2011-04-12] dev, javascript, jslang
This post argues that the singleton pattern is usually not needed in JavaScript, because you can directly create objects. It then slightly backpedals from that position and shows you code skeletons that you can use if your needs go beyond the basics.

The Singleton pattern and its simplest implementation in Java

[2011-04-10] dev, java
This post motivates the Singleton design pattern and explains its implementation in Java.