
Javascript is a buffet, not the enemy [video] - ezequiel-garzon
https://scriptconf.org/blog/javascript-is-a-buffet-not-the-enemy-chris-heilmann/
======
niftich
I haven't watched the 55-minute talk yet, but the 82 slides can be clicked
through (ironically, the embed in the article didn't work for me on /any/
browser, but here's a direct link: [1]).

The slides channel an uplifting attitude; it's okay to try tools and solutions
you end up not liking in the end; it's okay to experiment; we're all in this
together, and the like. One thing that stood out is the inevitable reference
to how JS is a multi-implementation environment and monoculture is bad, but
sadly this is much less true now than it was five years ago.

Like it or not, this multi-implementation environment has coalesced (for
various, sometimes bitingly valid reasons) around a _very_ limited number of
implementations, and that's just at the runtime layer; in the wider sense of
environments that expose a JS engine and some APIs like Browsers or server-
side runtimes, there's also not much choice left.

To play on the buffet metaphor, a bewilderingly diverse selection of
frameworks, tooling, and quickly-spoiling userland shenanigans exist at the
topmost layer, which is fantastic for user choice, but the Web APIs underneath
are growing every year, surfacing previously nonexistent functionality in the
browser that every website must then decide to ignore or implement. All the
while, the language itself has exited the awkward 10-year stalemate, and is
receiving yearly revisions with major features.

The meme that JS is an awful language needs to subside; the truth is JS is a
now-mature language that is used in a rapidly evolving platform, whose APIs
are hardly a bastion of stability. These days, that platform is largely driven
by the whims of a single vendor, with dominant marketshare on the client, and
a significant presence on the other end.

(edit: before it comes up, I'm aware JS is used in various, very different
environments e.g. the GNOME desktop environment -- some of these criticisms
don't apply to those, but then again, neither do most of the tooling and
libraries. JS in terms of this talk does seem to mean 'The Browser', and not
even Node)

[1]
[https://www.slideshare.net/slideshow/embed_code/key/ILjHOTLR...](https://www.slideshare.net/slideshow/embed_code/key/ILjHOTLRvArC2q)

~~~
ivanbakel
I take issue with the last point: JS has matured like bread, not cheese. No
matter the age or ingrained status of a language, we have to be able to admit
its flaws, rather than go on with some learned helplessness over the whole
ordeal.

We can be dismissive about "memes", but sometimes groupthink is also a thing
people think in a group, because it's justified by common experience. JS has
been developed and provided for out of extreme necessity, and I don't think
it's fair to try and prop it up using the infrastructure that arose out of
that necessity - in some sense, it is the ecosystem around a sewer pipe:
important, but nothing worth building a national park over.

The day we stop asking "why aren't you using something other than Javascript?"
is the day we collectively take a step back in terms of design thinking.

~~~
CharlesW
> _JS has matured like bread, not cheese._

Considering that the language made huge strides forward with ES2015, ES2016,
and ES2017, what does that mean?

> _The day we stop asking "why aren't you using something other than
> Javascript?" is the day we collectively take a step back in terms of design
> thinking._

Spirited debates about JS vs. OCaml are implementation thinking.

------
sidlls
When I look at what the front-end developers at the company I work for have
had to go through with respect to package and dependency management to get an
Angular application going, I cringe.

The problem isn't that JavaScript is a bad language (that's purely
subjective), it's that it has a terrible ecosystem and a community that,
apparently, is willing to accept very low standards in library and package
management.

~~~
Rapzid
I have similar feelings about Python.

~~~
bitexploder
I think JS ecosystem is an order of magnitude more unstable. I can still write
a Django/Flask/Pyramid app in roughly the same way I did 5 years ago. The key
libraries have longer and more consistent development. The whole environment
is just easier to use. Maybe I am biased from nearly a decade of heavy Pyhton
use, but I have written a non-trivial amount of JS code. Angular 1 is
basically a relic. It just isn't a user friendly sandbox to play in. Python
has its warts but we build and use tools in Python and it seems much easier
than JS.

~~~
pfooti
You can still write an Express, Jade, haml, whatever app like it is 2011. The
js world moves fast, but the old libraries are still out there. Plenty of
people writing jquery or knockout code.

Web dev has a fast cycle time, mainly (imo) because products are created and
used and discarded quickly - lots of websites are short-lived one offs. So,
naturally, there's churn.

And as to what my sibling commenter said, I agree. I'm starting to move from
angular 1 to 2, and 2 is better. It has some downright amazing features, and
the tooling is quite excellent. That's why, personally, I'm learning the new
thing.

~~~
alttab
I'm still in the Rails/Bootstrap/jQuery camp. When you need something quick,
that will function, and not look like shit - you really can't beat this
option. It's also easy to teach junior developers, and they strengthen on the
fundamentals first.

~~~
zackify
Needing something quick is subjective honestly. Personally I could build you a
service worker that makes your app offline capable and throw in React
components on whatever pages you need, or setup a whole React / vue / vanilla
js / whatever app structure in 30 minutes thanks to the time I've spent
investigating good packages to use. So I'd say there's many options that are
great and it's sad to see people here in this thread (not you) complain that
there's so much js churn when isn't the whole reason We are developers because
we have a passion for constant learning and building cool things?

~~~
bitexploder
It is true and you are correct t but as a JS novice it is very hard to know
which things are good and which are just new junk.I love learning and
mastering things as much as the next individual. (BTW I have moved to Vue when
I need a fancier front end and Love it). I guess my complaint, if you can call
it that, is that it is hard to find the good stuff and easy to spend hours
fighting node packages and Packers and get nowhere.

~~~
zackify
It keeps coming down to finding the right resources and not wasting time on
the bad projects. And that's totally valid.

We need some sort of js beginner walk through that has a section for each step
in the process and explains the solutions and differences between projects.

ex: step 1 is language fundamentals, step 2 dom manipulation step 3 bundlers
and why you need them. Step 4 frameworks and libraries to build your frontend.
Something like this would be useful but I don't know if anyone is building
something like this for beginners :/

------
jstewartmobile
When the author of the best book on JavaScript programming says we need to
"think of the children" and come up with something better, we probably need to
come up with something better.

------
Animats
Here's a question. The latest versions of Javascript supposedly aren't so bad,
but some legacy features of the language give problems. There's already
"strict mode", which at least requires that variables be declared. Consider a
"strict 2" mode, with more restrictions, intended for new, cleaner code. What
features should "strict 2" disable?

~~~
renke1
I don't think you have to think much about strict mode these days. Most
transpilers automatically compile to strict mode anyway (I think Babel and
TypeScript do).

~~~
Animats
What, nobody writes JavaScript directly any more?

------
cies
JS is compilation target for most modern x-platform UIs. Every big JS project
is compiling some how: ES6/7/etc, TypeScript, Flow (ok, not exactly
compiling), CoffeeScript, Elm, PureScript, Reason, GHCJS, ClojureScript, JSX,
etc. etc.

And that is ok. Until WebAssembly matures, then those compilers will all just
add it as a compiler backend.

~~~
Sanddancer
To the detriment of the end desktop. You end up with an angry fruit salad that
completely ignores the user's color, font, size, etc choices, and tends to
have accessibility problems as well. Cross-platform javascript is just plain
bad.

~~~
cies
I'd say that at some point the accessibility options are better for website
and webapps then for traditional desktop apps.

Color choices are the last of my worries, and we see that this is also greatly
neglected in modern desktop apps (e.g.: Spotify and Chrome taking over the
window title bar on most OSes).

~~~
Sanddancer
There are reasons I try to avoid such "modern" desktop apps. Those choices
make them much less usable and much less discoverable. Native widgets aren't
some plague, they allow consistency and ease of use.

------
pmoriarty
The thing I hate most about Javascript is that if I allow it in my browser, I
expose myself to Javascript vulnerabilities. The other things I hate are ads
delivered by Javascript and tracking enabled by Javascript.

If it weren't for this triumvirate of evil, as a user I wouldn't have a
problem with Javascript at all.

~~~
Terr_
I have Javascript off by default, and whitelist specific sites. (Tiny
extension, one-button switch.)

I encourage folks to try it even for a little while, because it's _shocking_
how much more quickly many sites will load and how much more responsive they
are to things like scrolling or text searches. News articles and arbitrary
google-results especially.

~~~
mercer
I've done the same and it's amazing (and depressing) to notice how different
my experience is between 'no js/ads by default' on my laptop (uMatrix +
uBlock), and 'regular' on my iPad/iPhone.

Even worse, the difference seems to be getting worse and worse. It's a pretty
regular experience for me these days to end up on a website that barely works
on iOS: ridiculously slow, stuttering scroll behavior, inability to scroll
because there's an ad in the way, inability to close popups, fixed position
elements taking at least a third of the screen, and so on. You know the drill.

There's one website that, if I don't use the 'add to instapaper' button within
the first few seconds of loading, completely blocks safari.

Now I can understand how a website becomes bloated and shitty while still
being somewhat usable; users either might put up with it, or it might be
difficult to measure the negative impact of these 'thousand cuts'.

But it baffles me how websites can exist that don't work at all on mobile/iOS
when it's relatively easy to fix (enough to make it shitty usable). Does
nobody look at bounce rates?

~~~
jbreckmckye
> But it baffles me how websites can exist like this

They do so because of the economics of the web. No-one pays for content, but
basic advertising is low revenue. So user experience is squeezed instead, with
video ads and popups.

There are other factors too, of course. Businesses have strange priorities and
can be quite myopic when they compare the value of a new feature with the
value of leaving the site uncluttered. But the main reason scripting is slow
is advertising.

~~~
mercer
Yes, I do get that (and said as much). What I don't get is websites that are
_literally_ unusable on mobile/iOS. There's no upside to that.

~~~
jbreckmckye
From my experience,

i) the people who push features don't actually use them;

