2011-03

Lightweight JavaScript inheritance APIs

[2011-03-05] dev, javascript, jslang
Creating objects via constructor functions is fairly straightforward in JavaScript. But as soon as you want to do inheritance, things become complicated. This post examines how inheritance works in traditional JavaScript. It then presents four APIs that make things easier, without adding too much bulk to the language: ECMAScript 5, YUI, Prototype.js, and John Resig’s Simple Inheritance.

Web sites: dynamic page extension versus paged navigation

[2011-03-03] dev, hci, webdev, computers
Recently, more and more web sites are showing their content via dynamic page extension instead of paged navigation.
  • Dynamic page extension: New content is appended to the current page. Examples:
    • DZone and normal Twitter recognize when you are close to the end of the page and add new entries.
    • Mobile Twitter has a link at the end of the page to “show more”.
  • Paged navigation: New content is shown on a new page. Example: Google’s search results.
But good old-fashioned paged navigation has several advantages:

Gender-neutral pronouns in English

[2011-03-01] english, life
Fill in the blank, with a possessive pronoun such as “my” and “your” to express that it’s the user’s name:
The user has to click on _____ name.

2011-02

Commit messages indicate what programming languages make people swear the most

[2011-02-27] programming languages, dev
Cussing in Commits: Which Programming Language Inspires the Most Swearing?” is a great read. It refers to someone who has analyzed commit messages on GitHub to determine which programming language caused committers to swear the most.

Die zweite Stammstrecke: schlecht für München

[2011-02-25] politics, life, münchen
Anmerkung: Überzeugt von den untenstehenden Argumenten? Dann bitte weitererzählen!

Update 2011-08-09:S-Bahn: Das Aus für die zweite Stammstrecke!”. Bei der Lektüre genau darauf achten, wer gegen den Abbruch des Projekts protestiert.

Ich war vorgestern auf einem Vortrag über die zweite münchner Stammstrecke, gehalten von Martin Runge, dem Fraktionsvorsitzenden der Grünen im Landtag. Da bei diesem Thema Parteiinteressen eine relativ geringe Rolle spielen (OB Ude ist für die zweite Stammstrecke, ebenso die Staatsregierung), war ich mir relativ sicher, objektiv informiert zu werden. Dieser Blogeintrag ist meine Mitschrift des Vortrags. Als Münchner ist es wichtig, die folgenden Tatsachen zu kennen, denn momentan besteht noch die Möglichkeit, die zweite Stammstrecke zu verhindern und die in vielerlei Hinsicht bessere Alternative des Südrings zu ermöglichen. Zusammenfassung: Die zweite Stammstrecke ist weit teurer, als wir uns momentan leisten können, bringt erstaunlich wenig, und würde erst sehr spät fertig werden.

David Herman on ECMAScript.next

[2011-02-24] esnext, dev, javascript
David Herman has posted a video of his talk on what he calls ECMAScript.next, the next version of JavaScript. Others call it “JavaScript Harmony”. It nicely complements my recent post on Brendan Eich’s ideas for Harmony [1], with a little overlap, but not much.

Roadmap for ECMAScript.next:

  • Spring 2011: proposal freeze (no more proposals allowed)
  • 2013 (roughly): spec finished, parts will be in browsers before that.
  • opt-in via MIME type in script tag: <script type="application/javascript;version=next"> (where “next” is a placeholder for something that has still to be determined)
Broad themes:
  • Fixes: removing quirks
  • Expressiveness: support better, more concise idioms
  • Power: doing what couldn’t previously be done

What should be on your business card?

[2011-02-23] howto, life, business
The business card is one paper-based product that is still useful in this digital age (that might change if near field communication becomes more popular and you can just tap devices together to exchange contact information). This post lists what you should put on your business card, with special considerations for online-dwellers.

Efficiently creating JavaScript objects: closures versus prototypes

[2011-02-19] dev, javascript, jslang
In “Closure Versus Prototypal Pattern Deathmatch”, Brendan Eich examines the question whether, when creating objects, the closure pattern or the prototypal pattern is more efficient.

JavaScript variable scoping and its pitfalls

[2011-02-17] dev, javascript, jslang
This blog post explains how variables are scoped in JavaScript. It points out two things that can cause problems if you are not aware of them: JavaScript variables are function-scoped and they can be captured in closures.

Six things JavaScript needs to learn from Java

[2011-02-13] dev, javascript, jslang, java
The amount of creativity currently happening the realm of JavaScript (JS) is simply amazing. People invent all kinds of nifty tools and extensions. But with that comes fragmentation and the proliferation of JS frameworks has turned JS into an assembly of incompatible sub-languages. In contrast, Java has standardized the following six things and JS should do the same. After listing them, this post points out consequences (tooling!) and future developments.