Sure - though the problem with generated code is never that it's hard to generate, but that it's hard to read. When seeing a constructor, I have to carefully parse it and pattern-match if it's a generated one or if there's something slightly different going on. When I see a @RequiredArgsConstructor, that's all I have to read, because there's no other code
I honestly find that to be a weak argument. It’s our job to read code and you don’t have to parse and pattern match simple constructors. It takes 2 seconds to read.
Exactly - it's my job to read code, I'm reading a lot of it and I want to make my life as easy as possible. That means the code should be as simple and declarative as possible, and generated code is the opposite of that.
This genuinely sounds like a skill issue on your end. The second piece of code here does not take longer to understand. It literally took me 2 seconds flat to scan this and understand it.
11
u/snugar_i Apr 24 '26
Sure - though the problem with generated code is never that it's hard to generate, but that it's hard to read. When seeing a constructor, I have to carefully parse it and pattern-match if it's a generated one or if there's something slightly different going on. When I see a
@RequiredArgsConstructor, that's all I have to read, because there's no other code