Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It seems Microsoft is not betting on C# and I think the main reason for this is that C# isn't futureproof because of it's ugliness.

It is a powerful and robust language with great standard library, but you just cant be comfortable with it. All those boilerplate, all those sealed override virtual public protected or whatnot before each statement, those curly braces everywhere. You are always inside classes that are inside namespace, and even then you need to go deeper and have curly braces with properties and arrows in random places. Delegates and Events are ugly and unintuitive, two set of syntax for linq (and honestly for almost any somewhat new feature of the language), ref in out, you name it. It is hard to push something so inelegant.



A lot of the last few C# compiler versions have been about "boiler-plate" reduction. Namespaces don't need curly braces any more and are just a single line at the top. You can write some top-level code inside a namespace without it needing to be in a class. More of the properties and method bodies that are simple can also be written entirely with arrows without curly braces.

Delegates and Events were a mistake, but that's a low-level .NET mistake that a lot of modern code can easily ignore, with Action<> and Func<> now reliably almost everywhere and WinForms easy to write off as "dead". (You can especially eliminate the need for the ugliness of Delegates and Events with System.Reactive.Linq.)

Records and Primary Constructors remove a ton of the boiler-plate of writing basic "DTOs" and/or dependency injection.

C# is pretty elegant, and a nicely evolving language. Microsoft isn't any longer trying to bet on C# as a "systems programming language" because too many people see JIT support and VMs as "not low level enough" (including apparently also Anders Hejlsberg), but that doesn't mean C# isn't "future proof".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: