Live data from Hacker News

JavaScript is not suitable for large web apps

blogs.adobe.com

161–170 of 218 posts

Re: JavaScript is not suitable for large web apps

#161
post #87

Earlier quoted context omitted.

>And I want a magic pony; This magic pony exists. That's what the author is trying to say. You can write magic pony code, and it can be run as JavaScript. Magic Pony -> JS Conversion! Also, the OP doesn't have an issue dynamic languages as much as weak typed languages. It just happens that JS is weak and dynamic, while AS is strong and static. Having switched between Java, ActionScript and JavaScript for the last fou…

Just genuinely curious, as I assume it's some bit of Javascript weirdness I don't know, but why the tostring rigmarole over "obj instanceof Array"

That's unreliable for client-side work because each frame has its own Array.prototype object which disavows instances that were created by code from different frames. It's a lot like Java classloaders, where if you aren't careful you can end up with several distinct and incompatible classes with identical names and (often) bytecode.

Re: JavaScript is not suitable for large web apps

#162

Earlier quoted context omitted.

>Great, so now the documentation for the function will promise to return a motorcycle, but instead return either a bunny or a toaster. Not if you follow the second part of my above advice. >There are lies, damn lies, and boilerplate code comments. Since when is a comment that explains what a function does "boilerplate"? I think you are confused.

I've often had to work with code where the comments indicated an entirely different intention than the implementation. As a result, I'm a little paranoid and skeptical, that's all. I also don't like the idea of having to comment each and every single function . If you have to write a comment to explain what it does, maybe you haven't named it properly?

There are a few people who are cautious and methodical enough to specify all types in comments and keep them correct. But you need an entire team of them, because type comments which are only mostly correct would be worse than useless. And an entire team wouldn't choose a dynamically-typed language that makes those showstopper bugs more likely.

Re: JavaScript is not suitable for large web apps

#163
post #43
post #14

This article only proves the author's incompetence to develop and maintain large JavaScript projects, nothing more. > I don’t know why but JavaScript programmers tend to put all of their code into few files. That’s not so useful, though, if you want to have multiple developers work on the same project. Splitting up the code into multiple files enabled us to scale the project. Let me rephrase that: "I don’t know why b…

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.

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 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.

Re: JavaScript is not suitable for large web apps

#165
post #89
post #30

For a certain definition of "large" and for certain domains ( especially finance ) his argument is very, very valid. 200 average developers working with GWT->JS are anyday going to be more productive than coding native JS to get the same functionality. This isn't anti-JS...end of the day if you are on the web your code is JS. Thing is, how do you get there - do you hire 20 pricey smart JQuery guys, or 200 average Jav…

Instead of comparing '20 smarty JQuery guys' with '200 average Java programmers', how about comparing '20 average JQuery programmers' with '20 average Java programmers'? Or comparing '20 smart JQuery guys' with '20 smart Java programmers'.

There is no such thing as a jQuery Programmer. There are JavaScript programmers who are familiar with jQuery.

Re: JavaScript is not suitable for large web apps

#166
post #3

As I read more of these arguments, it makes me think a lot about whether I should switch to CoffeeScript before my web app gets any larger. Has anyone switched to CS or another language that compiles to JS, and regretted it?

CoffeeScript is a syntax, not a language. His arguments have to do with the semantics of JavaScript, which are identical to the semantics of CoffeeScript.

Coffeescript has a very similar object model, but it does alter (fix) the semantics of variable binding and expression statements and some unusably broken operators, and those involve treating Javascript more like a compilation target than an equivalent dialect.

Re: JavaScript is not suitable for large web apps

#167

Earlier quoted context omitted.

>20 pricey smart JQuery guys See, this is how I knew you knew nothing about JavaScript. My bets, you're a manager that manages shitty Java coders who "used to code" and is an obnoxious know-it-all. Scale of 1-10, how close am I? Edit: From your website: "currentlly: BofA" (sic). Feeling pretty warm on my bet so far.

So so true. If you are hiring "pricey smart [sic] jQuery guys" then you're probably doing it wrong. You need to be looking for solid software engineers that know javascript well. If the developers you are hiring think (jQuery === javascript) and can't explain the difference between classical and prototypal inheritance , then you're screwed before you even begin.

Funny, the exact same question came up today. I'm curious what the actual difference between the two is as it's not apparent. (I use a mixture of function prototype with the extends pattern and CoffeScript which exports a function exporting a function.) From what I can see they behave the same as long as you follow the same pattern when writing a subclass.

Re: JavaScript is not suitable for large web apps

#168
post #3

As I read more of these arguments, it makes me think a lot about whether I should switch to CoffeeScript before my web app gets any larger. Has anyone switched to CS or another language that compiles to JS, and regretted it?

CoffeeScript is a syntax, not a language. His arguments have to do with the semantics of JavaScript, which are identical to the semantics of CoffeeScript.

Personally I think its great because it is just a different syntax for the same semantics.

Re: JavaScript is not suitable for large web apps

#169
post #38

Earlier quoted context omitted.

node.js is written in JavaScript.

Large parts are written in C++ :)

I'm pretty sure that very little of it is actually in js. It's more appropriate to say that you use javascript to script the node environment/runtime.

Re: JavaScript is not suitable for large web apps

#170

GWT? Seriously? I cannot think of any large, significant web app that has been written in GWT. I thought it would be clear by now that we do not need Java Enterprise in our web browsers. The web seems to be moving the other way - we have lightweight libs such as jQuery, underscore, backbone etc... and they seem to provide JS with the necessary building blocks for larger, maintainable systems.

AdWords, AdSense, Flights, Hotel Finder, Offers, Wallet, The New Blogger, Chrome Webstore, Product Search, Public Data, New Google Groups, Orkut, Google Takeout, Google Pagespeed, Google WebFonts, Google Tables, Google Health (discontinued), Google Wave (discontinued), PlayN (basis of Angry Birds) http://gwtreferencelist.appspot.com/#AboutPlace :

OK, I stand corrected. Still, that doesn't make it a good idea. Not to mention that most of those apps are Google products.
Post reply on HN