Re:Astonishing Performance of .NET 5
by mwcampbell on Thursday November 12, 2020 @09:51AM
(#25070458)
> In .NET, the usual convention is that you make required things constructor arguments, so that there's no room for confusion.
Except in Windows Forms, where the norm is a zero-argument constructor and setting everything via properties, because that approach works with component-based design-time tools. Come to think of it, I think WPF and its descendants do the same.
Re:Astonishing Performance of .NET 5
by mumblemumble on Thursday November 12, 2020 @10:33AM
(#25070923)
It's been a while since I touched either WinForms or WPF, but, if I recall correctly how things worked, I don't think this is actually an exception to the convention. Don't they also make everything optional? In which case, the correct way to follow the pattern would be to also leave the constructor parameterless and configure everything via properties.
Personally, I quite like that quite a bit compared to platforms and frameworks where the convention seems instead to be, "RTFM or die (at run time)."