
JavaScript Is Bad - randomdudeonhn
https://ror6ax.wordpress.com/2019/08/27/javascript-is-bad/
======
starbugs
A certain subset of technical people seems to be unable to understand how it
can happen that — what they believe to be — technically inferior solutions can
win major market share and become the defacto standard for decades to come.

Don't get me wrong: I am not saying that JavaScript is great, but I am also
not satisfied with the status quo of the discussion around it.

I don't really see how this contributes anything to improve the situation.
Yes, a prototype was done in 10 days. Yes, the web scene has been vibrant and
iterating extremely fast for a long time and that has left marks on the
quality of the technology more often than not. But hey, instead of
complaining, come up with something that is capable of transforming it to the
better!

That's not easy and I suspect it's not solvable by technical means solely. So
it's hard. And it's easier to just write blog posts that complain again and
again.

~~~
johnisgood
Complaining is recognizing that there is an issue. This article is trying to
raise awareness of some issues. It is a start! I do not think that not
providing a solution to all (or some) issues invalidates anything that has
been said. Having a solution is not a necessity. I may point out flaws in a
system, but I do not need to have a solution ready for it, do I? The flaws
exist, with or without a solution.

~~~
starbugs
We've been stuck in this for at least a decade now. That is what I am
referring to with "I am not satisfied with the status quo of the discussion".

The author of this specific article doesn't even seem to consider that there
may be non-technical factors at play that cannot be fixed by coming up with
(yet) a better language.

It's the same over and over again, unfortunately.

~~~
smallnamespace
The discussion never resolves, and _will_ never resolve, because the
participants aren't the same people - there's literally a constant influx of
new, inexperienced developers facing the same issues in a slightly new context
(and hence using new language to describe it).

For another example, just go to Reddit's front page. It's the same trendy
questions from young people a decade earlier as well.

You'll know an online community is on the path to dissolution when it can
'resolve' problems for good.

The same applies to HN: I'm sure my point has been made many times before, and
will be made many times again here.

------
vfc1
I've read it, just another piece with zero substance. So what's the author's
point, why is Javascript bad according to him?

\- because there is no standard library and a lot of things are left to
userland

\- because Axios error handling is less than ideal

\- because bugs sit long time in public repos unanswered

\- because some of the language unusual expression parsing quirk, that I've
yet to find in a real program

\- because projects like Webpack have tons of funding via open collective,
while other important libraries are done on a voluntary basis

I couldn't have put together a more random set of unrelated and largely
irrelevant complaints if I tried to.

~~~
randomdudeonhn
I've tried to explain my point and provide some examples of how the problem
manifests in the ecosystem of the language. While my writing skills may need
work, I would not call the post random.

~~~
vfc1
The stuff you pointed out could be said of any language, any ecosystem,
couldn't it?

There is always some library that is not that well designed that got more
popular than it should, little response from certain Github repos, some less
than ideal language feature that is there due to historical reasons, important
code maintained on a voluntary basis.

Tell me an ecosystem that does not suffer from any of these problems, and I
will show you a language that hardly no one uses (when compared to
Javascript).

This stuff is inevitable, it comes with the years, due to backwards
compatibility, stuff piles up over time. Javascript has resisted particularly
well.

If you don't like Javascript, switch to Typescript for me it's the enterprise
language of the future, for doing both backend and frontend development.

~~~
randomdudeonhn
I won't start even bigger shitstorm by naming better languages in my opinion.
Suffice to say I've never had problems sending headers or getting HTTP status
code in any major language, except JS(examples are linked in the post).

~~~
notyourday
I have never had a problem sending headers or getting http status code in JS.
requite('http') is your friend in node. XMLHttpRequest is your friend in
VanilaJS.

Your beef seems to be with a pile of convenience code added by some other
projects.

------
martpie
Rambling, rambling, rambling. There are so many wrong things in this post that
I don't know where to start, from the design controversy to packages syntax
without talking about the package manager. But other comments will debunk them
better than me.

That said, a lot of people say JavaScript is bad. And yet this language is one
of the most popular one in the world.

And people never ask themselves: "oh, maybe there is something I did not
understand about the language/ecosystem".

> "There are only two kinds of languages: the ones people complain about and
> the ones nobody uses."

Peace.

ps: also, it's not the tools that matter, but what you build.

~~~
randomdudeonhn
Some people never ask themselves "have I actually read what I am
criticising?".

~~~
drewblaisdell
Your account is only one hour old, so some advice: learn to accept criticism
if you’re going to submit your own blog posts to HN.

