Please, help me correct my prejudices :)
Please, help me correct my prejudices :)
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.
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.
I've been a .NET Dev for 20 years. C# keeps trucking along adding features at neck-breaking pace. That can be good and bad. Personally I wish F# had more resources assigned to it at MS. Having said that C# seems to be getting more and more F# features as time goes on.
I did a small amount of Java in my career, and learned golang on my own time. Neither clicked with me or swayed me to consider a move to full-time employment using those langs. I've been learning Rust most recently and I'm considering looking for a job doing Rust.
This absolutely. Or that they had avoided the usual NIH MS is prone to, and just supported another ML variant (thus reducing the load to match the resourcing).
About 6 months ago I had a side project where I took a C++ library and decided I'd try to translate it into every language that supports C/C++ Interop, to have a canonical "C Interop reference + comparison" repo for anyone interested
I found out that C# could do this, and started looking into how.
Long story short, it's now possible to use C# and .NET to directly interop with C/C++. Function Pointers, structs and all. You can publish a binary or static/dynamic library for any platform that's natively compiled -- zero dependencies.
It allows you to manually allocate memory and provide allocation strategies. Shit, you can even turn the GC off entirely (at this point the language is very barebones).
See ZeroSharp by same author:
https://github.com/MichalStrehovsky/zerosharp
So on top of this surprising viability for fairly low-level or native programming, it's also:
- Just generally good at everything/bad at nothing
- Blazingly performant, and getting faster consistently. Both at a language/computation level, and for things like web servers. ASP .NET Core Kestrel webserver has throughput only topped by a handful of Rust/C++ libs, and most recent preview included a new functional router API that increased throughout by +100,000rps.
- C# as a language is evolving rapidly and has already become a solid multi paradigm lang. Adopting FP functional features like pattern matching and lambdas. It has LINQ. It's actually pleasant to write now and doesn't always feel like verbose enterprise garbage. (I prefer modeling entities as classes/structs + using pure functions for working with them)
- The tooling and ecosystem of C# and .NET are rivaled only by the JVM. The developer experience and quality/depth of libraries available are fantastic.
There's more but that's off the top of my head.
Needless to say the last few months visiting C# and .NET land have changed my former opinion.
Note that this has always been possible - good native interop has been one the design goals from day 1. But recent features have definitely made native interop much nicer.
F# :)
Seriously though, I think regardless which flavor you use .NET Core is pretty good. You can work on whatever platform you like and deploy to any platform you like. There is usually at least one good library for the most common tasks (http, database access, cloud, big data) you might encounter while working as a software engineer.
> but Microsoft's software is known for being buggier than one would expect
I am not sure about this. Microsoft's software is used a lot more than anything else. They invested in software quality and FOSS a lot since the Ballmer era. I am generally pretty happy with the quality of MS software I use (.NET Core, VS Code, F#).
Having grown up with C, then C++ I find C# as the best compromise: expressive language, garbage collection, good performance, non-fussy syntax. When C# first showed up it was painful because for every other thing you had to call out to native Win32 libraries but nowadays I almost never find myself doing that.
Over the years the team added new language/runtime features at just about the right time: tasks, async, dynamic, reasonably tasteful collections.
For me Visual Studio Enterprise is a big part of it as well. I like plenty of open-source alternatives but honestly VS is where it's at.
For example, I always found "edit and continue" really flakey in VS - it was really slow, sometimes using it resulted in a long hang or an outright crash, and quite often the IDE wouldn't even give me the option to use it. Rider is rock-solid by comparison - I'd say VS (with ReSharper) and Rider are roughly at feature parity, but Rider kicks VS's arse on stability and performance.
Another thing I'd add is that all of Microsoft's UserVoice-type feedback sites are an absolute joke - you might as well be piping your ideas into `/dev/null`. I feel like JetBrains actually listens much more to what developers are asking for.
Huge fan of Rider, and actually JetBrains the company too.
it allows you to evaluate expressions at fly
it allows you to back in time (move e.g 2 LoC above)
it allows you to use the Immediate window to debug and evaluate expressions, execute statements, and print variable values. The Immediate window evaluates expressions by building and using the currently selected project.
Everything from the fantastic IDE and tooling, to the massive and comprehensive standard library, to the wide range of outputs (CLIs, websites, APIs, mobile apps, games, native desktop apps), to the cutting-edge projects like Blazor (first component-based UI framework not in JS that can be run client or server-side) means you can build whatever you want without much overhead. Even language and framework features like LINQ are unmatched.
If you want a single word, I'd say it comes down to pure productivity.
- very active language development, modern functional features - very strong standard library. I used to take this for granted, but over the years I realised many other languages and are nowhere near where .NET is - exceptional IDE. VS has no competition
True. Rider comes close, but it's no VS
Interested to know what features or characteristics you feel are absent or lacking in Rider?
Especially tooling, people might like it or not, but I think MS has really strong people working on languages and combining compilers and tools, so you have things like editing code while debugging it (at fly), evaluating expressions at fly, IDEs that makes you use refactor often and make your life waay easier and those are only things that I notice the most
We could start with the one that MS code is notably buggy :)
As far as I know most of the bread-and-butter consumer visible stuff is still mostly c++ (e.g. office suite, windows, etc.). I imagine there is a bunch of C# in Azure etc.
I could easily be wrong, been a while since I've spent much time with anyone working there. But these things have momentum and clean rewrites usually fail.
All of those are mostly ok, but we encounter reliability issues on a more frequent basis than software from other vendors, like Amazon and Google.
C# is a heavily OO language with powerful semantics. If you like Java but hate the JVM, C# is your friend. C# has traditionally had much better developer aesthetics than Java but that gap has closed some.
Also worth noting the Java licensing has gone batshit insane in the last version or two.
The problem is that there are always those that rather go with CentOS.