Dependency injection and IoC in Javascript
There has been some talk lately about DI and IoC in Javascript, and other dynamic languages such as Ruby and Python. A popular opinion seems to be that these concepts are obsolete in dynamic languages, mainly because you can alter an object at runtime. This certainly makes testing easier, but testability isn’t the main goal [...]
Inheritance in Javascript
Javascript is a very dynamic language, and you can implement inheritance and code reuse in multiple ways. Lately, I’ve grown fond of what Douglas Crockford calls Parasitic Inheritance.
By using parasitic inheritance, you can avoid using the new operator all together. The new operator isn’t evil, but it’s problematic in that if you write a function [...]
Why I still use PHP
Since december 2009, I work in an all Microsoft shop. Coming from a pure LAMP-world – both Python and PHP – the step was quite big to C#, VB and SQL Server. But I’ve grown to really like the technology stack. SQL Server is brilliant much because of SQL Server Management Studio, and I really [...]
Separate concerns with queues
When you’re doing Javascript, you often find yourself listening to events, and then taking action upon what happened. Let’s take a classic example; the drag and drop effect. You have code that listens for the mousedown event which should signal that it’s time to start listening for the mousemove event. In the mousemove event listener [...]