Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
Thanks,
Dean
Yosuf Ibrahim wrote:I would like to know why is splitting some lines of codes neater and more readable
What you then posted is incorrectly indented; you need empty lines between successive methods. No wonder that isn't clear.Yosuf Ibrahim wrote:. . . Way neater, easily readable and more organized than this. . .
See, three lines, and yes, I did say that. That method is now clearly indented, so everybody can see where it starts and finishes, how many statements it contains, etc. If you use Allman indentation, that becomes four lines.If you find Allman indentation easier to read, then make a policy of using it. If you are using an IDE, Junilu is right to say feed the options to your IDE and let it do all the indenting, and also that all members of a team must conform to local conventions.the smallest method should be at least 3 lines long . . .
Campbell Ritchie wrote:If you use Allman indentation, that becomes four lines.
“The strongest of all warriors are these two — Time and Patience.” ― Leo Tolstoy, War and Peace
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
Campbell Ritchie wrote:Make sure to give a good explanation for coding styles.
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |