4 ms·
Why does JavaScript get some much hate? TCL has an extremely loose runtime model, not to mention everything in the language is basically a string and all that
by no_wizard 2y ago
Why does JavaScript get some much hate?
TCL has an extremely loose runtime model, not to mention everything in the language is basically a string and all that entails.
I’ve been using JavaScript since the early 2000s, just before ES5 dropped.
Like all languages it has its curveballs but it really isn’t all that bad. It simply has oddities due to the quirky nature of the niche it was designed to fill (namely, to be a scripting language that was forgiving to web designers)
- lolinder 2y agoHonestly? I think the biggest cause of JavaScript hate is that a huge percentage of developers have very little choice but to use it. The web ate almost everything else for a host of reasons, and JavaScript is still the only language that the web natively supports. You can compile to JS or use WASM with occasional callouts to JS, but you can't get away from it entirely. Most other languages have a greater sense of choice surrounding them. For backend work you can pick pretty much anything, and mobile is still a small enough chunk of the ecosystem that if you really hate Swift you can just find a job that isn't iOS dev. It's not so easy to get out of web dev without dramatically shrinking your job pool.
- no_wizard 2y agoAll I can say is that’s the cost of doing business with the browser being the main platform. If devs want to interact with it less then focus on moving more to the server. You can still serve HTML and CSS and get a long way without ever touching JS. It’s no different than other domains where one or two particular languages largely dominate. Like I don’t hear developers decrying the existence of C/C++ every chance they get I think the hate is entirely unjustified. It’s fine to have preferences but so often it goes beyond that.
- NooneAtAll3 2y ago> Like I don’t hear developers decrying the existence of C/C++ every chance they get I guess you haven't encountered the monkey zoo of rust cultists yet
- no_wizard 2y agoI have, but they’re not quite as zealous. The anti JS campaign has been running almost as long as I’ve been using it, which is pushing two decades now. Now I know why PHP devs sometimes get a little defensive
- deleted 2y ago[deleted]
- lolinder 2y agoFWIW, I agree totally, and I don't find JavaScript to be bad at all.
- neilv 2y ago"Brooklyn Nine-Nine" said it: https://www.youtube.com/watch?v=H1-GDlzODzc&t=27s https://www.youtube.com/watch?v=H1-GDlzODzc&t=27s
- padjo 2y agoIn the early days at least part of the problem was marketing. The fact that it’s got Java in the name when it’s actually a very different language to Java confused a lot of people. They tried to use the language like Java, had a bad time and concluded the language was bad.
- derriz 2y ago"Why does JavaScript get some much hate?" I don't get it either? I've only used it occasionally but it has always struck me as a really impressive example of what can be built on minimal (minimalist?) foundations. Its semantics can understood in 5 minutes. It reminds me of Scheme in this regard. Writing an interpreter or compiler for it would be easily within reach of an undergraduate student. Contrast with other currently popular (more respected?) languages like Rust, C++, Java, C# or even Python. I've only recently been expose to Typescript and again, I'm really impressed. I haven't encountered a type system so elegant and orthogonal since first being exposed to ML like languages.
- mdaniel 2y ago> Its semantics can understood in 5 minutes. Your definition of "semantics" must be different from mine, or you perhaps haven't seen https://javascriptwtf.com/ https://javascriptwtf.com/ (linked in a sibling comment) Your comment actually made me wonder whether those cited artifacts were implementation bugs or actually in the specification and ... lol, this shit reminds me of people who put comments above functions that just restate the function's name: https://tc39.es/ecma262/2024/#sec-addition-operator-plus https://tc39.es/ecma262/2024/#sec-addition-operator-plus > Writing an interpreter or compiler for it would be easily within reach of an undergraduate student Surely you don't really believe that? Or is the rest of the sentence "... eventually, over the course of their undergraduate career" The 15th edition of the standard is 816 pages and now includes specifying the Memory Model. What I suspect you mean is "could write a parser for the 1st edition spec from 1997"
- no_wizard 2y agoI can find oddities like this in all languages. Arguably C and C++ have more warts, particularly C++ where I always hear people talk about how it’s only reasonable to use a small subset of the language. Also how C/C++ compilers don’t all support the same features of the purported language they compile. I won’t argue that JS doesn’t have warts - it does and if it wasn’t for backward compatibility I imagine they’d have been removed from the language - but the entries on that website are quite small compared to others - like C and C++ - that I can think of
- eadmund 2y ago[flagged]
- tgv 2y agoI used Tcl briefly to build an interface way back with Tcl/Tk, and it is a terrible language. "Everything is a string" is not what you want in a solid programming environment for larger projects. It's a LISP-like gimmick, but without the advantages of LISP. That said, plain JS is not a good fit for larger projects, either. It really needs TypeScript for that. But it does have some very fast engines.
- graemep 2y ago> not to mention everything in the language is basically a string and all that entail I disagree with that to at least some extent. Everything is a string works well in TCL because the language is built around that abstraction. It works at least as well as other dynamically typed languages in small projects, and is definitely preferable to Javascript's rather weird weak typing. It also does async and multi-threading really nicely, and encouraged event driven long before it look off elsewhere.
- otterley 2y agoThis is a classic: https://www.destroyallsoftware.com/talks/wat https://www.destroyallsoftware.com/talks/wat