Live data from Hacker News

JavaScript is not suitable for large web apps

blogs.adobe.com

31–40 of 218 posts

Re: JavaScript is not suitable for large web apps

#31

This is more of a rant against dynamically typed languages than against javascript itself, and making the argument that dynamically typed languages are not suitable for large web apps is a difficult (not impossible) one to make. The author also complains about some javascript projects being split up into enough files, which is hardly a side-effect of using javascript. The author inherited what sounds like a pretty di…

I also find objections like the "createBunnyOrToaster" antipattern to be really, really uncompelling. You don't need a static type system to make sure that your functions are sane and consistent, and you don't have to be John Resig either. First of all, put a comment at the top of your function that says what to expect about the return value. You should be doing this anyway because the return type alone is often not…

> You don't need a static type system to make sure that your functions are sane and consistent, and you don't have to be John Resig either.

Right, and you can do structured programming in assembly. But when the language or tools don't help you do that, there are examples like the one the author points out where developers don't.

Don't mistake utility (what can be done) for usability (what is easy to do). Usability always matters.

> First of all, put a comment at the top of your function that says what to expect about the return value.

I want a language that gives me a nice pleasant syntax for doing that.

> Secondly, every time you write the word "return", look up at the top of your function and make sure you are in accordance with what you said the function would do.

As a programmer, you should be trained that when you see "every time", you think "automate this". If you and everyone on your team and everyone who has ever been on your team has to remember to do something every single time, your code will accumulate a pile of instances of forgetting.

Fixing that is exactly what tools and languages are for. It's a hell of a lot easier to make a disciplined tool than a more disciplined programmer. (And when you have made a more disciplined programmer, they typically evidence that by asking for more disciplined tools.)

Re: JavaScript is not suitable for large web apps

#33
Poorly written Javascript is not suitable for large web applications. This goes for any language. Competent Javascript developers will have many files that are concatenated into just one or two files as part of their build environment. Competent Javascript developers will use code quality tools such as jslint or jshint to find potential problems.

It’s too bad that you inherited a poorly written Javascript project, but that doesn’t mean the language you’re most familiar with was the best language for the job. This is a common response. “I know X, let’s use X!!!”

Also, Javascript is a high level language.

Re: JavaScript is not suitable for large web apps

#34

Earlier quoted context omitted.

I also find objections like the "createBunnyOrToaster" antipattern to be really, really uncompelling. You don't need a static type system to make sure that your functions are sane and consistent, and you don't have to be John Resig either. First of all, put a comment at the top of your function that says what to expect about the return value. You should be doing this anyway because the return type alone is often not…

> You don't need a static type system to make sure that your functions are sane and consistent, and you don't have to be John Resig either. Right, and you can do structured programming in assembly. But when the language or tools don't help you do that, there are examples like the one the author points out where developers don't. Don't mistake utility (what can be done) for usability (what is easy to do). Usability al…

Unfortunately static typing doesn't really fix the automation problems that are most common in software development any better than anything else. I wouldn't mistake a personal preference for static type systems and large complex IDEs for superiority of language or productivity.

Re: JavaScript is not suitable for large web apps

#35
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…

Ok, seriously, I'm sort of sick of the file-stew meme in software development these days. Our editors aren't particularly designed for the one-file-per-function method of development that's been ohh-so-common. Serious, if a file is under a hundred lines of code, it probably doesn't need to be a separate file, it only undermines the grouping value that files are useful for.

Re: JavaScript is not suitable for large web apps

#36
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?

I've used Coffeescript on a couple large Rails projects, and I'd rather stick with Javascript. I haven't encountered any terrible debugging hurdles, but it just seems like obfuscation. And unlike one of your other respondents, I love Sass and Haml. I have nothing against preprocessing per se, but I haven't yet figured out what value CS adds. I appreciate easier iteration, but that's about it. But considering how many people rave about it, I'm willing to learn....

Re: JavaScript is not suitable for large web apps

#39

>Splitting up the code into multiple files enabled us to scale the project. I really don't get this at all. More files == more scalable? Someone more knowledgeable about ... whatever topic is relevant here care to explain this to me?

Because a hundred files must be worth ten times as much as ten files. Maybe he gets paid by the file.

Re: JavaScript is not suitable for large web apps

#40
"Help! I don't know how to organize code in intelligent ways! This is the fault of the language we originally decided to use!"

I have to say after writing "large" web apps in PHP and also in 100% JS, I much prefer JS for front-facing stuff. I've not found organization to be a big issue...but maybe this is due to the fact that I use a JS framework for most of my larger apps (but then again, I did in PHP as well).

Like C "feels" like a language for low-level programming and PHP "feels" like it should be running on a webserver, javascript "feels" like it's right at home in the browser. And now that browsers are powerful enough to be the entire front-end, I've come to completely embrace JS for this task.

Javascript is not a bad language. It's a very powerful language. Just like any other language, if it's poorly organized it's going to be a mess. I can tell you, from my experience, it is suitable for large web apps!!

Also, you can't ignore that this is hosted by Adobe...

Post reply on HN