Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Frankly I really like JavaScript. I don't want the language to change, even though it has its flaws. I just love the ability to have data-structures as simple as objects and arrays which have evolved into a standard data exchange format (JSON). Then you can also have functions inside objects and everything becomes really flexible and really easy to design.

I've tried many different languages, including the real pretty ones such as Ruby and Python, and I just have more fun using JavaScript because of how free-form it is.



That flexibility is indeed useful for scripts and adding minor interactivity to an otherwise static web page.

However, people are now using JavaScript for development that far exceeds those uses. JavaScript is just not suitable for larger applications.

Once your application starts exceeding a few thousands of lines of code, the problems become very clear. You soon wish you were using a language like C++, Java, C#, Python, or Ruby. Toss in a development team made up of at least several people, if not more, and the pain becomes far greater.


I was never able to personally judge that statement. My experiences show that the flexibility of JavaScript only improved maintainability of the software written in it.

http://npmjs.org/ is a list of solid software (also large software) written in JavaScript.

So I don't think your statement, about maintainability being connected with how flexible a language is, can be proven to be true.


By "larger applications", I wasn't talking about jQuery, Node.js or anything built upon them.

I'm talking about real software systems with, at a very minimum, tens of thousands of lines of code. More realistically, we're talking systems with hundreds of thousands, if not several million, lines of code.

C++ can scale up to codebases that large. Java and C# can handle it, as well. Even Python and Ruby can, if care is taken. JavaScript cannot. You'll be hitting numerous maintenance barriers far before then, when you're still well under 10,000 lines of code.


Why do you think JavaScript cannot handle it? If you reach the million lines of code you probably have a really modular application, otherwise it's unmaintainable in any language. Being modular it can be sub-divided in many small layers which are the size of a jQuery library.

I think your experience with JavaScript comes from reading code made by bad developers. If your software is written by good people it will be maintainable even in JavaScript.


I've worked on some larger applications in javascript (though nothing incredibly large), and I can tell you if I had the choice of using any language that offered static and strong typing I'd take it in a heart beat. A small change in one place often means an error in some part of your code you didn't even think would be affected. I've loaded 65k LOC JS files in firebug and webkit's debugger chasing some error down that was happening in some piece of code that I've never seen before. All because that's how far my screw up managed to travel when there is no type checking or strong typing. In that particular case I had set a string value to something that was supposed to have been an array. Something like that would never have happen in, lets say C#, but "crap"[0] or "crap".indexOf("c") or ["c", "r"].indexOf("c") are all valid JS.


Dynamically typed languages offer a lot of benefits and a lot of burdens. Only you can judge whether you're willing to take those risks. Personally I am more comfortable with dynamically typed languages as they feel more natural and less programmatic, but this is just personal taste.

Nothing of this is related to the free-formness of JavaScript. Python and Ruby are also dynamically typed.


I have no experience with ruby, but python's advantage is in strong typing. Try and add an int and a string and you'll get a type error, JavaScript on the other hand will do it though. While maybe allowing you to write more expressive code, it does mean that errors become harder to locate, and when dealing with larger applications, I prefer being able to locate errors quickly.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: