4 ms·
I’m not overly enthusiastic about most of his suggestions. I thin C# has, or is gaining, more appropriate alternatives for all of these. In C# we don’t like fu
by ddek 6y ago
I’m not overly enthusiastic about most of his suggestions. I thin C# has, or is gaining, more appropriate alternatives for all of these.
In C# we don’t like functions with more than a few arguments. 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. This is resolved in C# 9, with init-only properties.
- 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.