~~~
johnisgood
In my opinion, it is a pretty lazy criticism if one could call it that. It
implies that popularity necessarily implies quality. This is most definitely
not the case.

"Rambling, rambling, rambling" part is especially unnecessary. How about
quoting parts from the article instead and let us know what you think is
wrong? As it is, I cannot imagine what I would reply to this "criticism",
besides the fact that it incorrectly implies that popularity necessarily means
quality.

------
reimertz
I tried C, C++ and Java at university before I trying JavaScript. For me JS
was the language that made programming fun and exciting.

Your code didn't have to compile, you just write code and debug it in real
time and it ran on both my phone and my computer. For me, the web console felt
like magic, playing around with all the quirky APIs the browser offered.

Later, I realized I could buy a domain and then have my js available to anyone
who went to my website. It felt like the sky was the limit.

Then we got into hardware, and I realized that I could write js using Johnny5
that ran on my Arduino. Without knowing it, I used Node.JS and that opened the
ability to start writing simple backends.

Eventually, I realized my code looked quite bad, nesting callbacks like crazy
(which I later learnt was called callback-hell), but at the time, Promises
became a thing and without knowing it, I kind of grasped the concept of async
functions.

I moved on to creating mobile apps using Phonegap; it was really cool and
worked well until you realized that there are slow Android phones to and you
had to think about performance.

That lead me to try React Native and all of a sudden I had apps running native
UI on both Android and iOS. It also introduced me to Objective-C, Swift and
how to deploy native apps.

What I am trying to convey here is that Javascript was fun and exciting early
on, I could stack knowledge quite easily and pivot into multiple roles with
very low threshold.

Sure, there are many quirks with Javascript but in the end, I'd say it's a
part of the language and what makes it fun. Just look at React Hooks. :)

------
johnisgood
Why was this submission flagged? I really would like to have an explanation.
One may disagree with it, it may be controversial, but does this really
require it to be flagged? After all, it is getting upvotes! I am not exactly
new here but I have no idea what it means for a submission to be flagged or
why it should be flagged vs. just not voting it up.

------
runn1ng
We need to separate two things.

One is that JavaScript is bad. It’s true, but strongly typed languages built
on top of JS improve it immensely. Most people today use TypeScript, I used to
use Flowtype but the history went the other way, oh well. So that part is
being fixed.

The other part is the package management, and the ecosystem, and that’s almost
independent on JavaScript the language. And well, the situation there sucks so
much that I needed to escape to backend world, since I don’t want to deal with
broken webpack plugins anymore.

Don’t get me wrong, it’s also broken in python and golang (my current
languages), but people at least ADMIT it’s a problem, and in golang folks try
to fix the vendor/ mess with modules. (Python... ugh.)

I wish the npm mess was getting better, but while yarn at least solved some
sub-problem, the whole thing doesn’t get better. Back to golang I go, I feel
happy here.

(Well unless I have to copy paste Apply for the 30th time.)

------
hankstenberg
Javascript is extremely flexible and unopnionated. It is very easy to write
horrible code in it and very hard to write good code. The same goes for
assembler. But Javascript is still a nice language to compile to, e.g. from
Clojurescript (which is a fantastic and very opinionated language). It can run
virtually anywhere and modern Javascript engines start up very fast, making
them ideal for stuff like AWS lambda and even CLI tools.

~~~
bluewalt
To me, the fact we need another language to compile to it, is just another
proof the language is broken

------
wolframhempel
I'd argue that JavaScript was - coincidentally - a lean design. Meaning:
minimal MVP, go to market early, grow with consumer demand. Sure, this results
in a less intellectually pure programming language, but instead in a rugged
workhorse that remains widely accessible. Not sure that's a bad thing.

