Skip to content

Comment on React Desktop – React UI Components for OS X El Capitan and Windows 10parent

Comments

> "JS is an ugly language"

What I meant:

"JS is an ugly language, with way too many pitfalls."

IMHO it's ugly from 'within', just look at the JS truth table [1] and video I linked with the quote [2]. I just feel that I have no control of what I am doing with JS.

<rant>

It's quite a paradox, that new people to programming, can get start quick with JS, though are not repelled how easily you can shoot yourself in the foot with it. But maybe they just do not catch the errors..

</rant>

[1] https://dorey.github.io/JavaScript-Equality-Table/ [2] https://www.youtube.com/watch?v=20BySC_6HyY

The link you provided to demonstrate the problem also gives you the solution:

Moral of the story: > > Always use 3 equals unless you have a good reason to use 2.

Tools like ESLint make it easy to enforce this (and to only allow == in the few cases where those good reasons apply).

I think we are getting into deep rant, though I want to say, that even I know this rule of JS (always use 3 equals, unless you know why you need 2) why not make double equal work as triple one?

If we were to rewrite history, that'd probably happen. Now count the number of languages that wouldn't reconsider something if we were able to..

I understand your frustration with js, but let's not pretend it's objectively worse to learn to deal with its pitfalls instead of other languages'.

Because JS makes a point of being backwards compatible. Which is great, because some people out there are still using IE6.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.