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

I have been using C# a lot recently. I can't stand it. It feels like it it lacks a coherent design. I'm not a huge Java fan either, but at least it feels coherent to me. I have used a lot of different programming languages and can see the values in their different approaches, but I have a hard time seeing it in C#. Also C#'s tooling is only good on Windows.


what don't you find coherent about the desgin of C#? On HN there is far more value in being specific about your particular concerns rather than giving no reasons. There is a lot stuff written on the design of C#.


Some examples from an old timer.

Currently it has three different ways of using event handlers.

The original way, anonymous delegates and lambdas.

The semantics of for loop which were fixed around C# 6.0, need to hunt down release notes for this one.

Something like .NET Native and .NET Core should have been there on v1.0 instead of tying the runtime to the OS.


Those are 3 options, and have different nuance. They also were added to the language in later versions but you can use what you what works, I find it hard to see how that makes the language incoherent as if multiple options are bad.

What exactly changed with a for loop?

The runtime is different from the c# programming language. Originally when this all started, Windows was the focus and Linux/open-source were not an option, so saying it should be there from v1 doesn't fit when there was only one OS that it was planned to run on.


Multiple designs for the same feature makes a language harder to understand for beginners, only understandable by those that grew up with language.

I got it wrong, it was foreach, not for.

The semantics for the variable were wrong when given into a closure, it was a breaking change in C# 5.0 to fix it.

https://www.jetbrains.com/help/resharper/AccessToForEachVari...

https://stackoverflow.com/questions/12112881/has-foreachs-us...

Thing is, there isn't just one version of Windows, and updating the CLR in place can be lots of fun, to the point many enterprise postpone it ad infinitum.

This was the original driving idea for .NET Core, when ASP team started doing it, making it easy to allow IT to update Windows production servers to newer versions, porting to other platforms came afterwards.


Can you say how those make it incoherent? 3 different ways to define a function, a breaking change in the language a while back. And only their implementation run time was tied to the OS, Mono came along and provided another


They are not the same features, delegates and lambdas are very different even if they look similar, and go far beyond just event handling. Also what language is perfect at version 1? It's good that the language keeps evolving and gets better and beginners can learn just fine.

Are you stuck on .NET Framework? If you arent then .NET Core already solves all of the maintenance problems by being deployed completely self-contained. It's a similar problem with many other language toolchains as well and .NET Framework at least saves work by being a single install that can be automated away with group policies. Enterprises postponing software updates is a problem with the enterprise, not the framework.


Try F#. There is a VS Code plugin with about all the tooling you need. Fully supported by dotnet core, so you don't have to use it on Windows.


I am not a fan of VS Code. It feels clunky and slow. Also Rider's auto complete is much nicer and faster.

So I have considered F#, but it doesn't seem that compelling. Also it seems like the tooling is worse on other platforms.


A friend who uses vim says adding the vim plugin to VS Code makes it very fast. Just passing this on.


Jetbrains Rider = win/macos/linux

Quite competitive with msvs, if not better




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

Search: