3 ms·
> If you have 10 fields in your class, a constructor with 10 arguments is not appropriate. Instead we prefer object initialisers, but this requires exposing the
by walleeee 6y ago
> If you have 10 fields in your class, a constructor with 10 arguments is not appropriate. Instead we prefer object initialisers, but this requires exposing the ‘set’ method, and allowing mutability.
Why not have the ctor accept a single options object? At least if initialization is your only reason for allowing mutable props.