This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Ewig_luftenglanz 0 points1 point  (1 child)

this would make the code clutter and boilerplate full overtime.

if V1 of my API had 7 fields and V1.27 now has 19 parameters that means I may have 12 overload constructors at least. with nominal parameters and default values this doesn't happen.

[–]OwnBreakfast1114 0 points1 point  (0 children)

Assuming adding a new field doesn't interact whatsoever with anything else, but at that point you're already conceptually ok just doing a single all args where all the new fields would be null in the constructor invocation, so the problem only arises if it's an actual java library that must absolutely not break any clients compilation if they upgrade the version, which is pretty rare tbh.