4 ms·
if the verbosity of javabeans bothers you, you can just use the lombok compiler extension to get similar concepts to what Go provides.
by mbfg 8y ago
if the verbosity of javabeans bothers you, you can just use the lombok compiler extension to get similar concepts to what Go provides.
- snowe2010 8y agough, don't use lombok. it's terrible in so many ways. Either switch to kotlin or use the AutoValue or Immutables libraries.
- mbfg 8y agocan you iterate the terribleness?
- theshrike79 8y agoLombok brings huge amounts of unnecessary magic to the codebase. A new coder diving in to the code will need to either know all the Lombok annotations by heart or look up what every single one of them does. Also it makes debugging kinda crappy for the same reason.
- mbfg 8y agohuge? pretty trivial.. the point of a javabean is you don't need to understand anything. As for annotations, it's not like developers don't need to know a crapton of other annotations as well. It's just the way it is, so a few more aren't a big deal. If you need to debug java beans, you are doing something wrong. you can also delombok if you ever get tired of it, and now your back to manual. I personally don't use lombok, as i'm not offended by the verbosity, given that ides since forever have done all the work, but if it's something you are bothered by, well. that. If an argument is that javabeans are the wrong pattern to use, that's a different argument, and unrelated to lombok.
- ivan_gammel 8y agoLombok is a syntactic sugar for bad design decisions: there should not exist operation like setName - either there’s additional semantics deserving a method with a descriptive name, or the class is just a structure with writable state. I also agree with the comment about unnecessary magic.