Hacker News new | ask | show | jobs
by nothrabannosir 4123 days ago
The "JSlint catches this" argument is valid, but not to defend JS. When you say: "with a linter this doesn't happen," you're defending (Javascript + linter), not Javascript.

Just as when someone says: Typescript would not allow this, or that. Or use strict mode would not allow that. Yes! True. They would not. But they are not JS: they are Typescript, or JS strict mode, or...

There was an article here a while back about "tabooing your words"[0], and I think it applies very well here. Instead of talking about just "Javascript", let's try to not mention it. Say "Ecmascript 5 without any tooling," or "ES 6 with 6to5", or "Ecmascript 5 with a linter", or "Ecmascript 5 in strict mode with a linter."

Suddenly, you will find that everyone in this thread agrees: "Ecmascript 5 in non-strict mode, without special tooling" is a shitty language for humans to write because mistakes so easily go unnoticed. And humans make mistakes.

And if you do use linting, or whatever, no need to feel offended: we're not talking about that language!

In essence, saying "the linter would have caught this" is like saying "Typescript doesn't allow that". It's completely true, but it's a different language.

The author was not talking about "Javscript", but about "Ecmascript 5 in strict mode without tooling." And I think we can all agree: that language is problematic.

[0] https://news.ycombinator.com/item?id=6855568

EDIT: Author was talking about strict mode. Still problematic.

1 comments

> Or use strict mode would not allow that.

It was in strict mode. It allows that.

True, bad example. I was talking in general: the "yes, X has this problem, but if you tweak it to be X', then it doesn't." argument. You're not talking about X but X'.

But you're totally right, use strict is not syntactical. (I think?)