Summary of the item 45.
1. Declare a local variable where it is first used.
(Instance variables declaration should be at the top of the class. from Clean Code by Robert C. Martin, page 80)
2. Nearly every local variable declaration should contain an initializer.
3. Prefer for loops to while loops
4. Keep methods small and focused.
Those are very basic rules of clean code.
No comments:
Post a Comment