C# and Java
-
Isn't it commonly known that MS and Sun were arguing about MS' right to develop their Java compiler and market it as Java? MS ended up turning their back to Sun/Java, declaring: OK, we'll forget Java and make something better, then! According to my taste, MS succeeded; C# is and improvement over Java in several respects. But I have been working for a number of years in environments where any such opinion was highly non-PC.
Yep. MS built .NET first around VB, and wanted to bring Java in as one of the languages to compile to MSIL (J++). Since Java was the proprietary property of Sun, Sun sued MS that MS’s cross-licensing with Sun for Java did not allow newer versions of Java to be used, and refused to take MS’ improvements in Java, which MS was glad to share with Sun. Once the courts ruled in Sun’s favor, combined with Sun’s refusal to cross-license any newer versions of Java (which would have benefitted Sun), MS “end of lifed” J++, and created C# (a play on the ++ of C++). After all, the intent of .NET was and is that any language (as syntactic sugar) can be used because it compiled down to language-agnostic MSIL which then gets compiled at runtime, more efficiently and performant than Java. Of course, Sun’s intense hatred of MS led Sun to spend money on lawyers instead of innovation. At the same time, they intentionally made hardware changes in each new update to their computer hardware to prevent MS from running Windows on it. MS had a version of Windows NT compiled for Sun Sparc. But Sun’s irrational hatred of MS led them to make sure they would break Windows NT with each new hardware release. There was a good market for the Sun Sparc workstations and servers where buyers preferred Windows NT over SunOS and Solaris, but Sun would rather go out of business than have a win-win with Microsoft.
-
It's been some years, but when I got a (corporate) Java project, I had to go shopping: Eclipse (IDE), Spring (UI), Struts, Apache (Web server), NetBeans, JBoss (app server), etc. before I could write any code. c# (Windows; .NET framework) was "no" shopping.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
I had a similar experience. I learned Java first, then C#. For a while I was working with both languages. I had a situation occur with a project in each language that required reading and writing XML. I spent two weeks researching (and experimenting with) the multiple libraries for XML processing in Java before I found one that best fit my needs. In C#, there were only two choices (one for processing the entire DOM and one for streaming) and making the choice was obvious. The issue was that there were hundreds of Java libraries from multiple sources but only the Microsoft official libraries for C#. This was over two decades ago. Things have changed. Research is more efficient. Both languages have matured and are more stable.
-
I know what you mean. Now with Net5 & Net6 it just amazed me how easy it was to execute the app on linux now that most of the frameworks catched up to net5.
sudo apt-get install -y dotnet-runtime-6.0 && \
dotnet MYAPP.dllOnly thing to get used to that you "run" dlls^^
Which one is preferred by *nix folks? Java at least has open versions of JDK. With C# you're a bit stuck in the .Net ecosystem. Not sure if Mono is still a thing anymore. I guess is python to modern take?
-
I was wondering, how close are C# and Java, syntax? Would be Java be "easy" to learn if I know C#?
Archchancellor Ridcully
There are similarities because both C# and Java (and you can throw in C++) are all in the C family
-
Which one is preferred by *nix folks? Java at least has open versions of JDK. With C# you're a bit stuck in the .Net ecosystem. Not sure if Mono is still a thing anymore. I guess is python to modern take?
What do you mean by that? Dotnet5+ was made completely* open source, you can look at it on github [GitHub - dotnet/runtime: .NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.](https://github.com/dotnet/runtime) Well yes but no, there are some other alternative usages for .net with C# iirc there are JVM-C# version, C#-Embedded and some more. But yes you are more or less fixed to .net, but from my point thats fine. Everything I ever imagined I would like to do, I can with C# (in a reasonable frame). Btw, on another point, mono is the runtime for C# when running on linux nowadays, again: if i remember correctly.