Sign in to follow this  

Which Language Should I Learn (c#, c++, JAVA)

This topic is 3773 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've decided that I want to study computer science at university. In the particular course that I'm looking at I work with c#, c++ and JAVA. I've also decided that I want to learn one of the languages before I go (I have a few years yet). Now, I pose the question "Which one shall I learn". I already have had quite a bit of experience in c++ by following a book (C++ in Easy Steps by Mike McGrath), I got about half way through the book before I realised that I have been learning the language for about 3 months and I'm still looking at the same black square with white text as a result. Everytime my parents came in to see what I was coming up with they were also faced with the same square, and their encourgement became.... well, less encouraging. I have also followed a single tutorial on c#. I liked this tutorial because it was much more hands on, and I was able to create a basic application that had a GUI (it was an image loader). JAVA is the language I have had the least amount of experience in, infact all I know is that I was able to right a 'hello world' application in a single line of code.

Share this post


Link to post
Share on other sites
Well if you've been learning for 3 months there's shouldn't be any reason why you can't do more than just console applications; the fundamentals of c++ are exactly the same you are just use a different library.

Do you want to a make a 2D simple game ? Consider using SDL (Simple DirectMedia Layer) there's loads of documentation and tutorials for it (including some aimmed a newbie programmers) and it has a much nicer interface than dealing directly with DirectX, DirectSound, and DirectInput.

Take a look at http://www.libsdl.org/ and the have a poke through the tutorials. In the beginning game development set tutorial's, you spend the first one setting up SDL as an external library, and the second actually drawing picture's to the screen :D Much more fun than the old command prompt. And it goes through and explains important things like Event Driven Programming, and Collision Detection.

Or alternatively, look at something like ogre3d (http://www.ogre3d.org/) if you want to play around with a really powerful 3d graphics. It is however a lot more complicated than SDL and you'll need to be fairly good at OO programming to understand it, but considering how powerful it is, it is fairly easy to use. It's 'only' a graphics engine though, so it wont handle things like sound, and physics, but wrappers (code that gets ogre working with the other libraries) exist for OpenAL (a sound library) and quite a few different physics engines.


Now, back to your original question. Learn C++. Java and C# are both too slow for game development beyond basic 2D stuff. In Computer Science you'll probably learn both Java and C/C++, but in my degree anyway we mostly worked with C++. Java is simpler since you don't need to worry about Memory Management (New/Delete in other words), but I found the way it forces you to program in a particular style to be very, very annoying, plus is too slow for game development.


If I was in your position, I would keep C++ but learn how to use the SDL library. It will be way more fun to play with


ps First Post on GD =P

Share this post


Link to post
Share on other sites
C# is easier to use to focus on learning to program (rather than learning a particular programming language), with its cleaner compilation model, tighter syntax and managed framework (as opposed to C++).

Personally, I'd go for C# as you get MSDN and Visual Studio, an excellent reference and IDE. This site is also running a C# workshop at the moment.

This question comes up frequently, so I'm sure if you search this forum you'll find many other responses. [smile]

Share this post


Link to post
Share on other sites
Quote:
Original post by MrMark
Java and C# are both too slow for game development beyond basic 2D stuff. [...] plus is [Java] too slow for game development.
Hm, this is simply not true. [wink]

Share this post


Link to post
Share on other sites
No, that comment is getting pretty tiresome. :-/

MrMark:

The whole "a language have no speed" discussion apart, the implementations for C# and Java is plenty fast for games, and even if it weren't, you could write those 2% of your code that needs speed in a lower level language (for indie/hobbyist games, I don't see any point in that though).

As for the comment about being forced to program in a specific style... When you work in a team, do you not agree on a style? So you're still forced to use some arbitrary style? Then why not have one standard style that everybody uses? As an added benefit, you don't have to guess naming conventions and semantics for libraries. It's great, really ;-)

SamuelRSmith:
I'd go for Java or C#. Both have plenty of game development libraries available. I'd choose Java because I think it's cleaner, but this is highly subjective. Try them both and see what you like.

Share this post


Link to post
Share on other sites
Quote:
Original post by benryves
Quote:
Original post by MrMark
Java and C# are both too slow for game development beyond basic 2D stuff. [...] plus is [Java] too slow for game development.
Hm, this is simply not true. [wink]



I'm pretty sure no Graphic Engine written in Java exists, but hey I could be wrong.

Share this post


Link to post
Share on other sites
Quote:
Original post by Ahnfelt
No, that comment is getting pretty tiresome. :-/

MrMark:

The whole "a language have no speed" discussion apart, the implementations for C# and Java is plenty fast for games, and even if it weren't, you could write those 2% of your code that needs speed in a lower level language (for indie/hobbyist games, I don't see any point in that though).

As for the comment about being forced to program in a specific style... When you work in a team, do you not agree on a style? So you're still forced to use some arbitrary style? Then why not have one standard style that everybody uses? As an added benefit, you don't have to guess naming conventions and semantics for libraries. It's great, really ;-)


For indie games, being dependent on the JVM can be an issue when you try to distribute the game, but that's beside the point.

Anyway yes in a team you need to all use the same style, or atleast you should, it makes things easier. By style I didn't just mean naming conventions and semantics, Java I believe just introduced a limited support templates in the latest release. Or what about things say operator overloading ? As far as I know Java still doesn't it. That is what I meant by style.

Share this post


Link to post
Share on other sites
And you are :P
jMonkeyEngine is probably the most popular one out there (it's more than just a graphics engine), but there are plenty of others.

Yes, Java generics are not like C++ templates. They have no compile time logic and the compilation scheme is different. They're less powerful, I'll give you that.

I consider the lack of operator overloading a good thing though. Take a look at << which is used for completely different things. Or take a look at the boost::spirit parser for a horror example. Sure, you may know when to use operator overloading, but what about the makers of the libraries and tools that you depend on? What if you disagree that appending something to a list should be done through the *= operator? It's a lot of annoyance and language bloat for very little gain I think.

Share this post


Link to post
Share on other sites
Quote:
Original post by MrMark
Quote:
Original post by benryves
Quote:
Original post by MrMark
Java and C# are both too slow for game development beyond basic 2D stuff. [...] plus is [Java] too slow for game development.
Hm, this is simply not true. [wink]
I'm pretty sure no Graphic Engine written in Java exists, but hey I could be wrong.
Yep, you are wrong. Welcome to GameDev.net and all, but in future if you aren't sure, don't spurt your mouth off like you are.

One Java Engine is jMonkeyEngine, not to mention the COUNTLESS game and graphics engines written with J2ME for mobile platforms.

As for C# being too slow, this is just outright bollox.

My advice for the OP would C# and if you have a desire to make some games the XNA Framework is really nice to work with.

Regards,
ViLiO

Share this post


Link to post
Share on other sites
Quote:
Original post by Ahnfelt
And you are :P
jMonkeyEngine is probably the most popular one out there (it's more than just a graphics engine), but there are plenty of others.


Yup I am most defiantly am. They were some pretty impressive real time visuals. OP ignore what I said about Java being too slower, quiet clearly it isn't =P

I'm gonna have to give Java another swirl when I get time, it would be nice to have cross-platform stuff just work.

Anyway OP, if you still want to continuing learning C++ take a look at those libraries I mentioned, but you also might wanna look into Java too.

Share this post


Link to post
Share on other sites
Yeah, I think I will give c# a decent try. It doesn't really matter all that much as, in the end, I will be learning and using all three languages.

The main appeal for using c# is XNA, which I really like the looks of.

Oh, and does c# have any web stuff, as I'd like to program a few web applications and the like.

I take it that Visual C# is the best option, at this moment in time will I be ok with the enterprise edition, or shall I try to get my hands on a more advanced edition?

Share this post


Link to post
Share on other sites
Quote:
Original post by SamuelRSmith
Oh, and does c# have any web stuff, as I'd like to program a few web applications and the like.
You have just touched on something that C# (really all the .NET languages although I prefer C# myself) does phenomenally well [smile]

Visual Web Developer

All the best,
ViLiO

Share this post


Link to post
Share on other sites
Quote:
Original post by SamuelRSmith
That's really cool, looks like I will definatly be trying c# next, any advice before I dive in?
You could try to work through The C# Workshop and join it if it isn't too late.

Also, don't feel you should need to invest in the versions of Visual Studio that cost money right at this stage. The Express editions are ridiculously feature rich and won't break your bank balance while you are getting your feet wet with C#.

Regards,
ViLiO

Share this post


Link to post
Share on other sites
For learning to program before you go to uni C# would be your best bet. After learning any of the languages that you have mentioned it'd be pretty easy to cross over to one of the others. But for simply picking up and learning C# is probably the easiest.
To make learning it a little more interesting try some of the stuff on the Beginner Developer Learning Center that is linked to from the C# express download page.
http://msdn2.microsoft.com/en-gb/express/aa700756.aspx
As for the comments about one language being faster than another, just ignore them. If there are no games written using Java then why am I sat here at work being paid to write games in Java?

Share this post


Link to post
Share on other sites

This topic is 3773 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.

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