5 ms·
“If your method is less than 100 LoC you have to combine them”. “Classes less than 9000 LoC have to be combined and do not deserve their own file.” “Method do
by bastijn 9y ago
“If your method is less than 100 LoC you have to combine them”.
“Classes less than 9000 LoC have to be combined and do not deserve their own file.”
“Method documentation is just because it is required. Contents can be just the method name.”
“Code reuse is king. If you need different functionality but share at least a field just override all methods and do not call base.”
“Just access the resources you need but don’t bother deaccessing, someone else can do that for you.”
“Method names are worthless, their IDE will suggest them anyway.”
“If you need new functionality but do not want to break the old just add another field and an if statement to enter a new code path.”
\\ cheesy US presenter voice \\
Today! in another episode of code reviews at the office!!
Disclaimer: love my job and my colleagues :)
- fhood 9y ago> “If you need new functionality but do not want to break the old just add another field and an of statement to enter a new code path.” Oof. def a(b, c, d, e=None): if e: is way more common in my code than it should be.
- bastijn 9y agoExactly. It’s a competition to beat the previous editor’s cyclomatic complexity score! In fact, I should have said: “If you refactor a method without increasing its cyclomatic complexity don’t bother sending for review.”
- AstralStorm 9y agoUh? Every code should be reviewed. Decreasing complexity can cause inadvertent bugs, including ones not caught by regression tests. Unless this was cheeky sarcasm in which case you shouldn't replace the previous point just add this one.
- bastijn 9y agoI think all the points in this thread are (cheeky) sarcasm :).