Hacker News new | ask | show | jobs
by iainmerrick 2929 days ago
There's so much that's great about C#, and that results from really smart, pragmatic, forward-looking language design, that I find it surprising how many aspects of C# development are hampered by really bad design.

Specifically, the backwards compatibility story of the standard library is a mess (all the different .NET Framework versions, or wait, do I mean .NET Standard, or WinRT, or...?) and the package manager (NuGet) is not very impressive.

I figure that the good stuff (the core language design and CLR) comes from Hejlsberg and his team, while the clunky stuff comes from the wider Windows teams at Microsoft.

Are there many people using C# for things other than Windows apps and cross-platform games? I get the impression that Java is still much bigger for cloud infrastructure, finance etc, but maybe I'm wrong.

5 comments

Yeah, I think the switch to .NET Core has been much more painful than it should have been in hindsight. It is vastly improving though and seems like a good choice for new projects.

C# is still massive for web/cloud development, including in finance.

Every time I hear someone say that C# is a well designed language I think of the story of how they had to hack the compiler to get async/await to work, and how F# implemented the same feature as a library. I guess there are different levels of "well designed".
I don't know about the compiler internals, but from the perspective of a C# user, async/await is really excellent. It's easy to use and the resulting code is easy to read and understand. Much simpler than chained futures, Go-style channels, etc. It's good language design in that sense (the implementation may or may not be good).
Can anyone clarify who _invented_ async/await? I thought it was Anders and his group ... perhaps not?
You are definitely right with the library shism (Silverlight to blame). But, on the other hand, it also shows how adaptive this environment is. And not only the language but also the base class library, which independent of actual Factorings (like Silverlight, WinRT, Framework, Mono whatever) allowed a familiar environment to program in.

Java had also its moments (mobile Java, ee java, Android/Google Java, or Microsoft J++ (which btw. Was also Anders doing). About Python I just say 2/3 and let us not start with JavaScript. Languages and class libraries evolve and adapt. Not always to the better but they do and should.

Hmm, I don't think Java has had it nearly as bad historically (possibly apart from the old mobile Java profiles, which I agree were quite painful). Any code using the core classes (math, collections, basic I/O) would always work fine on any JVM, including Android. Porting pure Java code to Android has always been very easy, as it should be.

Whereas I've found with C# that even perfectly innocuous-looking functions would be mysteriously unavailable in Silverlight, say. It has been very hard to pick a C# library subset that's both portable and useful, and Microsoft seem to have taken an awfully long time to sort that out.

I ported huge amounts of code to .NET Core and it was effortless. It always depends which API your code uses. I think that is similar to your Java experience.

The Core API factoring was focused to remove deprecated API. When not using "deprecated" framework API, the porting is pretty easy.

There are many people doing all kind of C# stuff. The Exodus which started with node.js is long over and - from my perspective - C# is used all over in any domain and area.
There is a pretty promising answer to the current package management problems called OneGet:https://github.com/OneGet/oneget

Unfortunately it looks like the original creator/designer was moved off the project and it seems like it has suffered from some internal political issues. Development is happening on it but it looks pretty slow.

There is also Paket which is used by the F# community : https://fsprojects.github.io/Paket/
OneGet is for Windows package manager. Not .net