News for hackers. Stuff that matters.
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.
Re:Astonishing Performance of .NET 5 by ygra on Thursday November 12, 2020 @10:12AM (#25070693)
You can tell the designer how a particular type has to be created if it doesn't have a parameterless ctor, but yeah, it's generally easier to do it that way.