Re:JavaScript is not suitable for large web apps
by untog on Thursday June 14, 2012 @06:22PM
(#4113838)
I know exactly why they do it- to cut down on HTTP requests. But then it's trivial to minify and compact your JS into a single file. It sounds like he's just worked on bad projects.
[ Parent
| on HN ]
Re:JavaScript is not suitable for large web apps
by CmdrKrool on Friday June 15, 2012 @01:50AM
(#4115245)
And also because browser-side JavaScript does not have standard modules, where one is able to 'import' another. So even in the development phase, pre-minification, one is discouraged from making new files because of the pain of adding corresponding <script> tags in the HTML file or files and then getting them in the right order, and the larger the project the less you want to be tracking those dependencies manually.
While you can use a module loader library you still have to choose one, learn it and its quirks and adapt other external libraries to use it (some of which might be written for another module loader or - horror of horrors - use their own half-arsed module system).
As for "file-stew" mentioned by the sibling comment, small units are good if you like code reuse. For example, I get sick of writing very basic classes like 'Rect' and 'Vector' (for graphics) over and over again.