3 ms·
Same here, to a greater extent. Why? At the highest level, because it's a language that was chosen based on a whim (not merit) and is now being extensively work
by romaniv 12y ago
Same here, to a greater extent. Why? At the highest level, because it's a language that was chosen based on a whim (not merit) and is now being extensively worked on and showed down everyone's throats. I like languages, plural. I like new languages. I like to have a choice. (And no, I cannot "simply chose something else" if I have to work with people who say every other choice is invalid by default. And yes, this is the mentality I commonly see.) In a way, JavaScript is the new Java.
The core language (syntax, available directives) hasn't changed much since the time everyone deservedly hated it. Its performance was optimized, it got many more libraries and it is still the only language supported by browsers. But the question is, why all of this applies to JavaScript and not Python/Ruby/whatever?
A lot of its benefits people claim simply weren't around when they chose to stick with it. It's like saying you chose IIS over Apache because of features of C# 5.0 and ignoring the fact that you chose IIS in 2004, where C# 5.0 was not around. It's a dishonest argument.
Speaking of which. How can people claim that JS benefits from the same language running on client and server when 90% of server-side libraries do not work on the client and there are potentially major differences even in core library (e.g. forEach)?
Also, a huge part of JS ecosystem are kludges, crutches and workarounds that make the stack way, way more complex that it should be. (E.g. source maps. Imagine someone minifying PHP for faster parsing and then asking everyone to use some source mapping technology for debugging. They would be laughed out of any conference or discussion.) This mentality permeates everything. I mean, seriously, require directives need to be implemented as a library? Namespace isolation is a closure-based hack? Can you imaging stuff like that being tolerate for any other language?
- woah 12y agoAre you kidding me? Source maps allow you to debug preprocessed as well as minified code. This allows seamless integration of multiple languages into the same ecosystem, libraries, etc.
- romaniv 12y agoYou develop a language that is sent to the client in plain text. Then you write a lot of code in it. Then you realize that with so much code, file transfers take too long. You write a utility to strip out spaces and comments, as well as change variable names so files are smaller. Okay, so now you have unreadable plaintext files. After juggling minified and unminified version of the same code for some years you realize that debugging like that sucks. You develop a new format that allows you to map minified and unminified files. This format requires support on the browser side, as well as in the minification utility, and it also requires the author of the minified library to provide you with two additional files. You declare victory and pat yourself on the back. The whole process only takes a few years. Meanwhile, people debugged binaries for several decades before your language even been developed. Do you see anything wrong with this picture?
- AgentME 12y ago>Imagine someone minifying PHP for faster parsing and then asking everyone to use some source mapping technology for debugging. They would be laughed out of any conference or discussion. Source maps or debugging symbols have been accepted for compiled languages for a long time.
- jbergens 12y agoI agree there are some serious problems. But a lot of the problems are worked on, like modules. I agree they should be in the language and it looks like they will be in ES6. Regarding the different languages on the server and client you don't really have a choice. JS is what runs in the browsers. If you want the same on the server the server has to change. Very few people seems to want Java in the browsers again. And you can write gateway systems in Node that then connects to servers further back which may still use Java/C#/Python or something else. This seems to be the natural route for many projects.