Working with the mobile web
So for the past year, I’ve been working almost exclusively on a mobile web application that is designed to run on Android and iPhone. It works quite well on Windows Phone (Mango) as well, but none of our customers have WP devices (yet). The application is a LOB app with offline capabilitites, so it’s mostly [...]
Extending built in objects in a safer way in Javascript
In Javascript, its very easy to extend built in objects like Object, Array and String. You might find yourself wanting string methods that aren’t built into the String object, and it’s much nicer to read “one short sentence”.toUpperFirst(), than toUpperFirst(“one short sentence”). The problem is that by extending the builtin objects, you are adding global [...]
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 [...]