19 ms·
I can't believe this is the top comment. Let's go point by point: 1) JavaScript has its warts and its gotchas like anything else (okay, maybe a few more). So w
by alexwebb2 10y ago
I can't believe this is the top comment. Let's go point by point:
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.
- amorphid 10y ago>> Spend 50 hours building anything substantial with JavaScript and you'll get a good handle on... 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.
- axlee 10y ago> 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.
- yid 10y ago> Tracking down things in JS is a timesuck of epic proportions. I think you mean your codebase rather than JS. There are plenty of industrial JS codebases where this is not a problem.
- amorphid 10y agoI'll be the first to confess I'm not a JS wizard. That being said, it'd be nice for the following to be easier: * 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.
- yid 10y agoNot to be too pedantic, but most of those things have nothing to do with JS. > 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.
- behnamoh 10y agoIf only web developers would unite and put an end to JS once and for all. 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...
- serge2k 10y ago> (Oracle, Microsoft, ...) who force Java and JS on everybody. 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.
- behnamoh 10y agoI meant in general. Microsoft did force their flawed Windows on everybody anyway.
- dpark 10y agoMicrosoft forced Windows on everyone, therefore by the transitive property of online griping, Microsoft also forced JS and Java on everyone? But in general, so it makes sense. This is like saying Coca-Cola is responsible for the high sugar content in Hershey's chocolate. In general. Disclosure: Microsoft employee.
- lloyd-christmas 10y agoWe've converted all our JS to TS, huge timesaver.
- gaius 10y agoYou are forgetting that even Eich didn't want to do JS; he wanted to embed Scheme but was overruled by suits at Netscape who wanted to ride the Java hype. That's why the semicolons and curly braces. It really is indefensible on technical grounds.
- flukus 10y agoWhat state was guile in at the time? Could we have ended up with that instead of javascript?
- goatlover 10y agoI think they also told him to make it forgiving, like html, so that beginners could use it. Thus the implicit conversion rules, optional semicolons, being able to leave new off a function constructor, not having to use var, and so forth.
- qwer 10y agoThese laundry lists of js warts get dragged out continually, so I really have to ask: How are you people actually developing in javascript and haven't yet discovered linters? 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.
- goatlover 10y agoThe same can be said for C's flaws. Just use a linter. That didn't stop people from wanting to come up with or use different languages in place of C, where possible.
- douche 10y agoIt's too bad nobody pumped the brakes after it was a little successful, and said "Okay guys, let's stop dicking around and do this right now, before we have to deal with it for the next 30 years". Alas...
- zeveb 10y ago> 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. 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.
- seagreen 10y agoIn case Eich reads your comment: given that it had to be done in ten days and "look like Java", JavaScript is a fine langauge. (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_calls 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.
- mjgoeke 10y agoI'd recommend copy+pasting the link to www.jwz.org if you want to open it... https://www.jwz.org/blog/2010/10/every-day-i-learn-something-new-and-stupid/#comment-1048
- roboguy12 10y ago> The ecosystem is terrible and the community is full of self-righteous assholes who has the collective attention span of a 2 year old > 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.
- idobai 10y ago1) JS is a wart. "but it's not relevant to people actually building things day to day." - look at all those crappy electron apps... 4) Very young community not giving a * about optimisation and quality.