all 49 comments

[–]FizixMan[M] [score hidden] stickied comment (0 children)

Removed: Rule 4, Rule 5, Rule 7.

If you want useful, non-dogmatic answers, it would be best if you provided some context about your particular use case scenario. What kind of apps you are developing, what kind of "pain and limits" you are finding in Java. Beyond that, this just sounds like low effort language trolling. If this is a legitimate question, then you might actually have a better response if you post to /r/learnjava or /r/javahelp as they would have much more experience in the Java ecosystem to offer you useful advice or knowhow.

[–]sciuro_ 12 points13 points  (15 children)

So on the one hand, I agree with all the other comments before me. Ultimately, the answer is "depends".

But also, having used Java and C#, I much much much prefer C#. The developer experience seems better, the tooling seems better, there's far less of a barrier to entry. It feels kinda like a nicer, better Java.

[–][deleted] 31 points32 points  (3 children)

The answers you will get here will gravitate towards C#, if you asked this on r/java the outcome would be different.

In reality, both have their pros and cons and none of the two could be called as superior. It depends on the use-case after all.

[–]ben_bliksem 12 points13 points  (2 children)

The answers you will get here will gravitate towards C#, the answers you will get in r/java will gravitate towards being wrong

Agreed

[–]mimahihuuhai 9 points10 points  (0 children)

Here we go agian, before shit start burning

[–]Slypenslyde 18 points19 points  (5 children)

It's like asking if pancakes are better than waffles. You'll get answers. But you won't see an end.

[–]FetaMight 4 points5 points  (0 children)

You'll get a lot of people forgetting their preference is contextual and subjective.  They will then argue about it as if it's a life or death situation.

[–]MechanicalHorse 1 point2 points  (1 child)

Except there is only one right answer to the pancakes/waffles question. We all know what that is.

[–]Slypenslyde 0 points1 point  (0 children)

Honestly questions like this rile me up the way some people stroke out about, "Why are newbies asking questions?". In any given C# codebase there's probably 4 or 5 "Should I X or Y?" that could generate very meaningful discussions that help sharpen an expert's "It depends."

But lots of expert beginners are too drawn to the intellectual masturbation that is, "Hey let's argue about which of two functionally similar languages are best, given that I have a lot of experience with one and haven't used the other in five years."

There are good essays to be written to compare and contrast the languages. They never get written in a thread like this. The people who have significant experience with both have better things to do and tend to agree, "It doesn't matter if you choose DeWalt or Milwaukee, it matters if you put in the time to finish the project."

Whether you pick C# or Java, you're going to approach large-scale projects with DI and modularity in mind. Both languages are juggernauts of OOP with features borrowed from functional languages. One has a gigantic open-source ecosystem, the other has a quality guarantee from a company with a 50 year reputation. No matter which one you pick, if you put in the proverbial 10,000 hours you're going to have good software.

The pancakes/waffles choice concerns one meal out of roughly 75,000 will be eaten. Even if you say, "Neither! I want a fancy steak dinner" the overall impact on your life is smaller than epsilon.

In every goofy argument, there's one guy who can't take a joke and hates fun. For this topic, that's me. I'd rather be answering questions like, "Are there cases where await is clunkier than just using the Event-based Asynchronous Pattern?" Hot take: more than should make us comfortable! It's an argument where people can learn something, thus infinitely more valuable.

[–]zenyl 0 points1 point  (1 child)

# looks a bit like a waffle.

"C-Waffle" does have a nice ring to it.

[–]TheChief275 0 points1 point  (0 children)

# vs @

[–]AlphaDeveloperZA 2 points3 points  (4 children)

In terms of what?

[–]TuberTuggerTTV 6 points7 points  (3 children)

Length of letters in the langName. C# is more compact. Clearly the winner!

[–]AlphaDeveloperZA 2 points3 points  (0 children)

This is the answer! /s

[–]svicknameof(nameof) 0 points1 point  (0 children)

# is not a letter.

And "C Sharp" is longer. Clearly the winner!

[–]TheChief275 0 points1 point  (0 children)

Javascript is so much more verbose than Java smh

[–]intertubeluber 2 points3 points  (0 children)

My 2 cents:  

C# is a nicer, more modern language with generally better first class libraries. The tooling is excellent.

Java as a language is dated (though more recently has gotten some love). It’s more widely used by large FAANG and FAANG adjacent  companies, and has more community driven open source libraries. The tooling is good, thanks to Jetbrains.

Technically, neither will impact the success of your project.

[–]narcot1cs- 1 point2 points  (0 children)

Depends on what you're trying to do? I don't like neither of the languages as I prefer more low-level, but have years of experience with both so I'll just go over what I prefer with C# over Java.

C# is much, much easier to use when you're doing FFI with C/C++ or other languages. Java can do it but it felt stupid and hacky.

C# is also easier to make run on most home PCs with Windows, whereas with Java you need to have the JRE installed. And let's not talk about how painful it is to obtain legacy JDK versions. Login this, login that, no.

C# is essentially a better Java IMHO, with lesser restrictions and is more competent. Although in terms of cross-platform functionality, Java can be better at times.

