4 ms·
I actually got in an argument with someone on SO the other day who swore blind that the only was to declare a 'class' was using this pattern. Took a fiddle to s
by mattmanser 14y ago
I actually got in an argument with someone on SO the other day who swore blind that the only was to declare a 'class' was using this pattern. Took a fiddle to shut him up.
I just don't get what it adds to your code apart from hiding simple function definitions in the visual trappings of a static helper object or closure. Javascript is already homogeneous enough without making it visually even more.
- jonahx 14y ago>> I just don't get what it adds to your code apart from hiding simple function definitions in the visual trappings of a static helper object or closure. Javascript is already homogeneous enough without making it visually even more. What method do you use instead of the following, when creating namespaces? var yourNamespace = { foo: function() { }, bar: function() { } };
- piva00 14y agoWait, I don't think that JavaScript is homogeneous, not in the least, for me it's really heterogeneous, I can look at 3 or 4 scripts developed by people of different skills and backgrounds and see it done in 3 or 4 completely different styles, visually and syntactically. Did you messed up the wording over homogeneity?
- mattmanser 14y agoI mean the syntax is homogeneous, I agree the styles in use today certainly aren't!