Hacker News new | ask | show | jobs
by int_19h 1689 days ago
To be fair, global usings aren't fundamentally different from assembly references (which have always been per-compilation rather than per-file).

With respect to parameterless struct constructors: the reason why C# didn't have that historically is because there are many corner cases where those aren't invoked in CLR. Basically any place where you can't do "new" directly on the struct itself - e.g. when you create an array of structs, its elements do not have the constructor run for them. So C# designers originally decided that it would be less confusing overall if structs were always default-init, in all contexts - which means no parameterless constructors. I'm not sure what prompted the change of mind.