2 ms·
The only Java boilerplate that really bothers me is getters/setters. Lack of properties in Java is depressing. And even more depressing lack of any plans to add
by vbezhenar 7y ago
The only Java boilerplate that really bothers me is getters/setters. Lack of properties in Java is depressing. And even more depressing lack of any plans to add properties. There are records for Java 14 which somewhat solve the issue, but they really aimed for a bit different use-case (which is not even that important for me, personally).
Honestly the only reason I would choose Kotlin over Java today is properties. Everything else is nice to have, but absolutely not important.
- wtetzner 7y ago> Everything else is nice to have, but absolutely not important. I would argue the null-checking is important.
- vbezhenar 7y agoThose who need null-checking can use @Nullable @NonNull annotations with static checkers. I've found Idea pretty good and it'll work very similar to Kotlin. Some popular libraries already annotated their interfaces.
- wtetzner 7y agoThe static checkers I found that can check those annotations are very slow. Also, it's not well-integrated into the type system. Sure, you can get by with them, but it's certainly not ideal. It also requires someone to do work to set it up, instead of it just being the default.