News for hackers. Stuff that matters.
Re:Building a single page app with Backbone.js, underscore.j... by jashkenas on Saturday October 30, 2010 @12:23PM (#1851162)
Please don't just quote Crockford as gospel truth.

Crockford's prototypal revelation is only a slight alteration of the standard constructor pattern, and not a particularly useful one. You still have a class (the object that serves as a prototype for every instance you create), it doesn't add any particular flexibility, and it's quite slow. I encourage you to run the tests yourself:

http://jsperf.com/object-create-vs-crockford-vs-jorge-vs-con...

For me, that test clocks using Crockford's pattern to instantiate objects as 80% slower in Safari and Firefox, and 95% slower in Chrome, when compared to a standard use of JS prototypes.

There are no comments on this comment yet.