Whole books have been written about this. I use the following rules from [1] myself. I like them because they definitely put some constraints on my coding which I like. It forces me to think beforehand and gives me (a junior developer) some guidance which I desperately need:
* Write functions/units that are <= 15 LoC.
* Create units with <4 branching points
* Write functions/units with <5 parameters
These guidelines force you to write maintainable code. Always open for discussion. Note that these lessons are lifted straight from [1].
Comments
Whole books have been written about this. I use the following rules from [1] myself. I like them because they definitely put some constraints on my coding which I like. It forces me to think beforehand and gives me (a junior developer) some guidance which I desperately need:
* Write functions/units that are <= 15 LoC.
* Create units with <4 branching points
* Write functions/units with <5 parameters
These guidelines force you to write maintainable code. Always open for discussion. Note that these lessons are lifted straight from [1].
[1] https://www.softwareimprovementgroup.com/resources/ebook-bui...