3 ms·
Anything Java can do Kotlin can do better
- daddykotex 9y agoIn your model example, you forgot to override hashCode as one should: https://stackoverflow.com/questions/2265503/why-do-i-need-to-override-the-equals-and-hashcode-methods-in-java https://stackoverflow.com/questions/2265503/why-do-i-need-to... EDIT: nvm, I completely missed it
- qw 9y agoLombok takes care of all the boiler plate code for Java mentioned in the article. Just add a @Data annotation and you will never have to see a getter/setter or generate hashcode unless you have a special need for it. Lombok can even provide a builder, which is my preferred way of creating immutable objects. There is also a Lombok-plugin for Intellij IDEA that enables you to use the autogenerated getters/setters in the editor. I'm surprised that Lombok is not used more.
- mindcrime 9y agoThere is also a Lombok-plugin for Intellij IDEA Not to mention the companion plugin for Eclipse.