notes on "Clean Code - Formatting" chapter
07 Oct 2014- Formatting is important
- A source code file should read like a newspaper article.
- Name should be simple and explanatory.
- Top parts of the file should provide high-level concepts.
- The lower == the more detailed information.
- Blank lines help in identification of separate concepts.
- Pieces of code which are related should be kept close in source code.
- Instance variables should live at the top of the class file.
- Local variables should be declared as close as possible to the place of usage.
- Code which is executed from a function, should be below that function.
- Lines should be at most 120 columns wide. (Uncle’s Bob personal preference)
- Preserve indentation of blocks.
Set team formatting rules and make everyone use them!