Sam Elsamman

Nerdy Musings and Other Stuff

A Type System with Benefits

I have been hard at work on a new type system for Javascript. Well actually it has grown into much more than that. I call it a type system with “benefits”. Those benefits are that it is fully typed so that object templates (similar to classes) have knowledge of the types of all properties which [...]

Bindster: A Data Binding Framework for JavaScript

When I started writing Bindster in 2009, JavaScript was still considered “glue” code that added some interactivity to web pages. Pages were mostly served up with data already embedded in them through server-based templates. Communication with the server mostly consisted of posting forms or AJAX calls that returned HTML to be injected. There were some [...]

Why I don’t Use Prototypal Inheritance in JavaScript

Object oriented semantics in JavaScript do not really exist, leaving a vacuum that has been filled with dozens of popular techniques for achieving this.  Early on Douglas Crockford, a senior architect at Yahoo shared with the community some of the mechanics of implementing classical inheritance.  Since then many popular frameworks implemented versions of classical inheritance.  Later in 2006 he retracted [...]

JavaScript Inheritance Minimalist Helper

In my last article I talked about how classical inheritance could be done au naturel without any helpers. There are a number of helpers that make inheritance easier. If you are using a library such as Prototype or Google Closure you probably will use their method of doing inheritance. If not you might choose Douglas [...]

JavaScript Inheritance Au Naturel

How many times have you heard that “inheritance is frequently misunderstood even by experienced JavaScript programmers”. I am here to say that after programming JavaScript for 10 years and using inheritance for much of that period I was still confused. So recently I spent some time trying to wrap my head around this to determine [...]