I don't know why, but I find it amusing to see Miguel de Icaza say: " Hopefully I will beat my previous record of two users." It makes me feel a lot better about my catalogue of completely unknown software ;-)
I still don't understand what C#/.NET brings to the table that the Linux ecosystem is lacking. All these years it seemed to me that MdI was understanding something that I don't know about. I really appreciate all the efforts that MdI has put into Mono and I appreciate the fact that we have .NET core for Linux but I completely fail to understand what the practical benefits are. C# seems to be a more flexible version of Java that is suffering from feature creep. I have not seen any notable .NET libraries that I want to take advantage of.
Maybe I am too deep in my Linux filter bubble. Can someone give me some examples of where .NET on Linux really shines?
You may be looking at it from the wrong perspective. .NET is the platform of choice for nearly all Windows applications. A large number of developers/companies are heavily invested in the platform. Many of us like and use Linux, but wish we could leverage our experience with .NET from our day jobs on Linux. This isn't about bringing .NET to Linux for me, it's about bringing Linux to .NET. Now I can deploy with containers. Now I can better contribute to the Linux ecosystem. Now I can push for Linux deployments at work. I'm very happy with this development, but I doubt it will affect many existing Linux developers who aren't already using .NET.
That said, having heavily used Java (6 or 7?), C# was a breath of fresh air (without going back to the headaches of C++). Java didn't even have proper anonymous functions at the time, so getting basic type inference, expression trees, a powerful reflection capability, and avoiding type erasure was a great improvement.
Thanks! That's the type of answer I was hoping to get! So it is a lot less about the language itself but rather about the infrastructure and developer pool.
Yes, I have used Java 6 and 7 and yes, I found them limiting compared to other languages. I only used Java when I had to. I mean, even right now I would only pick it if the problem that I want to solve fits the "everything has to be part of a class" mindset.
I still don't understand why, in every thread about C#, someone has to start a thread about "why does anyone even use C#". Do you have the same attitude towards every programming language, or only some? Which programming languages are "blessed" by you?
A programming language is a tool. And every tool has different strengths and weaknesses. I have worked with C# before and I have learned that it integrates well with WPF and other Windows infrastructure. But I have not seen any good applications on Linux yet (note: WPF does unfortunately not run under Linux and it likely never will[1]).
Do I consider C# to be a bad language? No, it is decent. But I do not see it shine outside of the Windows ecosystem. This might be a chicken-egg problem.
My main point is: MdI has supported .NET on Linux for so long. But I cannot grasp why. I admire his efforts and it would be beneficial to understand his motives so that I would know how I can use .NET on Linux for my own advantage. My post is really not meant to negatively criticise C#/.NET. Learning a language is often a multi-step process. The syntax is usually the first thing you learn. But the deeper you dive into the language the more you understand the design decisions. For example, it took me several attempts to understand Clojure and Lisps in general. And I assume that there are some important things about C# that I haven't understood yet.
> But I do not see it shine outside of the Windows ecosystem.
A very large chunk of the games market on Mac and Linux either runs C# as the scripting host that's the primary developer interface (Unity, etc.) or runs directly on Mono or .NET Core (games made with XNA are almost drop-in-portable to FNA, there's also MonoGame, and Ultraviolet is new but pretty compelling--I'm currently fooling around with it for a project).
Today C# is a thoroughly okay language. It was a huge step forward compared to Java when it was younger and more nimble but now they have real trouble pushing new features (for reasons that are not technical). But it isn't about the language--it's that it's what people know.
And, if I'm being fair, JetBrains Rider is a really pleasant way to write C# these days.
Graphical applications aside, I think C# on Linux for web backend code using .NET Core is one of the best and most ergonomic platforms to use at the moment. Tooling (Roslyn, vscode, NuGet, ...) is second to none in my opinion.
YMMV, of course, but to me this is a surprising take. I quite like C#, but EF Core is awful (it is literally not possible to create in your schema a non-nullable boolean/integer with a default value of 'true'/not-zero without making the member property of your object nullable) and ASP.NET Core is not fully baked.
Compared to something like Nest.js and TypeScript, or even Kotlin and Spring Boot, I wouldn't call it good, let alone "best".
Gotcha. I find Dapper (the only other option I've ever seen used in anger?) really frustrating, too, though--boilerplate and SQL statements for simple stuff really grinds me these days.
C# has some at least some slight advantages to Java for the Linux ecosystem when building complex applications where you want a garbage collected and at-least semi-portable application.
1) C#'s interface to C/C++ (P/Invoke or Platform Invoke) is generally easier than the Java equivalent (JNI or Java Native Interfaces).
2) C#'s interface to COM and COM-like systems (Bonobo and Gnome/Gtk's GObject world, for instance) is a little bit stronger and again somewhat easier than the Java equivalent.
Admittedly, some of that "easier" is subjective, depending on one's background and training, but C# coming from working with complex platform combinations of Win32 and COM has had to have some focus on making platform and object system interop work well, whereas Java always felt like (to me, at least) platform interop was more often a "bug" to eventually work around with a "pure" Java library given the chance.
Semi-related aside: It's still something of a shame that anti-.NET sentiment several years back damaged so much of the reputations of so many of the best C# Linux applications. There was briefly a time where there were several very strong Gnome-environment C# applications in-box in Ubuntu, and I still think it was a mistake they were dropped. A lot of the arguments from that period somewhat soured me on running Ubuntu as a daily driver and some of my opinion of the larger Linux open source community. It was exciting seeing apps that I could so easily contribute to (as someone's whose day job efforts typically were C# at the time) in the box, it was angering seeing them denigrated not on their own merits but by indirect association with Microsoft (despite Mono's distance at the time, open patent promises, etc).
There has also been a big push on performance and minimising heap allocations in .NET recently, and it's really been paying dividends.
.NET also makes it relatively simple to work with memory on the stack (especially via `stackalloc`), as well as unmanaged memory on the heap. Of course, many developers never have optimisation problems that require these tools, but they are fantastic when you do need them.
Yeah, I've been very impressed with .NET Core's efforts in performance lately. Span<T>, the stack allocation support, and greater "semi-managed" heap memory support, are a major performance breakthrough taken together. It gives the garbage-collected "safe" C# code most of the performance characteristics of pointer-heavy "unsafe" code.
It's maybe still too early to make predictions of long-term impact, but it really does seem like it puts C# into a good position to take on even more "performance critical" work day-to-day, possibly keeping C# competitive with (and even mentionable in the same sentence as) languages such as Rust and Go. (Especially when combined with AOT/.NET Native compilation.)
True. Caml-like languages are nice (hello Rust!). One of the benefits of the CLR is that it can support virtually any programming language that can compile to bytecode. But I do not see that being a major thing. Yes, there are various Iron$language implementations and Clojure is also available on the CLR. But from my perspective most projects are C# and then there are just very few F# projects.
I was going to say this. while i may not care much for C# because of its java-likeness, F# is a solid functional language that is definitely worth learning.
> I still don't understand what C#/.NET brings to the table that the Linux ecosystem is lacking.
Did Python or Ruby bring something that the Linux ecosystem was lacking at the time? Do you see how this is a fairly irrelevant question?
But to answer it anyway, the .NET VM has quite a few advantages over the JVM, and the libraries and semantics of C# provide a superior experience to Java on the JVM. Of course, no language or VM is perfect.
The fact that is was, and is, an incredibly clean and consistent scripting language with many of the best features of Smalltalk and Lisp that competing scripting languages like Perl and Python ignored. I started with Ruby circa 2001 thanks to the Pragmatic Programmer himself, Dave Thomas' "Pickaxe" book, and have yet to write even a single Web app (not my thing; I'm a computational biologist).
> Point me to a popular open source project that is written in Ruby that is not web based ?
How is that relevant? The question was what justified Ruby at the time.
If "Ruby on Rails" was the only justification, why did people use it for the 10 years prior to that? Were they not justified in using it? That's just nonsense.
There are a lot of people that are tied to C#/.Net that would never consider Linux as a target if not for the cross platform nature of core. It's the same reason Electron apps are on Linux. They'd be Windows/Mac only if not for the ease of being cross platform.
It's also a benefit to existing Microsoft customers because it let's them utilize their existing personnel to expand their audience without costly training or hiring on people who develop exclusively for the target platform. That's the benefit that Xamarin puts forth regarding mobile development.
With the rise of Azure, Microsoft cares less about Windows being the dominant server ecosystem than being the choice for server hosting and having a competitive ecosystem of tooling.
There was a project to add structs (record types without heap allocation) to OpenJDK, but it seems to be dead. [0]
There's also this less dead looking project, with goals that seem pretty similar. [1] Perhaps some day Java will finally gain this feature that obviously should have been there in the beginning. There's a reason .Net has them.
True. Java makes it trivial to write cross-plattform code. But we are no longer in the 90s. There are plenty of cross-plattform C++ libraries available that make it easy to write cross-plattform programs. I do not think that this is such a major argument any longer.
You might not think it's a valid argument but the thing that you're missing is that others do not want to write cross platform C++. They want to write nicer Java and that's C#.
It seems like .NET resolves some of the limitations of the JVM (around generics, lowering of float point code, I’m sure there are others). So if you want a managed language VM but some of the magic of C++, .NET might be a nice place to be.
I read (while considering both for numerical routines) that the CLR could more effectively generate efficient instructions for arithemtically dense code and value types, including for generics, where the JVM uses simpler approach involving type erasure and treats built in types distinctly from user objects. JVM originated for Java which came earlier, so it’s not a fair comparison. And I’m not an expert here.. I stuck to C, CUDA and Oython in the end.
In my opinion it presents an alternative to Java. The licensing also seems easier to explain; Oracle has really worked hard to make Java licensing confusing.
Respectfully, I think calling the most used language, or at the very least one of the top 3 languages on the entire planet a language that "has its niche" doesn't really do it justice. Niche is usually a dimunitive term.
If you want to pay for a supported Java, with long term ongoing patches: call a commercial vendor of Java such as Oracle, Azul Systems, etc.
If you want a free and open source Java runtime, use Open JDK. Some sources of OpenJDK pledge to backport bug fixes from newer versions for some number of years. Or you can simply make sure your product continues to run on newer versions -- which for Java, according to history, has been easy to do.
Java with value types and way more control over memory layout, and unsigned integers, and simd intrinsics?
Performance is a little better these days even without the simd intrinsics too.
dotnet core is a pleasure to work with, too. I really appreciate the effort that went into making the CLI nice to use. Things like project init, package management, building, testing, etc.
Aside from the numerous reasons already given in this thread, I think the rise of the cloud has an impact - it's never been easier to spin up Linux servers (even for Microsoft shops!), and Windows people having their familiar toolset available has surely led to greater uptake of Linux.
Miguel has always wanted Linux to be open-source Windows. If there's a problem in software engineering or integration, you can rely on him to support and champion whatever approach Microsoft took to solve it. It's telling that his white paper in which he proposes Bonobo, and even more bloated and crufty version of COM for GNOME 1.x, was "Let's Make Unix Not Suck".
Nice. It makes me reminisce about my first accounting package written in Turbo Pascal (which I might add, survived y2k without a line of code being changed).
I think I'll take a look at it, my guess is the layouts might be tricky to translate but with some sensible hard coding perhaps not too bad. Sadly the state of C#'s Qt and GTK libraries weren't great last I looked.
I have a project idea and I've been trying to find the best way to implement ncurses user interface/experience for mobile screens. If anybody is interested or can offer help/advice them please get in touch.
https://gitlab.com/swipe2e