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
2
u/halfanothersdozen May 12 '23
We're not both right. I said this code isn't bad, they said it is. Both can't be true. And I disagree with the premise that more lines, literally just by line count, is bad. The logic is the same. A one liner would be better, but this function itself is fine. The lead should have just made the suggested change and moved on and no drama would have followed.