The Ashes

Technology, Science and other news
May 10, 2009

No love for the module pattern?

Posted by : admin
Filed under : General

There was a cheer when Doug showed people that the module pattern could nicely give you somewhat “private” access in JavaScript.

At least, the Java folk definitely cheered.

Jonathan Snook on the other hand has no love for the module pattern and, after using it for some time, now avoids it:

Avoiding the Module Pattern makes debugging easier.

When it comes to troubleshooting a particular troublesome page, I like to crank open Firebug’s console and play around willy-nilly. The ability to reshape objects lets me test theories before putting them into practice with real code. It also allows me to inspect things to make sure they’re working as they should.

Make extending easier

Another frustration I have with it is the difficulty in being able to extend your objects. You can’t just add additional functions onto it because you won’t have access to the properties defined within.

JavaScript should be malleable

One of the features that attracts me to developing in JavaScript is the ability to manipulate objects so readily. As a result, the module pattern is something I try to avoid.

This is going to be contentious, with people feeling one way or another. There is certainly value to the pattern, but maybe it isn’t the right choice for every team? What do you think.

Tags :

No Comments

(will not be published) (required)
(opitional) EN ES IT DE PT CZ FR RU
April 2021




There are many online poker site where you can play but at you can play the poker games with all the knowledge you need related to the game with the poker school available in both the English and Chinese language.

Super Casino

Now you can bet on any sports and any sporting events from all the comfort from your home. Bet770 allows you to bet on any events and match with in just 3 clicks. They also offers great odds on football betting for every premier and champions league match. Get £50 free in bets when you register.

Bingo770, offering best online bingo games with £7.70 free no deposit Bonus!