Jump to content
  • Advertisement
Sign in to follow this  
Portella

Unity Java vs C# - Experts points of view

This topic is 2256 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I know that this question has come up hundreds of times on forums, but it is really disappointing how one can read through dozens of threads (hundreds of posts) without getting an informed, unbiased view.

I'm a beginner programmer with very basic knowledge of C# and I see that thousands of others have the same doubt as me when trying to choose between those two languages. We receive answers like "language doesn't matter, learn algorithms, design principles, oop structure, etc", or "after learning java you'll jump to C# easily".

It's not that I disagree with the above, but apart from learning the principles, structure, logic, etc, one need to get a repertoire of tools and, in fact, the language chosen may not matter that much, but the framework linked to it can take much time to be mastered. I have read through discussions about whole teams of experienced programmers resisting the change to another framework, indicating that this is a real concern among seasoned programmers. It's not just a question of adapting to syntax.

Most discussions about both languages see the same repeated statements:
- if you take on C#, you marry Windows.
- No, you don't, you'll always have mono. (nothing is said about personal experience with mone though)
- Java is "more" cross-platform.
- C# is a better structured language. (this is the only point I see which seems to be uncontested in MOST debates, but again, it's not only about the languages, but about what its environment).
- C# has better performance. (I don't know if that is true, but the possibility of using development tools like XNA and UNITY seems to have no parallel in Java. At least, from what I was able to find, JMonkey seems to be one of the best graphical engines around for use with Java, and graphics seem rather primitive)
- Others just talk about very specific details, like GC efficiency, etc.

Synthesizing, much of what is said seem like myths, uninformed points of view, fanboy talk or biased propaganda. I've even read a recent article which presumed itself very scientifically focused stating that C# has already had it best moment, but would soon fall into oblivion.
To guide those that are beginning and that, differently from expert programmers, are concerned with what will continue to be available in 3 or 4 years from now, when they finally get productive, what do you consider to be the future of C# and Java? What is real about C# portability? What does Android java code translation, Mono, ISO standardization really mean in terms of tendencies? What about performance and graphics? Is there any engine like Unity for Java use? Will it ever be? What about future development? Some say that Java has been slower than C# in that aspect, others say that new languages based on the JVM make Java environment more worth learning.

I would like to listen to informed point of views. Analysis by those that really know about what they are talking about, not fanboy talks and propaganda. This would be very useful, not only for me, but for thousands of others that are reading through the multiple forum threads which only bring further confusion.

Share this post


Link to post
Share on other sites
Advertisement
Trying to be as un-flame-war like as possible:


Synthesizing, much of what is said seem like myths, uninformed points of view, fanboy talk or biased propaganda.


This is largely true, though your bullet points are largely correct.


what do you consider to be the future of C# and Java?


Java has been effectively abandoned, and is largely crippled by its lack of good generic and functional programming support.
C# is starting to show its age, where it's difficult to improve upon it more.
I suspect that both will remain the top two most used general purpose programming languages in 3-4 years, though their relative popularity will decrease; Java's faster than C#.


What is real about C# portability?


C# can be ported and it has gotten a lot better due to mobile platform motivations, but the cutting edge and best support will for the foreseeable future be on windows. That said, beginners care about portability WAY more than they should.


As for the other questions, they're vague or outside of what I can speak to. C# is fast enough, and generally, so is Java. Java has worse support for games in general, and I expect that trend to continue. Edited by Telastyn

Share this post


Link to post
Share on other sites
Ultimately, Java or C# or C++ do not matter. You really should consider programming languages as musical instruments, and you use them to play your music. Some instruments work better for certain types of music. But just like any other good musicians, a programmer must learn how to play not just one instrument, but several. Depending on what music he wants to play, what mood he wants to convey, he picks up the right instrument and play it like a maestro.

Since you are a beginner, pick one. Java or C# really does not matter. C# has XNA for games. Java, on the other hand, has plenty of 3rd party libraries, but also allows you to make games for Android. Pick your platform (XNA or mobile), then start learning.

Share this post


Link to post
Share on other sites

Ultimately, Java or C# or C++ do not matter. You really should consider programming languages as musical instruments, and you use them to play your music. Some instruments work better for certain types of music. But just like any other good musicians, a programmer must learn how to play not just one instrument, but several. Depending on what music he wants to play, what mood he wants to convey, he picks up the right instrument and play it like a maestro.


It seems like musicians have a speciality though like Yo-Yo Ma.


Since you are a beginner, pick one. Java or C# really does not matter. C# has XNA for games. Java, on the other hand, has plenty of 3rd party libraries, but also allows you to make games for Android. Pick your platform (XNA or mobile), then start learning.
[/quote]

Picking one makes sense, but I think the decision matters and depending on the person could see them deciding to focus on C# or Java. If I were forced to pick between those two I think I'd pick C#. The performance of this compression library on different languages is kind of interesting. Edited by wood_brian

Share this post


Link to post
Share on other sites

[quote name='alnite' timestamp='1342634973' post='4960580']
Ultimately, Java or C# or C++ do not matter. You really should consider programming languages as musical instruments, and you use them to play your music. Some instruments work better for certain types of music. But just like any other good musicians, a programmer must learn how to play not just one instrument, but several. Depending on what music he wants to play, what mood he wants to convey, he picks up the right instrument and play it like a maestro.


It seems like musicians have a speciality though like Yo-Yo Ma.
[/quote]

Of course, just as there are programmers who only code in C++, ASM, Cobol, Java and nothing else. It's a matter of preference. But even Yo-Yo Ma, I'm pretty sure, has played other instruments before settling on the cello.




