3 ms·
Great. But teaching beginners not to use semicolons at the end of lines may not be the best of ideas, especially since they can then be caught out when they typ
by TazeTSchnitzel 14y ago
Great. But teaching beginners not to use semicolons at the end of lines may not be the best of ideas, especially since they can then be caught out when they type two lines that JS sees as one.
- maxogden 14y agoif you find an instance in the code examples where ASI doesn't do its job i'd happily merge in a pull request that inserts a semicolon manually https://github.com/maxogden/javascript-for-cats https://github.com/maxogden/javascript-for-cats
- TazeTSchnitzel 14y agoNo no no. Teaching people to only use a semicolon in some cases is even worse. It's far better to just tell them to use semicolons everywhere, as they should. ASI is an error-correction mechanism, after all.
- maxogden 14y agoi'll make you a deal: if you can find a bug caused by me not using semicolons in any of my github repos from the last year i will add a section into jsforcats about using semicolons
- magmadiver 14y agoWell, you're not a beginner, so it doesn't really apply to you. Consistency and completeness are very important to avoid confusion.
- TazeTSchnitzel 14y agoYeah. I don't want begginers to be caught out.
- maxogden 14y agoteaching to a broad audience means balancing the likelihood that the learner will be in over their head (too much information) with the likelihood that they will have a negative experience stemming from lack of information (bug due to missing semicolon). given javascript and its many bad parts I believe the first scenario to be much more likely than the second, especially for an introductory text.