![]() Because the ASI feature will take care of the insertion negates the need to add superfluous punctuation. The assumption is that the documentation for the ASI clearly states the cases in which the feature is implemented. The second school of thought is that semicolons should only be used in cases where they are absolutely required. School of Thought: 'Never Use Semicolons' If the ASI feature is altered or changed down the line, code that did not use semicolons may be operating under deprecated functionality. The assumption is that the ASI will never be 100% reliable, but also liable to change with each new version of JavaScript. This thought says that developers should always use semicolons, even in areas where automatic semicolon insertion (ASI) would normally take care of things. School of Thought: 'Always Use Semicolons' To only use semicolons in areas where automatic semicolon insertion does not place them?.To use semicolons as a readability feature?. ![]() The question becomes, is it a best-practice: There are two schools of thought on whether to insert semicolons into code as good practice. Programs must be written for people to read, and only incidentally for machines to execute. ![]() The simple fact is that I do not have any quantitative or qualitative data to prove one is better than the other. This article is about my "opinion." Semicolons should be included when writing JavaScript. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |