Sign in to follow this  
  • entries
    67
  • comments
    82
  • views
    36782

Java or C++?

Sign in to follow this  
wijnand

80 views

Already opened my journal for just a few hours, and a interesting question came along. Why not program the game in Java? why use C++?

Java is a language I am quite familiar with, when making bussiness applications and making OBDC Connections, Java does have a lot of advantages over C++, and I will name a few of them.

Java:

Platform independant works on any platform
Garbage Collection (unused objects in the memory get destroyed)
Easier to do OOP with
lots of free compilers (Elipse, Netbeans)

C++

Much faster then Java
almost every game is written in in C++
lots of SDK's and API's require C++ knowledge specially for games

The biggest issue with C++ is memoryleaks, since I am quite a beginner when it comes to doing C++ and lowlevel coding, I hope that these things will go well, but it will be depedant on how vigilant I will be in keeping memory usage to a minimum and ensuring I remove objects that are not longer neccesary in the memory. The reason I chose C++ is purely because I find it an interesting language, and its also much faster then JAva, futhermore most of my experience in Java has been in school, and i found it quite a bothersome class to complete - not because it was a hard to learn language,indeed it was much easier then C++ in retrospect.

Teacher expectations, and basically ignorance of the existance of C++ made me dislike doing JAva because most teachers who consider themselves "great programmers" only stick to Java because of its garbage collection and ease of use with websites. Even a basic algoritm class where I had lots of C++ code for, and experience the teacher enforced me to use JAva because it was "beter" eventhough the hashtable in Java 1.5 was horrible, and I had to write the stupid table myself ;). There was also an class I followed that was for computer games, but it was for MFC and with the Rudy Rucker book, thankfully I am allowed by the school to assist them with making the minor in game design and development more interactive and challenging :)

C++ is that sense is a much lower language, therefore it gives me more power to do the things I want. And its also the main reason i want to learn C++ and DirectX. Futhermore my work wants me to try and make a TWAIN Interface for their software, so again C++ will be fun to learn! and I hope to be able to master it with ease :)

My system specs:

Athlon64X2 4200+
2x 1 GIG Corsair CL2
Geforce 7900GT 256MB
2x 160 GIG SATA II Maxtor Drives
Soundblaster Extigy Music edition
Asus A8NE 1014 Motherboard

Software:

Windows XP SP2
Visual Studio 2005 Pro Edition (the joys of being a student!)
Directx SDK April Refresh

Books:

Ultimate Programming with DirectX -
Programming Windows 5'th edition - Charles Petzold
3d Maths Primer - Worldware
C++ beginners guide

Sign in to follow this  


2 Comments


Recommended Comments

The best choice is always: choose the tool you feel the most comfortable with. You'll be much more likely to complete the project if you use what you're more comfortable with.

Remember, it's about making the choice that gets the game done, not what's faster, more efficient at hashtables, makes the best cappucinos, etc. [smile] Trust me on that one (especially the last item!). Once I realized this I've been making way more progress on my game projects.

Good luck! (And nifty journal you have here; I'll be sure to stop once and a while)

Share this comment


Link to comment
Thank you for the kind reply :) I am currently finishing my last homework assigment (recursion and hashtables ugh ;)). Then I will be focusing on my Journal more, the goal is for me to basically be reading each chapter of the book, summarizing and explaining code, and posting the source on the journal. for me this is a learning tool, but it would be great if others could learn from my progress aswell :)

Maybe once I get the hang of it, i can write a tutorial for people, but I am jumping guns now, although I supect i will be having fun :) Your right about your suggestion, but I am comfortable with C++ , and DirectX and it gives me more flexibility with a lot of information on the internet :)

I will be posting books im using (if thats allowed?) and maybe giving summaries and in the end release the basic engine of the FPS, and basically have a small PDF explaining how to make it for your own game :)


Share this comment


Link to comment

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