Coding principles
-
When you are coding you are doing two things
- Telling the machine to do a certain task for you
- Telling others who might look at your code that this is what you are intending to do
- We always focus on the 1st, not 2nd. IMO the point 2 is far more important than 1
-
Don't make your code complier friendly, make it human-friendly.
-
Everyone should be able to read your code like they are reading simple English.
-
Your code can be self-documented or you can add more documents in the form of comments and guides but more importantly, the code should tell a story. The reader should know where to start, how the move forward and where it ends.