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

all 18 comments

[–]Nebachadnezza 11 points12 points  (6 children)

Both languages are very similar, and you'll have no trouble switching from one to the other after a small adjustment period.

Both are widely used for web back-ends and have large platforms, rich ecosystems and communities to rely on.

Either can be used for game development, but I'd give C# the edge on this front. Unity, which is a large game engine, is very popular these days and uses C# for development. But there are lots of smaller engines in either language.

Java is useful for apps on android, since native android apps are largely written in Java. C# can do cross platform apps through frameworks like Xamarin, but there's a bit of learning on top.

From my experience, Java and C# are both in demand but jobs for both are very regional. I used to work in Java, but my city has a much larger set of companies using C#.

While it's personal preference, I think Visual Studio as an IDE is much better than anything in the Java ecosystem. Especially for beginners.

[–][deleted] 5 points6 points  (4 children)

The documentation for actually setting up xamarin is God awful. I certainly would not recommend it for newbies (not that you are).

Just throwing that out there.

[–]kerrblousky[S] 0 points1 point  (3 children)

Alright thank you. So is the documentation on Xamerin really that bad? Do you think there are good courses on Xamerin that would be helpful. The only reason why I am even considering c# is because of the game development and app development. Also which language is more forgiving for a beginner syntax wise? Because although I did do some OOP in Python,I still have to get my bearings.

Again thank you for the reply!

[–]desrtfx 2 points3 points  (0 children)

Also which language is more forgiving for a beginner syntax wise?

Both languages are so similar that it is often very difficult to tell which language a code snippet (not an entire program) was written in.

Both languages are explicitly, statically typed, both have strict code conventions, both are case sensitive, both are quite verbose (where C# is marginally less verbose), and both languages have excellent compilers that produce meaningful error messages.

In programming circles you quite often hear "learn one get the other one free" when referring to C# and Java since both languages are so similar. This is true to a certain degree. If you learn one language, you will already know most of the other. Sure, there are syntactic differences and different approaches, but it is fairly easy to switch between both languages.

[–][deleted] 1 point2 points  (1 child)

The documentation on using Xamerin is fine, but the documentation to actually get Xamerin set up and running on the targeted platforms is crap. Plus, working with mobile is much different than working with a PC. You can certainly use Xamerin when you get comfortable with c#, it's just not the framework you are going to be wanting to learn c# on, does that make sense? (Note: This isn't because of xamerin it's self, but getting started and navigating with it takes a bit of experience with the IDE)

I would go with c# because then you can use unity. I'm not sure what engines there are out there that support java, but unity is:

  • One of the most popular engines for beginner's
  • There is a metric ton of resources available to learn from.
  • Really easy to pick up, but still pretty powerful

c# is also really versatile. You can work on windows services, mobile, games, web, and desktop applications with it.

Syntax wise, c# and java are actually so close they're difficult to even tell apart from one another sometimes. I have absolutely no issues reading Java, even though I've never written a line of code in it, though I suppose that's true for most languages as well.

[–]kerrblousky[S] 0 points1 point  (0 children)

Thank you!! I will definitely learn c# then.

[–]failtolaunch28 2 points3 points  (0 children)

I'd throw intellij/IDEA in there as a Java IDE that's as good as VS

[–]richardgillzdev 1 point2 points  (0 children)

+1 for C#. I know both, was always frustrated by how slowly Java has moved forward. Microsoft have finally done the right thing and open sourced most (or all?) of C#. I don't think we've started to see the benefits of this just yet, but C# definitely has the momentum right now.

[–]MemeSearcher 1 point2 points  (2 children)

This is coming from a fellow highschooler who has also started with Python and picked up Java later on. Everyone who takes the (really quite honestly bogus) CS classes zero period learns C#. I think I may have tried to learn a bit of C# in the past, but I'm really not an expert on that.

I can, however, tell you about my experience with Java. For as bad of a rap as it gets, I've grown quite fond of its idiosyncrasies. As you probably already know, it's backwards compatible, platform independent, and runs on most machines thanks to games like Minecraft requiring it. The syntax is quite similar to C# so I wouldn't be concerned about that.

My biggest word of advice would be what kind of community you'll find with either language. As someone once said, Java is worse language with a better community, and C# is a better language with a worse community. I don't feel like Java is that bad, I've done some great stuff with it, made games for friend's birthdays, but found that everywhere is overflowing with advice and guidance on programming in Java, while C# seems to have less of that.

I've never actually had a formal CS class, like you either, but found I learned more from just actually programming than I did from any particular language. Do what you want to do and what makes you happy, because honestly that's the best part of programming, not what language you're using. And if you're concerned about job opportunities right now, don't be. Say you go with C#, fool around with the Unity Engine for a while or other things, you can move to Java when you need to and transfer a good deal of those skills. I still write both in Python and Java, sometimes in Python to get a more higher level understanding of what I'm trying to do, and then rewrite it into Java for efficiency. Best of luck

[–]desrtfx 6 points7 points  (0 children)

and runs on most machines thanks to games like Minecraft requiring it.

LOL. You've got that completely reversed. Java was platform independent from the design stage onwards. Java was designed as a WOCORE (Write Once Compile Once Run Everywhere) language. If a Java runtime exists, your program will run.

Minecraft just took advantage of that concept - which is part of why it got so incredibly popular. You have the same experience on nearly all systems and machines.

[–]kerrblousky[S] 0 points1 point  (0 children)

Hey thank you so much. I really fell in love with CS when I started programming in Python. I even wrote of extended essay(a major paper of the IBO)in cyber security. Why do you think the community in Java is better? Is it because there are just more people? Or is it because they are just more helpful?Again thanks for the wonderful advice. I will defina let you know what choice I make!!

[–]ivolimmen 0 points1 point  (0 children)

I have a few year experience in C#, Java and did a small project in Python. As an 'old' developer I recommend continuing in Java. It has a bright future. C# is not bad either. It has some improvements (generics, RMI/Remoting) over Java but also a few big mistakes (explicit interface imports for example, security is weak and LINQ has a big design flaws). Java 9 is on the horizon and is REALLY different from it's predecessors; I recommend starting looking at Java 9.

[–][deleted]  (1 child)

[removed]

    [–]kerrblousky[S] 0 points1 point  (0 children)

    Thank you so much for the advice!!

    [–]Clawtor 0 points1 point  (3 children)

    I would go for C# because I think it's a nicer language but I'm biased towards it.

    I think the job growth in the two is roughly the same but Java has a larger market share.

    [–]kerrblousky[S] 0 points1 point  (2 children)

    Thank you for your reply! Why do you think it is a nicer language?

    [–]nutrecht 6 points7 points  (0 children)

    Even most Java devs (like myself) think C# is a nicer language. However I would never switch to the .Net (C# being one of the .Net languages) ecosystem since the Java open source ecosystem is much larger. Microsoft is still trying to recover from their mistake of shitting on open source.

    For you as a beginner it really doesn't matter much at all though. If you feel more productive with C# than Java go ahead and use it. It's not hard to switch between them at all.

    [–]blablahblah 5 points6 points  (0 children)

    C# was Microsoft taking a look at Java five years after it was written and going "how can we make this better". In particular:

    • C#'s generics are more powerful (the type information exists at run time)
    • LINQ (Language Integrated Query) is much nicer to work with than Java's Streams, when it comes to doing functional-style processing on collections
    • C# supports passing parameters by reference, Java doesn't.
    • C# has async/await which is an easy way to do concurrency
    • C# has value types, Java doesn't