3 ms·
It's really easy to throw a data obj into a map/set and forget to check that it correctly implements equals+hashCode. Or add a field to a data class and forget
by cle 9y ago
It's really easy to throw a data obj into a map/set and forget to check that it correctly implements equals+hashCode. Or add a field to a data class and forget to update equals/hashCode. Or log a list/set/map without realizing that the toString is just going to print some useless hash code. Data classes handle all of that for you, automatically.