Sign in to follow this  
jdub

A Noobs Question: Java or C#?

Recommended Posts

I am new to programming. I have started java over the summer but after reading around on the forums I have thought about trying C#. I would like to know: 1. what are the benifits of C# vs. Java and vice versa. 2. Where i could get a compiler and IDE

Share this post


Link to post
Share on other sites
Quote:

1. what are the benifits of C# vs. Java and vice versa.

I assume your final objective is game programming, since you are in this forum, IMHO:
for beginner, C# has:
XNA
for industrial standard, C# has:
Direct-X
and most important, there are tons of Articles and sample code in the SDK. Best for beginner.
this is slightly better for C# programming, than Java.
Of course , if you want cross-platform, java is best.

Share this post


Link to post
Share on other sites
Oh man. This is definitely a trap question. Honestly either would suit you fine, I think the biggest deciding factor is whether or not you hate Microsoft.

Let me see if I can make some comparisons without anyone getting frothing mad.

- Java -
Pros:
Larger user-base
More tools
Lots of good, free IDEs to choose from
More open-source friendly
Better at being cross-platform
Not Microsoft

Cons:
Language is annoyingly restrictive

- C# -
Pros:
Language is friendlier, less restrictive
Language is evolving more quickly
Better games support (XNA)

Cons:
Microsoft

Share this post


Link to post
Share on other sites
I recommend C#. Java is a pain and the IDEs (*cough* Eclipse *cough*) are, in my opinion, slow and harder to use than something like Visual Studio or even command line.

C# is cross platform too as nobody owns C#. Microsoft owns XNA and DirectX, but there is nothing stopping anyone from using C# with the Mono Project and the Tao Framework to make games for Linux and OS X. I'm currently in the process of doing just that. To be fair it was tricky getting set up, but now that I have things going on OS X, I'll probably write up some tutorials.

Java and C# share some similar ideologies, syntax, and constructs so either one you learn first, the other will be a piece of cake. Just go with whichever you want to try. I think Java is a bit slower than C#, but certainly not unable to make games.

Share this post


Link to post
Share on other sites
Quote:
Original post by NickGravelyn
I recommend C#. Java is a pain and the IDEs (*cough* Eclipse *cough*) are, in my opinion, slow and harder to use than something like Visual Studio or even command line.

C# is cross platform too as nobody owns C#. Microsoft owns XNA and DirectX, but there is nothing stopping anyone from using C# with the Mono Project and the Tao Framework to make games for Linux and OS X. I'm currently in the process of doing just that. To be fair it was tricky getting set up, but now that I have things going on OS X, I'll probably write up some tutorials.

Java and C# share some similar ideologies, syntax, and constructs so either one you learn first, the other will be a piece of cake. Just go with whichever you want to try. I think Java is a bit slower than C#, but certainly not unable to make games.


While it is true that C# runs on multiple platforms (with mono) one has to remeber that mono sucks (its extremely slow compared to Suns JVM or Microsofts .NET).

Share this post


Link to post
Share on other sites
Quote:
Original post by Karnot
From user perspective - all existing Java software is substantially slower its C counterparts.

Even if that were the case, this discussion is not about C. You do realise that C# has nothing to do with C, right?

Share this post


Link to post
Share on other sites
Quote:
Original post by Karnot
From user perspective - all existing Java software is substantially slower its C counterparts.


This isn't the case any more, hasn't been for years, and even if it was, C# and Java are handled virtually identically, to the best of my knowledge (compiled to bytecode and then JIT compiled -- with the option of forcibly caching this compiled code).

@The OP - There is little between them. Personally I'd go for C#, simply because a) I'm familiar enough with it to know I would recommend it and b) Visual Studio (Express) seems like a better IDE than Java has to offer (although Eclipse does seem alright, in fairness).

Share this post


Link to post
Share on other sites
I'll throw another vote for C# and XNA while we're at it -- however, I'd just like to straighten one thing out...I have used both eclipse and visual studio extensively for projects of various sizes and anyone badmouthing eclipse without looking at it should really keep their mouthes shut...it is a capable, extensible IDE that is not only built from java, but just happens to excel at providing a development environment for it. If there's one thing I am -not- a big fan of about java, however, it is the arcane things I have to do to get a simple form application running.

Visual studio has a beautiful WYSIWYG form designer that generates quite lovely code...

I suppose another thing to consider is version control. For me anyway, being able to version control my code is important -- subclipse plugin for eclipse works lovely with subversion -- though, Visual SVN is pretty darn tidy too, for Visual Studio. Only thing not going for Visual SVN is the price tag -- and express edition visual studio cannot use plugins either, so that's out of the window.

Depends on what you want to do in the end. Game authoring is easier with XNA, imo -- it facilitates it. Java takes itself a little more seriously :)

~Shiny

Share this post


Link to post
Share on other sites
Quote:
Original post by Shiny
I have used both eclipse and visual studio extensively for projects of various sizes and anyone badmouthing eclipse without looking at it should really keep their mouthes shut...it is a capable, extensible IDE that is not only built from java, but just happens to excel at providing a development environment for it.


I should clarify my comment above: I am not, in any way, badmouthing Eclipse. I have used Eclipse, briefly, and (as I said) it seemed okay. My personal preference is for Visual Studio -- but IDE preferences are pretty subjective.

@The OP -- Re-reading your post raises another thing: if you've started learning Java, stick with it. Perseverance is one of the most important things when you're starting to learn to program.

Share this post


Link to post
Share on other sites
They're both capable languages that can produce quality products and will allow you to learn how to program. Whichever you are most comfortable will be fine. As you've already made a start with Java I would usually recommend sticking with it at least for the time being, but as we currently have the excellent C# workshop running as an additional learning resource you could always take a look at C# as well/instead if you like, then make your own decision on which you think you prefer.

Quote:
2. Where i could get a compiler and IDE

For C# I use Visual C# 2005 Express Edition
For Java I normally use JCreator LE (you'll also need a copy of the latest JDK).
Both are free.

Share this post


Link to post
Share on other sites
Thanks for posting everyone.
Since I do not have the time to learn two languages I think that I am going to stick with java. C# can come later once I have a bit of experience with OOP.

Share this post


Link to post
Share on other sites
Personally, I can't see the reason for the praise eclipse gets. (to me) it is awkward and seems to be one of those classic cases of flexibility hindering getting stuff done. NetBeans 6.0 (still beta) is (imo) a far nicer Java IDE.

Though I, like others would recommend C# for hobbyist gamedev.

Share this post


Link to post
Share on other sites
Quote:
Original post by jdub
Thanks for posting everyone.
Since I do not have the time to learn two languages I think that I am going to stick with java. C# can come later once I have a bit of experience with OOP.
That's a good plan. I used Java for years before switching to C#. Knowing both languages never hurt for me.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this