6 ms·
Agreed. Once you use a language with type inference it's hard to go back to Java. Java also lacks properties, which results in boilerplate getter/setters if yo
by coopernurse 15y ago
Agreed. Once you use a language with type inference it's hard to go back to Java.
Java also lacks properties, which results in boilerplate getter/setters if you want to follow idiomatic convention (you could make all the member variables public, but your coworkers would probably shun you).
- benjiweber 15y agoThere are alternatives. e.g. a public final Property<String> Name = new Property<String>(); Where Property defines a .get() and a .set(); However, getters and setters are generally a code smell. It's better to be telling objects to do things rather than ask them for information. Modern Serialization & Injection frameworks no longer require getters/setters.