7 ms·
This one is best: http://enterprise-js.com/16 http://enterprise-js.com/16
by dejv 16y ago
This one is best:
http://enterprise-js.com/16 http://enterprise-js.com/16
- dchest 16y agoFeels like Google's Closure Library.
- rimantas 16y agoUsage shown in example is stupid. However to present this approach as antipattern is also stupid. If "enterprise" means even moderately big apps namespacing is the way to go. Alas, that project mocks too much useful stuff to be liked by me.
- latentflip 16y agoThat's the first example I got when loading the page, and that's exactly what I thought: for big projects namespacing seems sensible enough. So I thought the site was a collection of design patterns, rather than anti-patterns. Left me very confused when the next example was declaring all your functions globally.
- DougWebb 16y agoNamespacing seems fine, but to torture the declaration syntax as shown on the site in order to get the Java-like com.domain.package.class.method() syntax is wrong. Just use underscores in the name rather than periods and use the syntax properly.
- toolate 16y agoNot to mention, the next library you load will clobber the `com` variable.
- vog 16y agoStill, two levels of namespaces are more than enough.