------
bluewalt
After reading almost all comments, all of this make me think that your
positions on the debate are based on psychological characters. Some people are
_idealists_ : as Javascript is in some state, but could have been a lot better
if history had been different, they CAN'T be happy, they won't. They need to
find THE right tool before working with it (I'm an idealist). Then, you have
other kind of people which are more _adaptative_ : they tend to accept the
situation "as is", and try to withdraw the maximum of benefits of the
language. It's easier for them do deal with the issues because they accepted
the situation initially. BTW, I think those people are more happy in their
daily life. And last, the _negationists_ : they refuse to accept the truth.
Those people rely on wrong things (like trends) to evaluate the quality of the
language. For them, if JS is used so much, it MUST be good, even if they're
not sure why. They believe world auto-regulate itself with natural selection
(like ultraliberal people). Plus, if they start to use it, they don't want to
hear it's bad because it would question their choice, and by extension, their
intelligence.

------
tekkk
If there's something developers like to complain about it is JavaScript and
JIRA among other things...

I agree with the overall thesis but do not like the presentation. The world is
run by hacks one uglier than the other. Javascript, despite its faults, had
some good parts that let it grow to the size it currently is. Yet I do not
know do we need more preaching about that JS is outdated and we should move
on, I at least have already shifted my focus to a new more productive language
(granted TS isn't that big of a jump). JS to me is legacy, and I am expecting
it to be slowly phased-out as soon as better alternatives become available in
the form of WASM or by compiling to JS.

But JS had a good run and contrary to a lot of folks who keep complaining
about it, I appreciate what it gave us in the form of simple package-manager
(npm was revolutionary at the time, and yes it has its faults). All the
amazing frameworks and libraries people have put time and thought into (React,
Vue etc) which may have not always been the most bug-free, but I see the
proliferation of libraries as a good thing - JS ecosystem has always been
constantly changing. When the barrier for creating libraries has become so
low, it accelerates the adoption and propagation of fantastic new tools that
constantly evolve. Sure, I would like to have also the reliability of the more
mature ecosystems but what can you do?

I think I have dabbled so long in JS that it doesn't bother me that much
anymore. I mean, who can keep questioning why houses look like they do or why
cars drive in certain side every day? It just is what it is. I'm busy building
stuff so it feels like waste of my time to keep ruminating on these things.
And well, I do mainly TS now so it's not that bad.

------
vnchr
English is bad. JavaScript is bad. US customary measurement system is bad.

And you still have to deal with them all. This site is famously written in
something cool that’s not JS (EDIT: I thought wrongly that it was Perl). Oh,
what's that `hn.js` in the Sources? And you're back to using JavaScript.

JavaScript may be bad, but you need us JS devs to do what we do. We are vital
to the advancement of civilization as long as web browsers relying on JS are
an essential platform for human communication.

I recently started writing in Golang--it's great! Really enjoyable. The
ecosystem is making me act like a better developer. Golang Is Good.

But JavaScript, that's my job. JavaScript isn't going away. We are making it
better. We are making better things with it. So "JavaScript Is Bad" all you
want. You're still reliant upon it. It's still essential. It's still going to
be the first programming language of many developers, especially the self-
taught. JavaScript is eating the world.

JavaScript Is Bad. And I'm a bad, bad man. If you can't beat 'em, join 'em.

~~~
tyingq
_" This site is famously written in Perl."_

HN? No.
[https://en.wikipedia.org/wiki/Arc_(programming_language)](https://en.wikipedia.org/wiki/Arc_\(programming_language\))

~~~
vnchr
Thanks! Correction attempted!

------
atemerev
Javascript is fine. It has first-class functions, a minimal but functional
metaobject protocol, lambdas, etc. It is also fast and has familiar syntax to
work with. There are many worse programming languages out there. I admire the
“everything that is popular is wrong” maxim (it is quite popular), but blaming
JS as some sort of ultimate evil is somewhat unsubstantiated.

~~~
jbverschoor
It is exactly because it's so bad (forgiving) and availability (browser) it
became popular. Just like many other tech.

~~~
atemerev
Being forgiving and being easy to learn are good things. The internets are
littered with the graves of unforgiving and hard to learn languages.

~~~
jbverschoor
Yes. Unless you have odd, undefined or unexpected behavior.

------
tyingq
_" how our pluralistic ignorance allowed toy language to first become de-facto
language in the browser"_

I don't know that Eich had lots of obvious choices. I imagine Lua was still
pretty obscure in 95. So the choices were probably tcl and lisp if he wanted
something lightweight and dynamically typed.

~~~
notyourday
Lua makes JS look positively divine.

~~~
chosenbreed37
> Lua makes JS look positively divine.

Mmm...just had a quick glance at the language reference. Couldn't see anything
that would make it inferior to JS. Care to elaborate?

~~~
notyourday
Who needs array length?! That's like, dirty. Write your own by iterating via
all elements!

What do you mean you want to be able to get, like, keys of your object?! No
one needs that! Write your own by iterating through the elements!

It's a name of a variable! Unless it is an identifier of a field. But we write
it the same way. Here we even provide you a doc of this being a "got ya!" We
documented it, so it is cool.

Don't even get me started on error stack using pcall() nonsense.

And if you really want to have a good time try figuring out how local
variables scope interacts with each other... or with a goto.

I can go on and on and on.

------
t0astbread
This is a classic on Hacker News: Some smug elitist rambling about whatever's
currently popular by being super nitpicky because it's not their preferred
solution.

How about writing a blog post about what you would use instead of JavaScript
and why it's good instead of this? That might even help someone.

------
harimau777
I don't disagree with the article. However, I'd also argue that JavaScript is
good in that it is the best option for functional programming which has an
approachable syntax and jobs available.

I guess what I'm saying is that I'd love to be able to start using a better
language that allowed me do functional programming on the job. However, I'd
rather keep using JavaScript than use a better language that didn't allow me
to use functional programming.

~~~
dahfizz
Have you ever used... A functional language? JavaScript has lambdas and
functions, but I would hardly call it functional. Having types and
immutability and pattern matching are pretty important. Being able to run
multithreaded would also be very nice.

~~~
harimau777
With Lodash I also get currying and sort of pattern matching (via conditional
execution). To be fair, I probably should have said that I was considering the
situation when commonly used libraries are available.

Immutability isn't enforced, but I have all the tools that I need to choose to
handle data immutably.

I completely agree with you on types though. I don't know that much about
TypeScript, but perhaps it would help?

You definitely have a point that functional programming would be much better
in JS if these features were built in and/or enforced. However, the problem
is: what's the alternative? Haskell/Clojure/Ocaml jobs aren't exactly common.
And at least in terms of Haskell and Ocaml, I've found the syntax to be pretty
arcane.

------
therealmarv
There was never ever a design board for the Internet we know today. Actually
when looking back many things look like ducktapes on ducktapes on the Internet
and we can be happy that a whole industry takes care on it so that it will
keep working reliable. I also think that Webpack and OpenSSL are two
completely different things (it's like comparing apples with oranges)

Nowadays you either deal with JavaScript one way or the other or stay away
from the browser entirely. Deal with it.

Btw. I also think that JavaScript has many flaws which are based on history...
but from a practical point of view I don't have time to reinvent the Internet
or time get too much bothered by it ;)

------
Deukhoofd
Where do you get the info that OpenSSL only gets 100k $ a year? I see 2
exceptional sponsors, and 5 Platinum sponsors. That comes down to at least
400k $ a year. This is not including other donations they receive.

------
cm2187
The word "popular" can mean widely used or widely liked. I think popular in
the case of javascript is more the former but people often imply the latter.
By usage, death and taxes are popular too!

~~~
randomdudeonhn
Unfortunately, I keep hearing from many developers that JS is popular and
therefore cannot be "that bad". Which it is, in spades.

------
anticristi
I would very much love to read a prequel article that defines "bad". I define
a "good" programming language and framework as having as many of the following
properties:

* It can quickly solve a problem, e.g., build a webapp that uploads cat pictures.

* It is here to stay, i.e., my investment in using and learning that tool won't be subject to hyperinflation.

* It has a good enough base, i.e., I can quickly recruit someone to scale-up my problem solving.

According to my definition JS _is_ good, or, at the very least, is good in
2019.

~~~
johnisgood
It really depends on the type of problem. In many cases, C was really great to
use to quickly solve a problem. It is here to stay, and has a good enough
base.

~~~
anticristi
We seem to a agree. C is also good (according to my definition) to solve
problems in the area of system tooling. I tend to see programming languages as
DSLs for a specific problem domain. C has become the DSL of software that lies
close to the hardware, whereas JS has become the DSL of webapps.

~~~
johnisgood
Yes, I agree. I do not stick to one "ultimate" programming language. I pick
one (or two!) based on the problem at hand. I once used FastCGI + C because it
made more sense and was quick to implement. :D

------
johnmarcus
So build a better browser with a better language and devs can adopt it. Put up
or shut up. You know what's almost as old and quickly written as JS?
Complaints about JS.

------
1f97
can anyone tell me why he says that the axios snippet is wrong?

~~~
tasqyn
because nested ifs, I think.

~~~
vonseel
Idk where he was going with that, I think he either doesn’t know what nested
means or he was referencing different codez

------
lpellegr
but TypeScript is great, so JavaScript is not so bad?

------
codegladiator
Hammers are Bad. Look at all the modern tools which are build with
sophistication, and look at hammers, and everyone is using hammers.

------
ulisesrmzroche
Citing the Wat talk in 2019? That’s about as tacky as JNCO jeans

So the bazaar always wins, hmm

------
willbw
This piece reads like the author didn't even bother to read over it once
before posting it. All over the place. Are there no standards here for things
to be upvoted? This is pretty bad writing.

~~~
swalladge
"javascript is bad" == upvotes because it resonates with so many people

------
mhr_online
Does it matter?

------
LargoLasskhyfv
It's just the largest, not the greatest, job creation scheme since the
building of the egyptian pyramids.

So churn we all...

Hail the Powers of Babylon!

