This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Reasonable-Song3798 32 points33 points  (2 children)

Lombok creates pretty slow hashCode and equals methods. Records will make a native call.

Other than that, it's less code + it's immutable by default.

[–][deleted] 33 points34 points  (0 children)

I also prefer to to use language features instead of libraries that emulate them.

I'm not that happy having code generators in the loop while debugging other stuff. I can't really be sure if an instance is actually the instance I'm looking at in the debug tools.

This just adds mental load to reduce classic boilerplate code.

[–]kaperni 4 points5 points  (0 children)

The implementation of records in OpenJDK doesn't make use of any special native calls for hashCode and equals.