
You Don't Have to Use JavaScript - berserker-one
https://medium.com/javascript-non-grata/the-super-surrogates-of-javascript-862460199915
======
krapp
Using a language that compiles to javascript is still using javascript,
though.

I think what the author meant to say is "you can pretend you're not writing
javascript, even though you really are."

But once you compile that better, safer, saner language into the untyped,
dynamic, poorly designed mess that is javascript, and run it in the volatile
environment of a browser, it's still javascript running in a browser.

~~~
horrido
That's like saying if you compile C++ to Intel x86 assembler, you're still
programming in assembler. JavaScript is the "assembly language" of the web;
compiling (transpiling) to it is not _directly_ programming in it.

Now, you're half-right in that you may occasionally need to drop into
JavaScript to do some "low level" things. This is no different from C++, where
you may occasionally need to drop into x86 assembler to do some low level
things, such as local speed optimization, or hitting memory-mapped registers.

In both cases, you're programming at a higher level using safer and more
sophisticated abstractions.

~~~
krapp
It's similar, but not the same. Moving from C++ to assembler is dropping from
a high level of abstraction to a low level of abstraction. Moving from, say,
Python to Javascript is just switching one high level language for another -
there is no "lower level." You could just as well save the trouble of the
second language and run a type checker or linter on javascript code itself and
wind up with the same degree of "safety", such as it is.

~~~
horrido
As you pointed out yourself, JavaScript is a poorly designed mess. It may be a
"high level" language, but it's also dangerous to use. None of the linters do
a perfect job of ferreting out all the problems. In other words, JavaScript
will never be 100 per cent "safe" to use. Treating it as a lower level of
abstraction _doesn 't harm us_. It simply gives us a foundation for using
better languages, and that has to be a Good Thing.

------
MoD411
I love how every JS rant has type safety in it. You can immediately tell that
"ranter" does not use JS. Dynamic types are one of the best parts of J s

~~~
berserker-one
??? I don't see any reference to type safety. Are we reading the same article?

~~~
horrido
MoD411 is referring to "loose typing and freewheeling coercions." This is not
about "type safety." It's about having a predictable and reasonable binding of
types. JavaScript is very sloppy in this respect, _especially with regards to
the underlying semantics_.

------
marssaxman
I find that the easiest and most reliable way to avoid having to deal with
JavaScript is to simply avoid doing anything related to the web. Life is
better that way.

~~~
berserker-one
That's pretty hard to do, since nearly _everything_ in IT today is web-
related: enterprise client/server applications; mobile apps; the burgeoning
Internet of Things (IoT).

~~~
marssaxman
...with full awareness of the irony involved, I will note that I actually did
have to write some JavaScript code last year, for work - not because I was
doing anything related to the web, but because I was building some test cases
for our static-analysis tool. So even in this nearly web-free paradise,
JavaScript still managed to wriggle in.

