3 ms·
Look, I don't disagree that Javascript itself creates some of the problems in its ecosystem, but complaining about 8 whole extra keystrokes to support IE9 doesn
by gnoway 11y ago
Look, I don't disagree that Javascript itself creates some of the problems in its ecosystem, but complaining about 8 whole extra keystrokes to support IE9 doesn't really help.
- nathancahill 11y agoStrawman much? His example was obviously not about the number of keystrokes, it's about the standard lib functions that JS includes. indexOf !== -1 vs includes()
- coldtea 11y agoIrrelevant much? He can just use indexOf != -1 and it will work both in old and new browsers. And whatever JS includes or doesn't include, he should use ONE bloody library, like Lodash to fill in the gaps, instead of some micro-monstrosity like "left-pad".
- shmageggy 11y agoTo fully get the point, extrapolate that example out over every single task you might want to accomplish. As someone who used to do a lot of Javascript for side projects but works daily in Python, returning to Javascript for a new side project this week has been very annoying and frustrating.
- pdkl95 11y ago> extrapolate So what - every language has places with extra verbosity, unfortunate function names, or other minor annoyances. The correct solution to this type of problem is either 1) just type it the compatible way and move on to a real problem, or 2) use an editor macro such as TextMate's snippet[1] feature or the emacs variant yasnippet[2]. Code templates have been a solved problem for a long time. [1] http://manual.macromates.com/en/snippets http://manual.macromates.com/en/snippets [2] https://www.emacswiki.org/emacs/Yasnippet https://www.emacswiki.org/emacs/Yasnippet