3 ms·
OSS C# was a day late and a dollar short. Fundamentally, why would you ever pick it over Java? Theoretically it has a nicer IDE and some usability improvements,
by lmm 3y ago
OSS C# was a day late and a dollar short. Fundamentally, why would you ever pick it over Java? Theoretically it has a nicer IDE and some usability improvements, and better reflection. But that nice tooling was only ever available on Windows, recent revisions of Java have closed the usability gap, and people are finally realising what a bad idea reflection was (other than the Spring Boot nutters). Meanwhile library availability and general platform/tooling support for Java is orders of magnitude ahead.
It's kind of a shame, because in isolation C# is a pretty well-designed language. But people don't switch to better-designed languages, they switch to languages that have a killer feature that their previous language was missing. C# never managed that.
- zamalek 3y ago> OSS C# was a day late and a dollar short. Fundamentally, why would you ever pick it over Java? While I do have major criticisms of C#, this is an often repeated criticism that doesn't hold much water. C# is Open Source (with capitals) regardless of how or when it happened, Oracle is notoriously litigious.
- 65a 3y agoThe main problem I have seen is that much like Swift or Cocoa, there are a bunch of Totally Not Open Source frameworks/libraries/etc that most applications for the original target platform use, and you must then dig into stack traces or hack code to avoid weird crashes because the code wants the Windows way of determining the local timezone, etc. I'm sure it could be great, I was a dot net developer many years ago, and it was fine, but it's a lot of work to make it work on Linux compared to the average jar. It's probably bad code vs bad language, but I've found other stuff easier to use or run, and avoid it as much as possible. Not comparing C, C++, Rust or Go because those don't even need a runtime installed, and I'm much more familiar with coding in those languages.
- neonsunset 3y agoNeither needs C#. You can require runtime at a host, you can package it with your binary (which Go does, and C++ effectively too if you link statically). But then again, Java can’t even do that. Its build and packaging systems are a tedious joke. If you want to package a C# binary, you simply invoke either of the two (one is JIT, one is AOT): dotnet publish -o {dest} -p:PublishSingleFile=true -p:PublishTrimmed=true dotnet publish -o {dest} -p:PublishAot=true Done. No runtime required. Also, most applications use ASP.NET Core and EF Core in back-end (which are platform-agnostic) and a selection of libraries for desktop and user facing applications on front-end: Avalonia, Uno, now MAUI, Xamarin (all of these are cross-platform) and historically WPF, Windows Forms, UWP and WinUI as their successor.
- lmm 3y ago> Done. No runtime required. But the part that matters is that you can ship a single file to people who are on any platform and be confident it will work. Yes the file is .jar and using a runtime, but those details are mostly irrelevant - everyone has Java installed somewhere. Whereas with C#, sure you've got your nice binary, but if I try to run it on FreeBSD or Sparc is it going to work? From bitter experience, probably not - as GP said, probably for reasons that are more bad code and culture than a bad language, but the fact that several of those major (even if they're now considered "historic") GUI libraries are Windows-only and almost-but-not-quite work outside Windows sets the tone for the whole community culture.
- neonsunset 3y ago> Sparc > Presence of platform-specific GUI libraries makes different cross-platform libraries worse > Supporting both self-contained and runtime-dependent lean binaries is bad Hopefully this reply is a bait, otherwise I give the exercise in mental gymnastics a solid 7/10.
- lmm 3y agoIn Java-land, someone puts a jar on their website, and it will work on whatever OS, on whatever architecture, even if it's a GUI program. In C#-land, that doesn't seem to be how it works. If it's a GUI program it'll probably depend on WinForms and fundamentally not work on official .net core for non-windows. It might work on Mono if you're lucky, but often it won't. And whether or not the program "could" work on your OS/architecture, most of the time what they'll put up on the website is a single-platform binary. Whatever the theoretical advantages, as someone just trying to actually use the thing on my computer, that's worse.
- lmm 3y agoOracle is indeed probably even less trustworthy than MS. But Java had a good enough release first, and a fully open source release first, and a decent crossplatform develompent story first.
- oijfio23 3y agoJava doesn't even have "await" feature, while C# has it since more than 10 years.
- nsonha 3y agoCongratulation for spreading a disease in PL design. Await is controversial at best and should not be considered a pro.
- neonsunset 3y agoThen why Swift, Rust, TS/JS and Python went with it as well?
- nsonha 3y agoYes I literally called it a disease. Just look up “what color is your function”, I’m hardly the only person who thinks so. There are more languages without async await that ones that have. The language that’s known most for massive concurrency, go, does not have it. None of the functional programming languages needs it either.
- neonsunset 3y agoOh no. Not the function coloring debate again (congratulations, with 1/100 of the talent, the author of that article is now inflicting similar damage as misquoting Donald Knuth on performance). But if we have to do this, all functions in Go are colored but you simply can't do anything about it. Not allowing a method call to represent a delayed operation that produces a result (Promise/Future/Task) is the major mistake, and a reason why Go is surprisingly limited at concurrency even if it not seems that way if you come from a language which had even worse UX.
- nsonha 3y agoWhy do you need to know what/what not is a delayed operation? Seem like the worse languages are ones you have to do that, instead of just caring about the computation. Polluting your function signatures with some abstraction that has nothing to do with the domain is pretty lame too.