Jussi Kalliokoski's Blog

Broken Promises


Around 2012 I found out about Promises. I realized that they solve a lot of the pain points I have with async JavaScript, namely pushing error handling to the edges, elegantly making sure only one completion is allowed (preventing numerous accidental race conditions) and allowing composition of async operations in a unified interface. I was convinced and became a fanboy and advocate. Since then I’ve become disillusioned.


Posted 2016-02-02T05:00:00.000Z.

Multiple Inheritance in ES6 with Proxies

Inheritance in JavaScript

As you probably know, JavaScript features an inheritance pattern called prototypal inheritance. In simplified terms, it means that objects have a prototype, and when a property of an object is accessed, it’s first checked if the object itself has the property, and if not, the same is done for its prototype and so on. This is a very powerful model, not least because of its flexibility. You can even use it to simulate classical inheritance.


Posted 2012-11-28T05:00:00.000Z.

Ludum Dare 24

Yay I’m finally participating!

Yes, after observing for a few times I decided to participate in Ludum Dare myself this time. I had quite a few ideas based on the themes up for voting when I went to bed last night, I just kept wishing that the theme would not be “Companion”. I woke up in terror seeing that the theme was “Evolution”. My first few ideas weren’t even ideas, they were just memories. “Oh, right, that’s Osmos… Yeah that’s Spore, dammit…”. No original / plausible ideas whatsoever.


Posted 2012-08-26T05:00:00.000Z.

Vendor Prefixes - A Compromise

Vendor Prefixes: Good / Bad?

Vendor prefixes rock and suck at the same time. They allow browser vendors to experiment with new features and gather feedback from developers both for the implementation and the standard. This is Good(TM). The problem is they are experimental by nature, the features they expose are subject to change and the prefixed version is supposed to die when the feature is standardized and the implementation is no longer experimental.


Posted 2012-08-24T05:00:00.000Z.

JavaScript Green Threads

What on Earth are they?

For an introduction to green threads, I suggest reading this Wikipedia article. What they mean in this context is however a bit different, as in JS there is normally no threads at all, and because callbacks in JS are quite easy and event loops are usually controlled by things outside your control, you might feel that there’s not much need for scheduling control.


Posted 2012-07-05T05:00:00.000Z.

Proposal - CSS Namespaces

CSS has no proper namespaces

The other day I was thinking about CSS and the practices that come with it. It’s a good idea to have a lot of shared elements on your website; this means you can use a common CSS file for all pages and more specific stylesheets that load on top of that if necessary. However, as these specific styles may have overlap, you have to either keep these in separate files (and not concatenate them: an extra request) or have different classes on different pages to differentiate them from each other. That’s quite tedious, considering the specificity might be a large chunk of CSS, prepending every selector with the class selector for that page is few extra precious bytes and keystrokes.


Posted 2012-06-19T05:00:00.000Z.



If you stumbled on this, you’ve probably read where this all started from. An issue was reported for Twitter Bootstrap, because JSMin failed at minifying the code in bootstrap, due to a combination of two simple lines. @fat responded that the code is correct and that the problem is with JSMin, and closed the issue. While I disagree a bit with that decision, since it’s breaking things, I acknowledge that he’s correct in saying so, and it’s his decision.


Posted 2012-04-17T05:00:00.000Z.

HTML5 as a gaming platform

Hype The Markup Language

HTML5 is the new shiny thing, and there’s a lot of evangelism going on about it. The improvement process is rapid (too much so? that’s another blog post), and browser vendors are trying to get the game makers in bed with them, some with means of money, some with fame. The web is evolving, so is the documentation of related technologies, but it’s hard to keep up with everything that’s going on, and developer tools for JS are still a bit in their infancy. However, HTML5 games keep popping out like mushrooms on rain. Not.


Posted 2012-03-12T05:00:00.000Z.

New Hardware - New Hardships

You’ve just spent money on hardware, what now?

I’ve had my own PC since 1996 IIRC, but I’ve never had a pre-assembled one. That has come with its own challenges; I’ve had to change parts myself, usually buying them piece at a time. This is kind of nice, actually, I mean I wouldn’t want to make a job out of changing computer parts, but occasionally it’s nice, just like assembling IKEA furniture is fun when you don’t have to do it more than a few times in a year.


Posted 2012-03-10T05:00:00.000Z.