3 ms·
I don't see how is that convenient? Java approach will be trivially extended with this JEP and this restriction will be lifted. C# approach probably will never
by vbezhenar 4y ago
I don't see how is that convenient? Java approach will be trivially extended with this JEP and this restriction will be lifted. C# approach probably will never be improved so it'll never be convenient to use.
- ziml77 4y agoIt's not convenient, but it's clear. I would love something akin to this JEP in C#, but I'd want it in a way that makes it very clear that you're executing code prior to the base class' fields being initialized. Something along this lines of this public Foo(int bar) { prector { var baz = bar * bar; base(baz); } ctor { // Foo's constructor code } }
- int_19h 4y agoSince this and base are both keywords, and since () is not overloadable in C#, it adopt Java-like syntax for such calls without breaking backwards compatibility if it ever wants to do the same thing Java did.