4 ms·
The problem with the default constructors is just that for value types, you can't not have one. For plenty of kinds of things, there's no sensible default valu
by sixbrx 11y ago
The problem with the default constructors is just that for value types, you can't not have one. For plenty of kinds of things, there's no sensible default value that would make any sense, but your type must admit such a value anyway, there is no choice.
Which means when you have a value of the type, you can't assume it's in a valid state. You have to put checking code somewhere, either in each method of the type, or in functions that receive the type as a parameter, in clients that create objects of the type, etc.