r/badcode • u/sausage-x-donut • May 12 '23
java Code written by project lead. A comment was added by my team member that the entire method can be replaced with a single line: getErrorsList().contains(message). Project lead responded that we should focus on readability and performance and not on such code review comments.
796
Upvotes
View all comments
Show parent comment
132
u/halfanothersdozen May 12 '23
Yes if you change code so it breaks then you can break the code. Very astute.
I agree it should be simplified but contriving examples of how to ruin a simple if statement is an extremely dumb point to make.