Jump to content
  • Advertisement
Sign in to follow this  
Cedric J M

Java or C++ (games)

This topic is 3566 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

Okay, I am your stereotypical teenager that wishes to create a MMO. But I'm not really worried about that now. I just want your unbiased opinion, I don't care if you like java or C++ more. Which is better strictly for gaming, java or C++? On the forums I've seen people discuss java and C++ but no one ever really answered this question. I'd just like to know because I'm taking a java programming class, but I hear C++ is more efficient and faster. Thanks for reading. --Cedric Miles [Edited by - Cedric J M on January 14, 2009 12:00:35 PM]

Share this post


Link to post
Share on other sites
Advertisement
Your unbiased answer is: neither.

Your question is far too general to answer with anything other. C++ and Java are both viable languages for writing games, along with many other languages -- even the dreaded P word, as much as I hate to admit it. [wink]

The real question is what you have and what you're looking to achieve: what language features are important to you and your project? C++ offers speed and flexibility at the cost of simplicity and safety.

If you want to play around with writing pong or breakout then C++ is a fine choice when paired with something like Allegro, SFML or SDL as it will give you experience in a widely used language that could benefit you in other ways.

Conversely if you're the one man army type and want to make your big MMO idea a reality, then Java is probably a better choice, since it'll give more and ask less on a one man team.

In summary, neither language is inherently better than the other, thus the endless debates. Just remember to pick the right tool for the job.

[Edited by - Puck on January 14, 2009 7:16:36 PM]

Share this post


Link to post
Share on other sites
They are both fine, although industry standard is c++..

And yea your question is really broad, just learn one and use it. Since you have a class in Java, might as well use it to your advantage and program your games in that while you are learning. Learning any language will benefit you in many ways and will make learning other languages "easier."

Also the reason the question has never been answered is because there is no definite answer. For me, Java is better because I know it fairly well and can get started on my game right away, rather than having to learn the basic c++ language before getting started...

Share this post


Link to post
Share on other sites
as a teenager I'd lean more towards Java than C++, for two reasons, the first being that I've found it a lot easier to make games in Java (I found the references easier to read, and making a choice on which library to use is easy), and secondly the free libraries out there will help you a lot when it comes to making a large scoped game (could use something like darkstar for the server and jme/slick/pulpcore depending on whether it's 2D standalone/web based or 3D for the client)

Share this post


Link to post
Share on other sites
I usually don't post in these kinds of questions but since I am bored...

I started learning C/C++ probably 10 years now. No I don't do it for a living, but I am far from an expert. People who use it daily and do it for a living will have a better grasp then me as they work all day in C++.

Reason I went with C++ is at that time Java was new and not well established. Plus DX is C/C++. Now the funny thing is when I set out to code games, I was planning on using DX and C++. Well I don't use DX. I use OpenGL and C++. And the older I get the less time I have, I really, really think sometimes that Java would have been a better language to go with. You can use OpenGL in Java. I think SDL is in Java now to...

If you know C++, Java is easy beans, No PUN intended! :)

I like OpenGL as I want X platform and DX isn't. Java is everywhere, but so is C++. So in the end you just need to know what you are looking to do and pick tools that are available to you for that path.

[Edited by - MARS_999 on January 14, 2009 4:54:26 AM]

Share this post


Link to post
Share on other sites
I would say C++ mostly because I hate Java. I hate Java because I feel that I code really sloppy in it because of the garbage collection and it doesn't have as many features as C++. C++ has also more game programming libraries than Java.

Share this post


Link to post
Share on other sites
Why not both? Just learn one then the other. It's always good as a programmer to know more then one language.

Share this post


Link to post
Share on other sites
Quote:
Original post by Cedric J M
Okay, I am your stereotypical teenager that wishes to create a MMO. But I'm not really worried about that now. I just want your unbiased opinion, I don't care if you like java or C++ more. Which is better strictly for gaming, java or C++? On the forums I've seen people discuss java and C++ but no one ever really answered this question. I'd just like to know because I'm taking a java programming class, but I hear C++ is more efficient and faster. Thanks for reading.

--Cedric Miles

Sounds like, in your situation, Java is the better choice, because you're already being educated in it. Efficiency may be an issue for heavily demanding programs, but as a beginner, you'd better stick to simple games anyway so that shouldn't be an issue right now.

I don't think one is always better than the other. They have different strong and weak points. Learn to identify these, so you can make your own decisions on which tool is best for your current job. It's one of the reasons why knowing multiple languages is so useful.

Share this post


Link to post
Share on other sites
Hi,

If you've just started with programming I'd suggest you to learn C.

If you are ready to go and pretty motivated to start working on a videogame
you have in mind I think that you should consider a wide range of factors,
for example: what's the aim of your game?

If your idea is just a project you want to put in your portfolio to show
your skills to software houses you should program it in C++ since a lot of
companies require a good understanding of C/C++.

If you want to spread your game on the internet to be easily played by a lot
of users you should choose Action Script 3 ( Flash ).



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!