
Why JavaScript Deserves More Love Than Hate - chocopeanuts
https://medium.com/better-programming/why-javascript-deserves-more-love-than-hate-8a728d43b79a
======
zelon88
I enjoyed the read. Thank you! In typical internet fashion I'd like to share
my thoughts! Also, I am not a pro with Javascript, so bear that in mind.

> ...Java and C++ — meaning that JavaScript itself must have at least the same
> abilities and capabilities to achieve the things it needs to achieve as
> these languages.

Javascript, Java, and C++ are all Turing complete languages. Technically so is
a Microsoft Excel workbook. Meaning if it is technically possible to compute
something; you can do it using any of these languages.

> The multi-paradigm nature of JavaScript also means that patterns can be
> adapted for its requirements and implemented for best results. You’re not
> bound to a singular inheritance pattern. With JavaScript, you have a choice
> of pseudoclassical, prototypal, and differential, and even functional
> inheritance.

This right here is actually why I am _not_ a fan of Javascript. Can you see
how it can be confusing to understand all the different ways of writing
Javascript? And what typically happens is they all get combined into one SPA
written by several different authors. Not to mention that Javascript
inheritance and the way it works under the hood seems less intuitive than
other languages. For example, "class" is just syntactical sugar and
"inheritance" in Javascript just means "delegation."

And then there's the point you made about floating point precision. So while I
believe you when you say that Javascript is easy enough to pick up, it's not
very approachable. At least not for me. Perhaps you're right though, and I
just to spend more time with it.

Feel free to correct me.

~~~
jwalton
> For example, "class" is just syntactical sugar

This was true up until we got #private vars in JavaScript. Now classes have
their own very special rules very separate from prototype inheritance, to make
this language even more confusing.

~~~
danShumway
I'm still a little upset about that. Privates should have been held back until
we could figure out how to build them in a more generic, consistent way.

Their implementation is very out-of-character with the ideals of the
extensible web. They feel like a hack designed to solve a very specific high-
level problem, rather than a low-level tool that can be adapted in flexible
ways.

The whole thing honestly felt bad. There was a lot of debate around the
standard, some of it pretty toxic. Things that were problematic got pushed
through because nobody could think of a better solution and they didn't want
to delay. The debate kind of degraded from there and people started accusing
the champions of not caring. It's... I dunno. The whole thing felt like a bad
picture of the JS community, and I wish the standard had been temporarily
binned so we could get rid of the worst actors and then think of something
else in an environment with fewer emotions.

There was a never a chance for something good to come out of an environment
that toxic. And there was no reason that privates needed to be standardized
right now. It's OK to take things slowly.

------
bradknowles
So, is this the same javascript that has an average of 1930 items in the
complete chain of all dependencies?

Yeah, I'm not so sure that deserves a lot of love. Unless you mean tough love,
by which that number gets brutally chopped down by an order of magnitude or
more.

~~~
PavlovsCat
That's what people make with it, not the language itself. It's a bit like
saying we should remove clickbaity articles from HTML or HTTP.

------
Fradow
A lot of this is opinion. And a lot of people just don't agree, that's where
the hate comes from.

First, a lot of hate comes not from the language itself but from the ecosystem
(though the ecosystem follows the ideology of the language: hacked together,
go fast and break often). While I used to hate on PHP, I'm now neutral because
I only heard good thing about its ecosystem (the language evolved a lot too,
it helps). Javascript could get there, but a lot of work is needed.

> Being multi-paradigm has its perks

It also has drawbacks. It means you have to learn those paradigms or restrict
yourself to those you know. A codebase use a paradigm you don't know? Though
luck. A codebase use several paradigm at once? Yeah enjoy that.

> It doesn’t matter how robust a language is, an unskilled developer still has
> the same potential to create disasters [...]

That's the crux of the matter. An unskilled developer doesn't have the same
potential to create disasters. Languages with a lot of footguns have more
potential for disasters. Javascript, as a language, has a lot of them. "clear
structural and syntactical requirements" reduce that potential. Enforcing
consistent formatting reduce that. Checking types reduce that. Having less
non-obvious behaviors reduce that. Javascript just don't do any of that.

> As developers, we tend to be biassed towards what we know best.

Well, my main bias is toward what's maintainable and will get the job done
fast. Javascript doesn't rank as well as other languages on the maintainable
part.

> JavaScript is probably the only language where you can copy and paste code
> from Stack Overflow and, 90% of the time, it’ll work the first time around

I didn't have similar results except for very basic code. While we would need
a larger sample rate, I generally have more success with other langagues.

> Everyone talks about learning Angular, React, and Vue, but never really
> about Vanilla JavaScript.

That's because our work is to get the job done, and unless you have very
simple requirements and/or little maintainability concerns, using a framework
is a must (otherwise you end up doing your own framework, invariably worse
than existing frameworks and using up a lot of time).

------
segmondy
There's nothing like a proper language, any language that let's you
communicate clearly is a proper language and so is Javascript. However
javascript has tons of wart, and as much as I personally hate it. I believe
it's a great lang for prototype. My approach these days is to prototype with
javascript and rewrite in whatever my target language is.

