Hacker News new | ask | show | jobs
by marvy 1977 days 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.

1 comments

When I use my IDE, I use its code navigation features to my profit.
Okay now I'm curious: what IDE do you use that makes this a non-issue?
Eclipse, 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.ecli...