Sometimes during code review we see code that we don’t like and it breaks clean code principles. To avoid an harsh commentary we can quote some recognized expert to ‘kindly’ ask for a change in the code. Even better some quotes are funny and could help other developers to improve their code.

I’ll add more comments as I find something interesting.

Comments

Every time you write a comment, you should grimace and feel the failure of your ability of expression.

Clean Code, Robert C. Martin

Too many parameters

The ideal number of arguments for a function is zero (niladic). Next comes one (monadic), followed closely by two (dyadic). Three arguments (triadic) should be avoided where possible. More than three (polyadic) requires very special justification—and then shouldn’t be used anyway.

Clean Code, Robert C. Martin

Too many static methods

The use of static methods, in any context, is a perfect indicator of a bad programmer who has no idea what OOP is. There can be no excuse for a static method in any situation.

Elegant Objects, Yegor Bugayenko

Field Dependency Injection (@Inject, @Autowired)

Field injections is just lipstick on the pig in that regard., A field injected class won’t survive one of my code reviews, the same as no untested code will.

Why field injection is evil, Olivier Gierke