4 ms·
Consider the following two cases: 1. MyClass has 10 private fields, each with a trivial getter and setter. 2. YourClass has 10 private fields, of which 9 have
by marvy 6y ago
Consider the following two cases:
1. MyClass has 10 private fields, each with a trivial getter and setter.
2. YourClass has 10 private fields, of which 9 have a trivial getter and setter. The last one has a trivial getter but the setter is non-trivial.
If you use your IDE to write your getters and setters, than the two classes above will look the same at glance.
If you use Lombok, the "special" field will stick out at once.
Personally, I prefer to avoid Lombok and just use public fields. That way, the field with a nontrivial setter will also stick out, and no need for bytecode magic.
- pjmlp 6y agoWhen I use my IDE, I use its code navigation features to my profit.
- marvy 6y agoOkay now I'm curious: what IDE do you use that makes this a non-issue?
- pjmlp 6y agoEclipse, here are some tips. - Ctrl + shift + T => search for types - Ctrl + O => search for methods - Ctrl + T => switch between classes - Filters, https://help.eclipse.org/2020-12/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Fconcepts%2Fconcept-java-views-filtering.htm https://help.eclipse.org/2020-12/index.jsp?topic=%2Forg.ecli...