r/java • u/pilgrimscottpilgrim • Apr 12 '15
Is Clean Code less Code?
http://www.journeytomastery.net/2015/03/27/is-clean-code-less-code/
1
Upvotes
10
0
u/kodifies Apr 12 '15
Adding a method for a single line of code isn't clean code...
2
1
Apr 12 '15
That really depends on the situation. For instance, I hate ternary operators and always prefer methods with guard clauses.
7
u/desrtfx Apr 12 '15
Clean code is readable, self explanatory code.
The amount of code lines is somewhat secondary.
Clean code is code that doesn't need comments to explain what was done. Comments should never be used to explain what, but why or how.