Perhaps you're right in that I do not understand the point of a default constructor. In my own classes, I rarely ever allow the user to initialize it without explicitly defining what they want it to be, because it removes ambiguity and unpredictability. I never use constructors like String
or BigInt
without any arguments, because I have no reason to, and find writing out the value more readable.
As far as "neutral" values concerns, I find that concept a bit subjective (why is the neutral Number
not 1
, since it's equal to its own inverse? Why is the property "being equal to its own negative" perceived as it being neutral?). Perhaps the neutral value for BigInt
should be Infinity
, as it's the biggest int I can think of, though it's not an object of type BigInt
, so it throws an error. I know Infinity
is technically not an integer, or mathematically speaking, it's not even a real number, but my point is that these "neutral" values could be somewhat subjective. I understand what you're saying though; while I would never use String()
or BigInt()
without arguments, I can see your point on why people would. I don't necessarily agree personally with that pattern, but that's not what we're here for to discuss.
As far as the language defending developers, I think it is essential that we move towards this. Of course, developers should learn to use different aspects of the language, but there's no reason not to steer them a little in taking the right path without having to think about it. This doesn't mean the language should be any more or less powerful - things like not allowing to call String()
without any arguments doesn't make the language less powerful, because one could achieve the same result with String('')
(I'm not saying we should move to that specifically; this is demonstrating that you can have the same language capabilities with fewer syntactical options).
You can see a similar pattern in everyday objects. If you have trouble using the washing machine, because it has 40 buttons on it and you don't know which ones to push in which order, then as the designer of that washing machine I could say "bah, people should just learn to use it!" but that's not what design is about. It should be intuitive and easy to use; ideally, you shouldn't even have to think about what buttons to push.
The same goes for programming languages. We can give it all the bells and whistles and expose these in as many ways as we like, or we can wrap up the same exact bells and whistles in a package that's easy to use and steers people towards using it flawlessly without them having to think about it too much.
I hope that clarifies my previous comment a bit.