Since you are a beginner, pick one. Java or C# really does not matter. C# has XNA for games. Java, on the other hand, has plenty of 3rd party libraries, but also allows you to make games for Android. Pick your platform (XNA or mobile), then start learning.
[/quote]

Picking one makes sense, but I think the decision matters and depending on the person could see them deciding to focus on C# or Java. If I were forced to pick between those two I think I'd pick C#. The performance of this compression library on different languages is kind of interesting.
[/quote]

At this early stage, any performance benchmark doesn't matter. Why is he going to do now, write an algorithm computing 1 billion data points for secret military operations in Nevada? Think about it in utility sense. Java and C# are probably two languages that are the closest to one another in term of the syntax. The main differences between the two of them are the platforms they are typically used for. Now the question becomes which platform that the OP is most comfortable in. Choosing one does not mean that he's stuck at that for the rest of his life. Choosing C# does not mean "Oh no, Windows forever! Apple is getting popular! I can't switch anymore!" Choosing Java does not make you are a slave to JVMs. He can be learning C# now and switch to Java 2 years later, or vice versa. Can't you see how trivial choosing a language is, especially between C# and Java? Edited by alnite

Share this post


Link to post
Share on other sites

[quote name='alnite' timestamp='1342634973' post='4960580']
Ultimately, Java or C# or C++ do not matter. You really should consider programming languages as musical instruments, and you use them to play your music. Some instruments work better for certain types of music. But just like any other good musicians, a programmer must learn how to play not just one instrument, but several. Depending on what music he wants to play, what mood he wants to convey, he picks up the right instrument and play it like a maestro.


It seems like musicians have a speciality though like Yo-Yo Ma.
[/quote]

I think it was a bad analogy, I'd look at it more like tools in general, a carpenter won't use a hammer to divide a board in 2 parts, he'll use the saw (And if you see a carpenter trying to bang a nail in with a saw, well... either he is a programmer who thinks one tool is all you need or he is insane) Edited by SimonForsman

Share this post


Link to post
Share on other sites


I think it was a bad analogy, I'd look at it more like tools in general, a carpenter won't use a hammer to divide a board in 2 parts, he'll use the saw (And if you see a carpenter trying to bang a nail in with a saw, well... either he is a programmer who thinks one tool is all you need or he is insane)


I thought of using that analogy, but I think it's slightly inaccurate. You can't properly cut a board with a hammer, but any programming language can be used to make almost all sorts of applications. Both Java and C# can be used to make games. They both can accomplish the same thing. So I avoid using the tools analogy, as I don't want to imply that different languages are used for different things. Other programming languages might fall into that category, such as Ruby/PHP/Javascript for web development, but at least, not these two.

Share this post


Link to post
Share on other sites

We receive answers like "language doesn't matter, learn algorithms, design principles, oop structure, etc", or "after learning java you'll jump to C# easily".

Like others said before, spot on. The language difference of C# and Java is trivial.

My advise is: start with one and if you feel comfortable with it, go to the other. After that, make applications with both languages.

Looking at other "beginner" programmers, the jump from your first language to the second is never easy. I think it's actually very frustrating but it is an important step to make. You'll learn a new Framework with different tools and implementation for the same job. You will see first hand the difference between design principles and their pros and cons. You will make jumps to different languages, frameworks and toolsets in your life as a programmer. Don't choose between the two languages, chances are, with so popular languages like java and c#, that later on you'd have to make an application in the other language anyways. And if not, your third jump will be easier. My advice is that after C# and/or java you move on to C++. So you will learn what the JRE and the .Net Runtime Engine are hiding from you.


Java's faster than C#.

Nope.
In Windows, the .Net Framework is closer tied to the Operating System. A Windows Computer should generally execute a C# Program faster than a Java Program. Especially Window programming has less overhead for its operations in C#.
Now to make things more complex, Java has a badass runtime optimisation. Compare the calculation times of a simple algorithm like Selection sort, after the third run or so your algorithm will run at least *2 faster.
I saw benchmarks on Linux machines, Java was there a bit faster than C# Mono. On a Windows computer, my money would be on C# for most applications.


...

can only subscribe to what you said, very good posting

Final note on C# VS Java...
if your task is to create a Window in a Microsoft enviroment, take C#. There is the greatest strength of .Net / the biggest weakness of the Java Framework.
For any other task your choice depends on the job and the enviroment.

Share this post


Link to post
Share on other sites

Telastyn, on 18 July 2012 - 11:03 AM, said:

Java's faster than C#.


This is taken out of context. If you re-read, you'll see that I said that Java's relative popularity will decrease faster than C#'s.


Nope.
In Windows, the .Net Framework is closer tied to the Operating System. A Windows Computer should generally execute a C# Program faster than a Java Program. Especially Window programming has less overhead for its operations in C#.
[/quote]


This is entirely incorrect. The .NET windowing API is closer to windows, meaning less adaptation overhead (maybe). That's the standard library, not the runtime. Java could've made (essentially) the same windowing API to get the same level of overhead.


Now to make things more complex, Java has a badass runtime optimisation. Compare the calculation times of a simple algorithm like Selection sort, after the third run or so your algorithm will run at least *2 faster.
I saw benchmarks on Linux machines, Java was there a bit faster than C# Mono. On a Windows computer, my money would be on C# for most applications.
[/quote]

.NET has the same sort of runtime optimizations (except on system types, which are pre-compiled in Microsoft's implementation).


Quit spreading misinformation. Edited by Telastyn

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!