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
24
u/halfanothersdozen May 12 '23
The code has literally the same complexity as the one-liner. I'm not positive but I suspect this compiles to the same java byte code. If you're worried that the devs around are going to break this you need to get better devs around you.
The lead here committed the sin of wasting everyone's time both in reading it and in causing a discussion both in his code review and now in a Reddit thread. The argument that the literal number of lines of code is the enemy is completely stupid and people need to chill out and look for actual bugs instead of made up contrived non-existent threats.