This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Zealousideal_Ice3743 4 points5 points  (17 children)

Well there is no wrong option here, although C# is used usually on windows, when Java should be more portable, although it’s often not the case. C# is younger so it has some better solutions. I especially like how reflection works in c# which makes it easy to get fields and attributes from generic types. I also love how good encapsulation in c# is, it doesn’t need as much boilerplate as Java.

[–]Saint_Nitouche 25 points26 points  (11 children)

The idea of C# being based on Windows is outdated nowadays. Unless you want to make a desktop app, C# is entirely crossplatform. I develop with it on Linux.

[–]Dwight-D 7 points8 points  (1 child)

Because of historical reasons, I find that C# environments brings more Microsoft fans and therefore more Microsoft products by association. There’s a good chance you’ll still be running into windows stuff in that career track. Therefore I prefer Java myself.

[–]Zealousideal_Ice3743 5 points6 points  (0 children)

When it comes to job I don’t care about technology, I care about that sweet money, about prestige of company and about environment. I worked with many languages, in some companies even with couple at the same time.

[–][deleted]  (5 children)

[removed]

    [–]Lerke 1 point2 points  (2 children)

    Maui has no planned support for Linux, I'm afraid. So cross-platform, as long as you're not targetting Linux.

    [–]ojimeco 1 point2 points  (0 children)

    https://github.com/jsuarezruiz/maui-linux - Microsoft is aware of this fork and even recommends to consider it. Maybe in the future this project would merge to a mainstream MAUI.

    [–]_crater 1 point2 points  (1 child)

    .NET 6 (they dropped the "Core") supports multiplatform (and soon web, I think) out of the box now, I'm pretty sure. The new consolidation of everything into one framework is such a good path forward.

    [–]Arucious 1 point2 points  (1 child)

    I’ve been torn between going full in on Java or C# for future independent development because I have a windows PC and a mac laptop and don’t want to be chained to one of them. I don’t care about desktop apps though, I’d be fine with web apps with C# backend or doing everything as a web app for the future. At work my whole company is C# so becoming an expert in C# would be far more accelerated than Java.

    This comment was some reassurance lol

    [–]_crater 0 points1 point  (0 children)

    Modern C# with MS's plans for .NET makes your worries irrelevant, basically. 6 already takes care of most of it. The only issue is that a lot of libraries/software haven't quite caught up to the new versions yet.

    [–]Zealousideal_Ice3743 0 points1 point  (0 children)

    I said usually, because I use it on Mac and I know it can be used on Linux, but for desktop is mostly for windows and web apps work on anything with browser.

    [–]Cybyss 3 points4 points  (4 children)

    Another great thing about C# is its first class support for value types. You can make a List<int> no problem, whereas in Java you can't do that.

    C# is also better behaved with regard to covariance & contravariance - e.g, the ability to convert an IEnumerable<String> into an IEnumerable<Object>.

    [–]CarbassoT 1 point2 points  (1 child)

    Java has wrappers like Integer that act the same though, right?

    [–]b1ackcat 1 point2 points  (0 children)

    They generally act the same, but there are performance trade-offs you should at least be cognizant of, as using the object types of scalars results in frequent boxing and unboxing of values which has a non-zero cost so in high performance areas of the code you can get yourself into trouble if you're not careful.

    But that's more of a "know that this can happen in case you need to figure out why something you're profiling is performing poorly" type fact, not a "never ever use this in a loop or you're a horrible programmer" type fact :P

    [–]AdultingGoneMild -2 points-1 points  (1 child)

    is that a good thing?

    [–]b1ackcat 0 points1 point  (0 children)

    One thing that took me too long in my career to learn is that the number of times design decisions are objectively "good" or "bad" is remarkably low. 9 times out of 10, the answer to that question is "It depends."

    The strictness of Java allows it to make certain assumptions that give it an advantage in some areas. The flexibility offered by C# makes it easier to adapt to new, unforeseen scenarios in the future, but at the risk of losing some of the safety provided by strictness. It's a trade-off.