4 ms·
> public thing Thing = new Thing(); can we please please please stop making programming languages like this
by voldacar 6y ago
> public thing Thing = new Thing();
can we please please please stop making programming languages like this
- older 6y agoIn C# 9 you can write it like this: public Thing _thing = new();
- manigandham 6y agoC# is almost 20 years old. What would you change this statement?
- starik36 6y agoYou can do the following to shorten that depending on context: var thing = new Thing(); Thing thing = new();
- thomasz 6y agoIt's rather old school style. C# has had local type inference for ages.
- winrid 6y agoOne time C++ is more terse: public: Thing thing :) Really though this is just the old way to write C#. Even Java is starting to update this pattern.