3 ms·
It’s pretty well accepted by this point that normal functions in JS get a lot wrong. Inconsistent creation styles, weird hoisting rules - and lets not forget th
by johnfn 8y ago
It’s pretty well accepted by this point that normal functions in JS get a lot wrong. Inconsistent creation styles, weird hoisting rules - and lets not forget the fact that they don’t bind this, which itself is probably one of the top ways to cause a bug in vanilla JS. Each of these are great ways to trip up developers in JS, both amateur and expert. Arrow functions fix them all.
I’m not saying that your 100k loc code bases can’t be built without them. Obviously, once a language is turing complete, then everything is possible. But certain language features tend themselves to create bugs at a higher rate than others because they confound the expectations of even the most experienced developers. Functions are such a feature.
I’m sure your 100k code bass works fine now - but I wonder, if you look through the commit logs, just how many bugs were caused by some of the inconsistencies and strangeness I mentioned above, and I wonder how much of that time and those bugs could have been obviated had you moved. Probably a decent amount.