8 ms·
I've been a .NET developer for years but I've also been a big Java guy. The lack of an OSS ecosystem in .NET is a huge glaring problem. This is compounded by th
by shouldbworking 9y ago
I've been a .NET developer for years but I've also been a big Java guy. The lack of an OSS ecosystem in .NET is a huge glaring problem. This is compounded by the echo chamber that is the MS developer world.
There have been multiple projects where lack of a library or database driver have resulted in hacks or passing something to a little Java app and back because it's unrealistic to do the work in C#. Like I said, the MS world seems to be an echo chamber and the vast majority of C# devs shun any solution outside official MS channels. Why do they do this?
Because open source devs generally still dislike MS and until .NET core (which is not ready for prime time) using C# saddled you to Visual Studio, Windows, SQL Server, and IIS. Because of this, the open source community on other languages like Python or Java is maybe 20x bigger.
The other reason open source avoids the MS platform is because they like to take your stuff and replace it with the "MS official" version. Entity framework was originally a poor emulation of NHibernate. WebApi a copy of Spring Boot. Instead of helping your project, or making it official like Java tends to do, MS likes to replace your OSS with something proprietary.
The other big .NET problem is speed. I like C# syntax better, but when I wanna get something done on my own I reach for Java first. It's faster and more flexible. In some areas the execution speed difference is 100x. The CLR might be quick but MS never considered performance a priority until .NET core, because before core they were only competing with themselves.
The echo chamberyness is leaving the MS stack in the dust. Everyone else runs on Linux now. Everyone else is using containers and SPA frameworks and Postgres. In the MS world, the unofficial rule is that if it's not a visual studio project template don't use it. It encourages reaching out of the Microsoft ecosystem as little as possible.
Big sites like stackoverflow that have chosen to go with C# have blogged about their adventures. Most of these adventures involve building things that are already available from the community in most languages. Core may save .NET but it might be too little too late. Windows has already lost the war for server operating system and that leaves little reason to use C# over the primary competitors Java and Go. Both of those have ecosystems far larger and far better support for things like databases, mapreduce, Linux, containers, etc...
- polskibus 9y agoI'm curious, in what areas is Java 100x faster than C#?
- _pmf_ 9y agoAggressive inlining and devirtualization is one thing. Escape analysis that allows objects that one would expect by all rational and technological reason to be required to be allocated on the heap being allowed to be allocated on the stack.
- zigzigzag 9y agoIt's not just a handful of optimisations. The entire JVM is performance focused in a way the CLR just isn't. Microsoft historically put their resources into the C# language and the IDE. Sun/Oracle put their efforts into the runtime. For instance, the CLR doesn't do any profile guided or speculative optimisations at all. That's a 20% win for most Java apps and even more still for languages with higher levels of abstraction like Scala. So right there from the start .NET is 20% behind. The CLR doesn't have an interpreter, so, it spends a lot of time JIT compiling code that isn't particularly important. That takes CPU time away from your app, not sure how much of an effect that is but I can imagine it's at least another 10% down. C# asks devs to control de-virtualisation by hand to try and compensate, but the JVM can do a better job automatically. CLR is only now starting to look at tiered compilation and even then only a very basic form compared to Java which has had it since Java 8. But not only is the base infrastructure and approach far more advanced, the JVM's JIT compilers are way ahead of even the new RyuJIT. Not just fancy optimisations like devirt and escape analysis/scalar replacement, but even basic things like profile-guided basic block ordering. JVM can do auto-vectorisation of loops, lock optimisations, it can even replace speculatively profile and replace synchronised blocks with hardware (TSX) transactional memory. The CLR is multiple generations behind where HotSpot is. And the JVM team is extending its lead even further with projects like Graal.
- shouldbworking 9y agoNot a ton of places, but in my case forwarding HTTP requests. Netty is close to 100x faster than regular .NET. Another example is JSON serialization. Jackson/GSON are maybe 30x faster than the built-in JSON handling in C#. Everyone smart uses Newtonsoft now, but it was a huge bottleneck until a few years ago. .NET seems to have a lot of rough edges where MS said "fuck it, nobody will complain if this is slow". If you happen to use one of those features that didn't get enough love you get burned. Java is generally polished throughout, most likely due to the sheer volume of software written for the JVM
- GordonS 9y agoI seem to be in the minority here in being largely happy with the .NET OSS ecosystem. Look at github or nuget - it's rare I can't find a library to fulfil my needs. The only issue I really do have is down to fragmentation - library authors have too many targets to supports support. Libraries may support .NET Standard, but not the .NET framework before 4.6, for example.
- shouldbworking 9y agoYou are definitely in the majority among .NET engineers. Like everything it seems like people get pigeonholed into certain families of tech after being in the field for a while. Microsoft is one of those families, and so is Java. .NET community ain't terrible, but it's nothing compared to Python and Java. I have tried to convince my co-workers of this fruitlessly over the years but basically all of them are .NET for life. There's no point in arguing that another product is better if the person you're arguing with has never seen it. I used to share the same opinion as you until a few years ago when I got bored of making the same old .NET CRUD "line of business" apps at work. I decided to do some cool open source stuff that I always enjoyed reading about. At first I wanted to use .NET but I quickly abandoned it after playing with Linux on AWS and learning about Cassandra, React, rabbitmq, elastic search, and Postgres. I had never even touched all of these great things. At an MS shop it's "SQL Server, SQL Server, SQL Server" for anything with even the slightest resemblance to data storage. Web development is "Angular" or "MVC" with little variation. I started writing some cool open source stuff and realized I would be alienating myself from most of my users if I made it in C#. So, I picked up Java and never went back, at least at home. I'm the only developer at our company out of ~35 that prefers Java over C# and the only one that contributes to free software. I don't think that correlation is a coincidence.
- GordonS 9y agoIt's true that I don't use Python or Java (although I have used it in the past - wasn't a big fan, and now C# seems so mch more powerful) and do use Typescript and (unfortunately!) Javascript. Python is something I do want to get into though, just to find out for myself. There are some great .NET libraries for working with RabbitMQ, such as EasyNetQ, Chinchilla and more recently I'm loving RawRabbit. There are also good libraries for working with ElasticSearch, and I use Marten a lot for using Postgres as a document store (great library). The place I work is indeed an MS shop, but we're all open minded and use other stuff occasionally at work, and quite often outside of work. Maybe we're in the minority there too though; I know plenty .NET devs who do have tunnel vision, but I suppose you get that across al languages.