This blog post is part of a series of blog posts concerning a Clean Code study circle that we developers at Admeta are persuing during 2009. Here you can find an introduction concerning the question why we are doing this and here you can find an overview of all chapters as well as some study circle recommendations.
Chapter 5 Formatting questions:
Coding Convention conventions:- How many characters per line do you think is maximum?
- What resolution do you use on your monitor?
- How do you typically choose to group code in your classes?
- Do you place a caller and callee method close to each other or group them in some other way
- Where do choose to declare your member variables?
Design considerations:
- Do you agree with that "protected variables" should be avoided? Why / Why not?
- How many rows do you think a class can have before your warning bell start to ring that it might be too big and do too much?
- Is there any reason you can think in which instance variables should be placed anywhere but at the top?
Questions to ponder upon:- The chapter emphasizes quite a lot on grouping code together that belong together. (Vertical Density p79, and Conceptual Affinity on p 84)
- What different group categories do you use and why?
- Where do you draw the line between grouping code with regards to functionality in a class and extracting a group to a new class (according to the Single Responsibility Principle)
- Do you agree upon that all developers in the team should agree on single formatting rules.
- Where do draw the line of agreement?
- How do you select which rules to apply? Voting or something else?
- What on earth is a ”Hollerith limit”?