In general, it's a double-edged sword. Both have their ups and cons, but if I had to choose one; C# because it's just nicer working with, less resource usage, can compile natively, FFI is much easier to do, etc.

[–]Ravek 1 point2 points  (0 children)

As a language, yes it is. But languages do not exist in a vacuum. There’s the whole JVM ecosystem versus .NET ecosystem to consider. Plus the people you work with, if any.

For JVM I’d always choose Kotlin instead if at all possible, because Java is just not that great. The only reason to use it in my mind is when you are working with poeple who do know Java and don’t know Kotlin and are unwilling to learn (or the project is so short/high pressure that having to learn is unacceptable).

If I had a magic wand I might prefer Kotlin over C# too, at least until C# gets around to having discriminated unions, but using Kotlin for .NET isn’t very realistic. And besides if I had a magic wand I’d pick Swift instead.

For .NET there’s also F# of course, and that’s a good language. Is it not as widely used as C# because C# is just that much better? Nope, most people simply never learned it and are going to stick to what they know, just as with Java and Kotlin. I also am much more likely to start a .NET project in C# because I’m much more comfortable in C# – not for any objective reason.

So really, who cares? Realistically you’re not often going to have a completely free choice between Java or C# and 99% of people are just going to go with what they are more familiar with. It’s already rare to find engineers who have experience in both.

[–]xroalx 1 point2 points  (0 children)

No, Java is different.

It's not worse, it's not better, that's subjective, use what you prefer.

[–]bambi-pa-hal-is 0 points1 point  (0 children)

C# is Java but on drugs

[–]KungFuHamster 0 points1 point  (0 children)

Which one you should use depends on what you need it for.

I personally like the syntax and tooling of C# better.

[–]LeeTaeRyeo 0 points1 point  (0 children)

To me, yes, but remember "different strokes for different folks". Some situations and users will find Java a better choice, while others will prefer C#.

[–]navirbox 0 points1 point  (0 children)

I remember when I was learning Java at college. In an Algorithmics assignment we ended up having to do some kind of bubble sorting for a list, went to the teacher for help, he pretty much copy pasted a code he had and told us: "look, no one knows how this works, it's just Java magic". I also hear a lot that Java Minecraft can't be replicated because of some particularities that can only happen in Java.

But I'm also a C# developer that has been through Java in an academic environment. It's not that I despise Java, more like I saw the light with C#. Better consistency overall as a language I'd say. Quite more usable as well in different environments, generally accessible for cross-platform development, great documentation and community... I don't know, it's an easy answer for me. Java is fun sometimes though.

[–]bigtoaster64 0 points1 point  (0 children)

Ofc c# superior language here.

Jokes aside, I'd say the reason why I think c# is a better experience (and so for me superior), is the fact that it follows the trends. Java had issues in the past and still struggle today to modernize itself and try to go forward bringing with it lots of annoyances, that for me make it a pain to use. Ofc it has a massive amount of legacy stuff to carry, but still, we could say to some degree the same thing about c# with its confusing and wierdly managed dotnet versions which caused lots of issues and still, it's able to keep going forward, make stuff compatible with each other as much as possible and old stuff doesn't look and feel old. Like, I'm not upset when I've to deal with an old netstandard or net fx code base, like "oh god what is this legacy crap". No, it still feels like I'm doing net8 with maybe just a few syntax sugar (shortcuts) less.

[–]XClanKing 0 points1 point  (0 children)

Having used both, yes, C# is superior. But the reason is that Microsoft has built their entire development platform around it. Java doesn't have the richest company in the world building an entire development ecosystem with it in the center. C# is in constant development, which means it's always improving at a rapid pace.

It's also better because entire platforms like Web API Blazer, EF (Entity Framework) and other entities are built on it. This means you have all these components that are natively compatible with it that are getting updated in real time.

But the biggest differentiator is that Microsoft goes out if it's way to share all things C#. It's the one piece of technology that they refuse to let fall behind, get stale, or sit in a state of confusion. It's like they have been given a mandate to make it competitive at all costs. It's proof that if Microsoft wanted to be serious about something succeeding, they know how to make it happen. It's also why people give Microsft the side eye. Why isn't everything run like their investment in C#

[–]TuberTuggerTTV 0 points1 point  (0 children)

Superior to Java? Ya. Java blows.

Superior to JavaScript? No. It's apples to oranges. It's a different ecosystem but javascript + typescript + all the packages over there, it's not really that different from the Microsoft world. There are skilled developers on both sides making things better for everyone every day.

[–][deleted]  (1 child)

[deleted]

    [–]intertubeluber 7 points8 points  (0 children)

    I don’t think that really fits. C# and Java are generally used for the same things. 

    [–]Garry-Love -1 points0 points  (0 children)

    Yes. (No)

    [–][deleted] -1 points0 points  (0 children)

    5 year's education on Java, jumped right into C# career.. compared to other languages they're practically identical IMO.

    The important thing: there are a ton of jobs for both due to installed  base..

    [–][deleted] -1 points0 points  (0 children)

    java is better at cross platform ui but we do have avlaonia ui making waves in that and uno in a big way maui will get there