Essays Note 2 of 14

Coding Standards Are the Bottom Line for Developers

Rule 1: Names are logic. Variable naming - function naming - class names - file naming, folder management

Rule 2: Comments

Write comments in the code according to [the function of each section]. It’s like writing essays in middle school, when teachers recommended using subheadings: a comment is like a subheading. If you can also add 1, 2, 3, 4 to the comments, it becomes even clearer how many steps the process takes.

Rule 3: Keep conditions as simple and easy to understand as possible. Sometimes there is a not, and sometimes you can do without the not.

If you yourself find a condition a bit convoluted while writing it, then it is definitely not well written, and there is surely a clearer way to write it. Conditions are the crux of the logic; here it is better to write a bit more code to make it clear than to use rather obscure logic that took you quite a while to come up with.

Rule 4: Defensive programming

Rule 1: Names are logic. Variable naming - function naming - class names - file naming, folder management

Rule 2: Comments Write comments in the code according to the function of each section. It’s like writing essays in middle school, when teachers recommended using subheadings:

a comment is like a subheading. If you can also add 1, 2, 3, 4 to the comments, it becomes even clearer how many steps the process takes.

Rule 3: Keep conditions as simple and easy to understand as possible. Sometimes there is a not, and sometimes you can do without the not

If you yourself find a condition a bit convoluted while writing it, then it is definitely not well written, and there is surely a clearer way to write it. Conditions are the crux of the logic; here it is better to write a bit more code to make it clear than to use rather obscure logic that took you quite a while to come up with.

Rule 4: Examples of writing code without an IDE

Rule 5: Defensive programming

Rule 6: Writing code is the easiest part. You have to think in place of the interpreter and understand the meaning of every line of code you write and what it does behind the scenes