News for hackers. Stuff that matters.
Re:Make the Leap from JavaScript to PureScript by Udik on Wednesday May 22, 2019 @03:59PM (#19984866)
If the problem is so bad, why not simply use a linter? Actually, almost all instances of this typo can be caught by a simple regular expression.
Re:Make the Leap from JavaScript to PureScript by T-R on Wednesday May 22, 2019 @04:13PM (#19984983)
Well, that's pretty much equivalent to the the language preventing bugs, for the purpose of the conversation. You can imagine similar cases that would be harder for a linter to pick up. Things like type errors, or accessing the wrong side of a union - in C++ people used Hungarian Notation for a good while to try to make these kind of errors more detectable; now some languages have tagged unions/sum types to make them nearly impossible. The point where a linter is distinct from the language in catching syntactically evident errors is that, even if I use a linter for my own code, that isn't the same as having buy-in from the whole team to block any code that doesn't pass the linter from shipping to production; language syntax, on the other hand, is implicitly agreed upon.

Addressing this specific example, historically, running a linter all the time wasn't always practical, and `if(a = b)` was used intentionally a lot, e.g. to inline a check for a null pointer with an assignment.