The text of this article is not in this database — only its details are. Read it on the old site: JavaScript Coding Standards
5 Comments
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
The text of this article is not in this database — only its details are. Read it on the old site: JavaScript Coding Standards
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
Jaganathan BantheswaranPosted Dec 11, 2013, 4:22 AM
Thanks for your update
AnkurPosted Dec 11, 2013, 1:51 AM
Thanks jaganathan.. I made the corrections..also put a note in "introduction" section saying these guidelines are suggestions.
Jaganathan BantheswaranPosted Dec 10, 2013, 11:50 PM
If this article is kind of suggestions, then please recheck about the Title. Javascript Coding Standard means that the coding standard for javascript which globally accepted & SHOULD be followed by Javascript developer. And, there is NO List<> type of constructs, please recheck it
AnkurPosted Dec 10, 2013, 10:34 PM
hi Jaganathan..thanks for the comment....Code style is about consistency and discipline, and there's no real right or wrong. The first step would be to adhere to the style of the used platform and stick to that. It helps others reading your code, and helps you reading the code of others in the same ecosystem, and can only be decided by personal preference. Guidelines posted here are not rules that you should comply to, but consider them as suggestions that can improve your code quality.
Jaganathan BantheswaranPosted Dec 10, 2013, 6:53 AM
I am NOT satisfied with the following points. Please recheck it once again. 1.Always place curly braces ({ and }) on a new line 2. Always put parenthesis around all clauses in if statements. 3.Declare each variable independently, not in the same statement. 4.Parameters in method declarations should be on separate lines and all parameters should be left-aligned. 5.Parameters in method calls should be on separate lines with all parameters left aligned. 6.Declare all variables at the beginning of a function. Do not place declarations throughout the function body. 7.Use // or /// but do NOT use /* */