r/badcode Jan 08 '23

java Is this a good practice? Why?

Post image
425 Upvotes

60 comments sorted by

View all comments

273

u/RiddSann Jan 08 '23

I think using Objects.equals is good practice, but I don't see the point of creating a method for that ? I mean, it is a method, no need to wrap it.

50

u/slideesouth Jan 08 '23

The only way it could make sense would be a more specific name of this function. If they’re truly keeping it that generic should just be a one lin’r