by simula67 · 10y ago · 0 comments
No, I don't think so. Most people do not use JavaScript since it is useful. They use it since it is the only option available on the browser. There is a BIG difference.
> Creating desktop apps in JavaScript lets developers choose from a vast range of freely available code libraries and frameworks, which takes much of the grunt work out of coding
Lots of languages have a wide array of freely available code tooling and frameworks.
Slightly tangentially though, I wonder if we really really put our mind to it, will we be able to just kill JavaScript ?
I mean, I am sure that there are people out there making a living on JavaScript, but please, take one for the team. Learn something else. I hear it is a hot market for developers.
JavaScript is obviously a flawed language[1] that inspires absolutely bad programming that the rest of us has to deal with. The ecosystem is terrible[2] and the community is full of self-righteous assholes[3] who has the collective attention span of a 2 year old [4].
Let's just call this experiment a failure, cut our losses and just.move.on.
[1] https://www.destroyallsoftware.com/talks/wat
[2] http://www.theregister.co.uk/2016/03/23/npm_left_pad_chaos/
[3] http://atom-morgan.github.io/in-defense-of-douglas-crockford
[4] https://medium.com/@ericclemmons/javascript-fatigue-48d4011b...
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.
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.
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.
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.
The problem with "just calling this experiment a failure"—why that won't work in practice—is that JavaScript is not a failure. It's extremely successful.
Strict mode and linters do not fix everything. This is doubly so if your developers ignore the warnings and errors that the linter throws. The language isn't inherently bad, but plain old JavaScript is not beginner friendly for new developers. It requires the discipline to not just throw things together.
[0]: https://dorey.github.io/JavaScript-Equality-Table/unified/ [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... [2]:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Why don't you all just use === instead of ==?
Tell me, how long does it take to learn it?
Perhaps not a bad language, but I do think it falls into the same category as PHP - just good enough.
It's just good enough to do what we want it to do, and given the lack of choice, we're willing and ready to pile abstraction upon abstraction upon it to try and reduce the pain involved with getting work done.
And like masochists, we look at the results and go "Well, that didn't hurt too bad this time, so I'm willing to go do it again."
Javascript, despite a few ugly gotchas, is an elegant language with a few simple rules that allow for an impressive degree of freedom and flexibility.
JS is my favorite language, hands down... C# is a close second, and that's as much for the tooling as the language, though the p/invoke and native interfaces are pretty awesome. After that, there's some functional languages I like, and have been looking for a reason to use Rust or Go for something... beyond that, most languages have a lot of their own warts.
Wait, do you mean to imply that "passing silently with a weird result" is somehow better than throwing a verbose, descriptive error?
As with so many choices, there is a trade off. If it were possible to point to some system that is unambiguously better on all axes than javascript and its ecosystem, then you'd have a point, but since there isn't, we're back to arguing trade offs, and really, getting upset about the tools other people choose to make things is a pretty fruitless use of time and energy. If people really want to encourage others to move, they'd be better evangelising the solutions they love than berating people for choosing what they choose.
[edit] ES6 is definitely better than a swift kick in the groin. It is certainly better than the original version of javascript. And it is also better than a lobotomy.
You're not contradicting what you are replying to. People are using Javascript because it's the only option, but it is useful to have a lingua franca.
I just wish that lingua franca wasn't Javascript.
I know someone who's wished for "one language to rule them all" for a long time and wants/wanted that to be Visual Basic... It's a matter of perspective as much as anything else.
JS can be a very beautiful/expressive language... and mocking some of the corner cases of coercion doesn't really help the argument. JS started as a language for input validation first... it works in a way that input validation passes/fails very cleanly. It makes it a great transport/middle-man language actually.
The issues of: "utility of lingua franca" and "ubiquity of Javascript" are orthogonal issues.
It seems everyone agrees that Javascript would not have been the first choice of language. There is no short argument there, you have to go out and try at least one other language and compare them.
However, on the second question, I don't see why it is useful to have a lingua franca.
Multiple languages arise out of multiple needs. You want a superfast language for your OS, you want a quick high level language for quickly examining data, you want a language that describes visuals and so forth.
What are the benefits of a lingua franca for the internet, or any other domain? They still get to exchange data in an agreed upon format.
Even getting interoperability between JS and C++—what the browsers do to implement the DOM—has been exceptionally difficult, with innumerable security vulnerabilities resulting from this.
You probably know more about how the browser works than I do, but I think I see what you're saying.
Suppose we implemented a browser that can allows front ends coded in RUST. In my mind, the browser just gives the RUST app its own tab, with its own memory and so forth.
I am not proposing mixing up languages for the a given front end, or for components within an application or anything. Not because I think that would be wrong, but because I haven't thought it through.
Why?
Just because undefined is not a function [0]?
[0] https://twitter.com/vikasgorur/status/744204277745254400
No. I've never understood the anti-[language] viewpoint. Wouldn't it be great to have every language available in every ecosystem? Why bother with web assembly when we could just replace JS with python because that's what _I_ want.
[1] Let's be honest, This is every language. There are some stupid, stupid, STUPID parts of JS that everyone enjoys pointing out. And... since everyone points them out, nobody actually uses them.
[2] It happened and they changed the root cause within a week. I would view that as a pretty good ecosystem. Now take a look at python 2 vs 3. Almost 8 years later, and we still need: http://py3readiness.org/
[3] Every language.
[4] Just because people talk loudly about something, doesn't mean most people use it. 90% of the internet still runs on jQuery: http://trends.builtwith.com/javascript/javascript-library
You see, you don't have to like everything about it to enjoy working with it. I pick the stuff I care about and put my positive energy towards it, instead of my negative energy towards the other. You should try it. You're free to make whatever tools you use right now as easy to use and as quick to learn. Maybe if you try hard enough, us Javascripters might come join your side.
For [2] and [4], they are issues with the ecosystem, which I suppose it related but isn't strictly js, ie., you don't have to use React (shock). For npm, at least that issue has been addressed.
[3] is a social issue...it happens in many places. Can you claim that the university system is flawed due to similar attitudes of students who attend university?
The challenge is navigating such ecosystems in a selective and informed way, which is a programming skill in itself.
Humans that "really wanted to" landed on the Moon, brought hundreds of millions of people out of poverty, cured polio and brought down Communism.
The real problem is that you'll never get that many people to agree on something like killing Javascript and creating something radically superior (whatever that is). The web ecosystem is proof of the highest level of agreement possible on a wide scale.
And to be honest, what's the alternative? If Javascript dies, we won't get a great new common programming language. We'll get 10 mostly walled gardens with barely any compatibility. Unix vendor wars, post-web edition.
Maybe it's the only option available on the browser because it is useful to have a lingua franca for the web.
Now that JS has seen 2 new versions in 2 years, momentum has picked up and it's keeping up with the times much more so than in the late 2000s when its flaws were glaring and apparent. One of the interesting side-effects of the extra effort going into the web platform is the 'wasm' effort [2] which could replace Javascript at some point -- yes, the usual caveats about GC and DOM apply, but they're coming [3][4].
Though the political line is that wasm isn't intended to replace Javascript, once it attains feature parity (like it's headed towards), it'll be trivial to do so, regardless of what the designers intend. When that time comes, JS will probably still be used as a written language, but wasm will become the new compilation target.
[1] https://en.wikipedia.org/wiki/ECMAScript#4th_Edition_.28aban...
[2] https://webassembly.github.io/
Where I live JS jobs are some of the highest paying actually. If anything people are moving to it.
Kill maybe too string a word (languages that reach the level of usage of JavaScript tend to stick around regardless of what's currently popular), but for me the main promise of WebAssembly is to allow web browsers to branch out from JavaScript as the only native programming language of the web (as well as improving performance).
> No, I don't think so. Most people do not use JavaScript since it is useful. They use it since it is the only option available on the browser.
Are you not contradicting yourself here? If people use JS only because it's what's on the browser, then it's only because people see value in ... having a lingua franca for the web.