3 ms·
> what's so good about C# nowadays? For me, it basically has all the advantages of Kotlin over Java. ASP.NET is also a lot better than any Java web framework I
by mdasen 5y ago
> what's so good about C# nowadays?
For me, it basically has all the advantages of Kotlin over Java. ASP.NET is also a lot better than any Java web framework I've tried. It doesn't really have new concepts, but everything works together without spending time glueing things together. Things just build and run with minimal hassle. Rider and Visual Studio offer excellent tooling that doesn't stop at odd boundaries (think about how most template engines have poor IDE support in the Java world).
With Java, how do you create a data class? Are you making Java Beans (and hoping no one ever makes a mistake)? Are you using a library like Immutables to generate code at compile time? Are you using Kotlin for that and compiling two languages? Are you using the records feature which just landed (out of preview) three months ago and doesn't work the way Java Beans work? Are you using Lombok and installing IDE plugins and doing fun runtime crazy?
C# isn't perfect, but it has a lot of the modern things that a lot of people want that are available in languages like Kotlin. The tooling is first-class and the libraries from Microsoft work well.
.NET offers AOT-compilation that doesn't involve a lot of trade-offs (mostly just binary size which isn't that important to most people). GraalVM is really cool, but also changes the performance characteristics of a lot of Java code and requires the community to think about re-orienting how they write Java programs.
Go is a great language, but many people want more features than the language offers and that isn't likely to change.
> I haven't seen that many projects written in C# that really impress me (like Java or Go excel at)
If you're talking about libraries, it's likely that because you're not a C# dev you aren't looking at C# libraries. If you're saying, "well, I see Kubernetes in Go and Kafka in Scala/JVM, but I don't see any equivalent in C#/.NET," then yes: there are fewer large open source projects in C#/.NET. If I were writing your comment, I would have said, "I see fewer influential open source projects" rather than "projects that really impress me". You're probably not impressed by Kubernetes so much as you note that it is large and influential.
I think C#'s lack of representation here comes down to timing. .NET Core (the first cross-platform .NET) is only 5 years old. At the time, we didn't know whether Microsoft was really committed to .NET Core or if it was just an experiment. By contrast, Kafka is 10 years old and Kubernetes is 7 years old. Both of those influential projects literally couldn't have gone with C# and .NET because they started well before cross-platform .NET really existed (beyond the unofficial Mono effort which didn't offer the same performance or sanction from Microsoft).
If you're coming from the open-source, Linux-deploying side of the world, C# hasn't been an option very long. I would say that it started becoming clear 3 years ago that .NET Core was truly going to be the future for Microsoft.
How many influential open-source projects do you know of that started in the past 3 years? Probably very few.
Realistically, it will take a while for a lot of people coming from the Linux-deploying world to see C#/.NET as a viable ecosystem. It will continue to be viewed suspiciously by some people for a while. If you're looking for influential projects, they don't come along frequently. Hadoop, Spark, Kubernetes, Kafka, etc. are the kinds of things that you don't see every year.
I don't think it's a reflection on the language so much as a reflection on timing and culture. I think C# is still thought of as the Microsoft-only, Windows-centric ecosystem that it used to be. I think people looking to create an influential project know that the broader community will accept projects written in Go, but it's unclear whether the broader community will accept projects written in C# - many people might just be turned off due to their preconceptions. So when you start the next Hadoop, Spark, Kubernetes, or Kafka, do you choose C# and potentially alienate part of the community who write off your project due to preconceptions about the language?
Plus, there's a certain amount of inertia around some areas. Data science and ML are still heavily Python-based. It's not that Python is the best language for those things, but the community is familiar with it and so if you're creating a tool for that community you're going to make it in Python. If you make it in Go or Java, it will just languish without usage and without people improving it. Is that because Python is a better language for impressive data science and ML projects than Go or Java? I think it's more around community knowledge and perception (and the already built tools they might be familiar with and also want to use).
> Also, and maybe this is unfair, but Microsoft's software is known for being buggier than one would expect and I imagine that C# is used a lot there
Yea, that is just unfair. I've found C# to be so easy and seamless. No more headaches around builds, no more headaches about how to glue together Maven generating X while Hibernate expects Y while something else expects Z. I think part of it is that because C# was a Microsoft project for so long, the ecosystem didn't end up with as many camps in it. With Java there was Sun, IBM, and RedHat all kinda pushing similar yet slightly-distinct stuff. I think Java also fell into a problem where so many people tried to solve the "I just need a data class" problem that now we have a bunch of solutions that all act slightly differently and can lead to headaches.
Realistically, this assertion isn't disprovable. "Microsoft software is known for being buggier": is it? As someone who truly hated Windows for a long time, I would definitely have been on that train a while ago. Is their software today of worse quality? Realistically, I don't use Microsoft software much and never really have. I don't really think it's worth addressing this more than I already have since it wasn't really a fair criticism to begin with based on a potentially spurious premise.
- smackeyacky 5y agoGreat comment. The only things I would add: 1. The seamless integration to things like containers (working with Docker Desktop is fantastic - and you can debug your code inside the container). 2. Razor pages. I gave up on hideously complicated SPA and use Razor now. The user experience is similar but it's a lot more secure generating everything on the server. 3. Deploy to AWS ECS or AWS Lambda with a few clicks. You need the AWS tools installed in Visual Studio but as a one man shop this is insanely productive. 4. Write it on Windows, deploy it on anything. The two use cases I use the most are things like Linux based containers but also ancient Windows servers in client environments where the infrastructure guys don't want to install new libraries. I wrote a small web slurping utility that had to be deployed on an old Windows Server 2012 machine and the self contained executable just worked without having to install anything else. .NET Core has been fantastic for me.