ii) people overestimate the pain users will go through to reach their
services;

iii) in a lot of businesses it's actually really _hard_ to advocate doing
nothing - no new features, no further investment, no changes. So something is
done because something seems better than nothing, and thuse the product slowly
accumulates cruft.

~~~
mercer
Yeah, I've had similar experience. But never to the point of making a website
entirely unusable on mobile (which is pretty easy to test for...).

------
ZenPsycho
meta: it would be good if not _every_ thread on HN about javascript devolved
into unproductive complaining about how bad you think it is. It's really not
interesting or enlightening to read, and javascript's various flaws are
already thoroughly covered elsewhere.

~~~
dboreham
Don't forget the threads on HN about Git that descend quickly into a
celebration of how much Git sucks.

But contrary to your thinking, I see these consistent regular events as a
deeply worrying symptom that somehow as an industry we have managed to wind
back progress over the past decade and end up using a pile of sucky stuff.

~~~
ZenPsycho
I see it more as a worrying symptom that software as an industry is full of
people who complain about things they don't understand and don't want to learn
about. the complaining about javascript is very HN culture specific. there are
certainly places where people do complain about it, but only here is it
indulged again and again and again ad nauseum.

there certainly is room in the world for recognising the flaws in javascript
or git and working to fix them, or building something better. but just whining
about how bad it is achieves nothing and it is irritating to read.

