3 ms·
Are people manually writing getters and setters? Every Java IDE I've used has the ability to generate them for you.
by dmux 10y ago
Are people manually writing getters and setters? Every Java IDE I've used has the ability to generate them for you.
- djsumdog 10y agoCode generation is a design smell. You shouldn't need it, and it makes the code terrible and less readable. Use Lombok, not the IDE.
- agentgt 10y agoWhen I see some one complaining code generation being design smell I gag a little at this hackneyed Fowler expression. I'm curios what do you think lambok does?
- nine_k 10y agoIt does code generation. What id does not is _source_ code generation. That is, you never see the code Lombok generates, never have to maintain it, and never have a chance to break it by editing. You can see it as a macro substitution. OTOH IDE-generated code is "normal" source code, adding boilerplate to your "real" code, not tracking changes in it automatically, and perfectly breakable.
- st3v3r 10y ago"Code generation is a design smell." What do you think Lombok is doing?
- kentosi 10y agoI think that the point is that you shouldn't have to rely on an IDE in the first place.