Spending 10,000 hours building things with JavaScript sounds like a pretty good definition of Hell.
JavaScript is an actively, abusively bad language. It's not that it has a few warts: it's nothing but warts. Its fundamental design flaws are obscured only by its superficial design flaws.
It's a really bad, tasteless language.
> I don't think that's a reason for anyone to stoop to the level you have, though.
I really don't think he 'stooped' to anything.
(But yeah, compared to languages that were designed over years obviously it's incredibly bad.)
To quote Eich (from here[1]):
" Ten days to implement the lexer, parser, bytecode emitter (which I folded into the parser; required some code buffering to reorder things like the for(;;) loop head parts and body), interpreter, built-in classes, and decompiler. I had help only for jsdate.c, from Ken Smith of Netscape (who, per our over-optimistic agreement, cloned java.util.Date -- Y2K bugs and all! Gosling...).
Sorry, not enough time for me to analyze tail position (using an attribute grammar approach: http://wiki.ecmascript.org/doku.php?id=strawman:proper_tail_...). Ten days without much sleep to build JS from scratch, "make it look like Java" (I made it look like C), and smuggle in its saving graces: first class functions (closures came later but were part of the plan), Self-ish prototypes (one per instance, not many as in Self).
I'll do better in the next life. "
[1] Edit: jwz.org intercepts HN links. See mjgoeke's comment.
https://www.jwz.org/blog/2010/10/every-day-i-learn-something-new-and-stupid/#comment-1048> I don't think he 'stooped' to anything
Really? This is supposed to be a place for civil, mature discussion. There are plenty of valid arguments against javascript as a language and as a community, there's no need for childish comments like that.
At a higher level of organization, the language begins to matter less and less, and what matters more are that subcomponents within a larger system obey their contracts, and that there's some concurrency strategy if you have distributed state.
Frankly, because from a language design perspective, it is - or at least used to be: Bad scoping rules (implicit global declarations by default, function instead of lexical block scope if var is present), weird implicit conversions, no good story for code reuse/object extension so everyone doing anything complex had to cook up their own version, ...
Nevertheless, I actually enjoy programming in Javascript ;)
It's really not that bad. It's actually a good language, and getting better all the time. See? We can go back and forth, without any substance.
But seriously, modern JS is not that bad.
I don't mind MY JavaScript. It's everyone else's that drives me bonkers. Tracking down things in JS is a timesuck of epic proportions. Much of the time, it just isnt't any fun.
You should look into typescript, it has helped us quite a lot with that particular matter.
I think you mean your codebase rather than JS. There are plenty of industrial JS codebases where this is not a problem.
* figuring out which events are listening to a given DOM element at any given time
* sane debugging for things Facebook Coonnect, which had a really confusing implementation at my last company
* no magically defined functions or variables (i.e. foo["bar"+ someId] = eval("function () {...}")
* keeping CSS out of JS, and JS out of HTML
* dealing with features tightly coupled to an ancient jQuery plug-in
I could go on forever... JS isn't necessarily that bad, but the way people use it is often suboptimal.
> figuring out which events are listening to a given DOM element at any given time
This is part of the DOM Specification, not JS. You may be using JS to manipulate and listen to the DOM, but the reason that browsers don't support doing thing X natively is because the DOM Specification does not specify it.
> * sane debugging for things Facebook Coonnect, which had a really confusing implementation at my last company
Again, this is about a Facebook client library, not Javascript.
> * no magically defined functions or variables (i.e. foo["bar"+ someId] = eval("function () {...}")
If you mean the use of eval to change the runtime environment, pretty much every dynamic language supports some form of eval. It would also be impossible to write certain types of code without eval.
> * keeping CSS out of JS, and JS out of HTML
Not sure how this is a criticism of JS.
> * dealing with features tightly coupled to an ancient jQuery plug-in
Again, this is a common software engineering problem, and has nothing to do with Javascript.
I think you've illustrated some of the reasons that Javascript is so apparently unpopular -- often (but not always) people reference some aspect of the DOM, or jQuery, or whatever vendor-hacked snippets from the late 90s that they remember, without considering that the "bad" parts of the language are by now well known, and there exist extremely efficient and standards-compliant, double-JIT'ed runtimes for JS.
Linters have been around for over a decade and solve all of these issues (as they do in other languages as well). They're also easily integrated in every text editor and build system I've ever seen.
And why shouldn't the interpreter support these rules? Because a linter can do this almost as easily, and not break backward compatibility.
That didn't stop people from wanting to come up with or use different languages in place of C, where possible.
This is really sad, a whole industry that was once inspired by Unix philosophy and was supposed to be beautiful and fun, is now conquered by languages like JS, php, and Java: so ugly and so not fun.
I always thought programming should be something you do cause you like it, not because you're forced to do it. If you use JS cause "everybody else uses it" and "it pays more", then I'm sorry, you're screwed. I thought CS industry belongs to developers, not tech giants (Oracle, Microsoft, ...) who force Java and JS on everybody.
Someday, some body will stand up and say "Enough is Enough".
Edit: If you want to downvote, at least please tell me why I'm wrong...
Why call out Microsoft? They aren't forcing Java or JS. They came up with C# and Typescript instead.
I can't speak to Typescript, but C# is way more fun to write than Java. It's not particularly interesting or glamorous, but it is nicer to write.
This is like saying Coca-Cola is responsible for the high sugar content in Hershey's chocolate. In general.
Disclosure: Microsoft employee.
1) JavaScript has its warts and its gotchas like anything else (okay, maybe a few more). So what? Spend 50 hours building anything substantial with JavaScript and you'll get a good handle on them, and you'll be good to go for the next 10,000 hours. Same goes for just about any other language. Focusing on the weird edge cases might make for a nice blog post, but it's not relevant to people actually building things day to day.
2) Growing pains in a very active community? Unheard of! Okay, so this was embarrassing and disappointing, but at least it's been dealt with. You can keep pointing to it if it helps your argument, but that doesn't make it valid.
3) I don't really understand what point you're trying to make here.
4) Again, very active community. Lots of churn. Plenty of reinventing / rediscovering the wheel. If that _really_ bothers you and you're struggling to separate the signal from the noise, I at least understand and respect that criticism. I don't think that's a reason for anyone to stoop to the level you have, though.