• C++ or Java?
    61 replies, posted
Hello, I am currently thinking of what language I should learn. I can't decide between C++ or Java, because both seem to have good benefits. What I want to do is create games primarily for the Windows platform, although obviously Mac support would be nice. I think these games wouldn't be too intense hardware-wise, although I don't have a very good idea since I have little to no experience with programming. I already have a C++ book, but I wouldn't care much if I had to buy a Java one and spend more money. Anyways, which programming language do you guys recommend? If there's another language that isn't C++ or Java, I probably wouldn't count them out.
If your goal is to create games, then Java is probably the better choice of those two. Though I would recommend C#. Possibly even 'easier' languages, like Python (look for pygame) or Lua (look for LÖVE). If you wanna learn programming and just have fun by creating games for experience, you can basically choose whatever you like best. Try C++ as you already have a book and if you don't like it, try something else.
C++ is more versatile, it takes longer to learn properly and more work than java to get your games to run multi-plaform, but that really depends on how you implement your code. I say go for C++
Hm, I'll look at those ZeekyHBomb. [editline]01:55PM[/editline] [QUOTE=Zally13;23941919]Hm, I'll look at those ZeekyHBomb.[/QUOTE] What advantages does Python have?
What type of games are you planning on making? If your creating little minigames as a hobby or going to make a small to medium size game that you will want to run on all platforms then go with java If on the other hand your aspiring to become a professional game developer then start with C++ it will take you longer to learn and will be trickier but in the long run will pay off Also pretty much every commercial game is made in C++, however apart from minecraft and a couple of others there's pretty much no commercial java games The good thing about java is you can code all your game and its done, it will work on windows, mac, linux... Whether as C++ will probably need you to tinker with the code changing libraries depending on the OS
We really do need that sticky back up... On-topic: It doesn't really matter that much, the important thing is that you start. If you don't like it, you can switch, way simpler than marriage. Personally I recommend C# but since I have no experience with Python or Lua, I can't say it's easier or a better choice.
[QUOTE=Zally13;23941919]Hm, I'll look at those ZeekyHBomb. [editline]01:55PM[/editline] What advantages does Python have?[/QUOTE] Over which other language? C++, Java and C#? Python is a more easier language in the way that it does more for you without asking. It's a little hard to explain considering you have not programmed before. Basically, in Python you don't have to be as verbose as in those other three languages. In return, Python will run a tad slower, consume a tad more memory and you have a bit less control over how things are done, though I cannot tell you how much these are in effect, it will be negligible if you don't try to build a current-gen game on a decent computer. [QUOTE=Richy19;23944171]What type of games are you planning on making? If your creating little minigames as a hobby or going to make a small to medium size game that you will want to run on all platforms then go with java If on the other hand your aspiring to become a professional game developer then start with C++ it will take you longer to learn and will be trickier but in the long run will pay off Also pretty much every commercial game is made in C++, however apart from minecraft and a couple of others there's pretty much no commercial java games The good thing about java is you can code all your game and its done, it will work on windows, mac, linux... Whether as C++ will probably need you to tinker with the code changing libraries depending on the OS[/QUOTE] Have you ever done cross-platform development? You can easily avoid platform-dependent errors or only leave room for a small error-margin. And I also have heard that cross-platform development with Java is sometimes not as easy as one is getting told, though I don't have any facts concerning that.
[QUOTE=ZeekyHBomb;23944639]Over which other language? C++, Java and C#? Python is a more easier language in the way that it does more for you without asking. It's a little hard to explain considering you have not programmed before. Basically, in Python you don't have to be as verbose as in those other three languages. In return, Python will run a tad slower, consume a tad more memory and you have a bit less control over how things are done, though I cannot tell you how much these are in effect, it will be negligible if you don't try to build a current-gen game on a decent computer. Have you ever done cross-platform development? You can easily avoid platform-dependent errors or only leave room for a small error-margin. And I also have heard that cross-platform development with Java is sometimes not as easy as one is getting told, though I don't have any facts concerning that.[/QUOTE] If you used c++ you could create one same application that doesn't call any OS specific libraries however most tutorials will show you in windows As for java if you are using javas own stuff its pretty much every platform its only if you use things that aren't from sun that you might find it doesn't work from one to another java runs in a virtual machine which then translates your code into the OS specific stuff that's why its all the same at least that's what I have understood
I did and still am using C++. I consider myself quite adequate with it. You are being way to general with 'tutorials'. The only reason I could imagine them being Windows-only is reading one for a Windows-only library. Besides, tutorials are only meant for a quick-start. You should refer to the documentation if you get serious. I do know that Java usually gets compiled into bytecode to be interpreted by a Java VM. However, like I said these were only rumors and I have nothing to back it up.
What would be the best program to code C++? Visual C++? Or something else?
as your starting out visual C++
I don't see why starting out with another IDE like Code::Blocks or CodeLite would be any harder. Still, you could probably just throw a dice as for now the differences won't really matter to you. Unless you have slow Internets, low harddrive capacity or want it to run from a portable drive, in which case Code::Blocks or CodeLite would be the better options.
[QUOTE=Richy19;23944786]If you used c++ you could create one same application that doesn't call any OS specific libraries however most tutorials will show you in windows As for java if you are using javas own stuff its pretty much every platform its only if you use things that aren't from sun that you might find it doesn't work from one to another java runs in a virtual machine which then translates your code into the OS specific stuff that's why its all the same at least that's what I have understood[/QUOTE] Actually, most tutorials only really cover the standard library and language features, all of which are very much portable. [QUOTE=Zally13;23945087]What would be the best program to code C++? Visual C++? Or something else?[/QUOTE] Visual Studio is pretty much the best IDE for Windows. There are a few cases where you might want to look at something else, but I can't imagine any one of them applies to you: 1) You might want to use another compiler than MSVC, like GCC or Clang 2) You don't like IDE's and you want to use a text editor with a terminal (possibly in-built) instead 3) You're sufficiently into FOSS to specifically not want to use Visual Studio, but I reckon if you were, you probably wouldn't be using Windows 4) Visual Studio simply weren't working out for you (??) If for any reason you're looking to try another IDE, I recommend you take a look at Code::Blocks. edit: See ZeekyHBomb's points as well :)
[QUOTE=ZeekyHBomb;23945364]I don't see why starting out with another IDE like Code::Blocks or CodeLite would be any harder. Still, you could probably just throw a dice as for now the differences won't really matter to you. Unless you have slow Internets, low harddrive capacity or want it to run from a portable drive, in which case Code::Blocks or CodeLite would be the better options.[/QUOTE] What exactly are the advantages over Visual C++?
i guess. but i find that visual c++ has a better autofilling feature
autofilling? You mean auto completion stuff? Well, hardly an important feature, as well to a beginner. The advantages of the two alternatives I mentioned are they are more lightweight (occupy less space) and by default they pack a compiler, which is more standard-conform afaik, which probably is a good thing. At least it can't hurt. Additionally you can easily run them from a portable drive, e.g. a USB-Stick. IMO they also have more charm as they are open-source. Not really an important or impressive point though. I still use MSVC (short for Microsoft Visual Studio C++) on Windows occasionally.
[QUOTE=Zally13;23945461]What exactly are the advantages over Visual C++?[/QUOTE] It's free. That's really about it. I've never really been much into IDEs when writing C/C++ code. I tend to use vim and GCC with a simple build script or makefile. I have used code::blocks briefly, though (and I used Visual C++ for almost all of my college assignments), and Code::Blocks really didn't impress me in any way. I do have one [u]big[/u] issue with the Microsoft Visual C++ compiler and libraries though, specifically broken and non-standards-compliant function implementations and missing header files. MSVC's implementation of snprintf is non-standard and [i][u]dangerous[/u][/i]. "stdint.h", a C99 header full of standard integer types is missing, as well. Arguably the latter is not a problem with MSVC's compiler as it is specifically a [i]C++[/i] compiler, but since Microsoft doesn't offer a true C compiler (only a C-compatibility mode in MSVC), I would consider this to be a major problem.
Open Source IDEs tend to let you integrate whichever compiler you want as well, which is a great bonus, especially for C (in particular) and C++ when considering how terrible MSVC really is for these languages.
ZeekyHBomb could you post some tutorial links on c++? or book suggestion as i would like to get into it some more also i find the auto completing feature to be quite useful as it allows you to explore by yourself
Well, there's the popular tutorial on [url]www.cppreference.com[/url] and I have also used [url]www.learncpp.com[/url] a bit, though as I know now the latter tells you some misinformation. I don't think it was this important though. I've never used the former, though I often use that website if I need a documentation to something in the standard library. Internet tutorials will only teach you so much, I find book to cover it better. I myself have read C++ in 21 Days by Jesse Liberty. I also hear that Accelerated C++ is a good book. If you already know the syntax of C++, Effective C++ by Scott Meyers was very helpful to me. As for the auto-completion, a documentation contains much more information and is more reliable than just a function-name. That function might do more than you expected or does stuff a little differently than you've guessed. Maybe it was even deprecated.
Yeah, the book I'm using is Accelerated C++. It's a bit confusing.
[QUOTE=Zally13;23957679]Yeah, the book I'm using is Accelerated C++. It's a bit confusing.[/QUOTE] Accelerated C++ is an excellent book to learn C++, although you probably need to have some programming knowledge already.
I heard it's good for beginners, it made me stumped within the first chapter. I may as well keep at it though, right? I'm just curious, how long would it take to be pretty fluent with C++ if I programmed for like an hour a day?
I'm learning C++ using the book "Beginning C++ through Game Programming" (2nd edition). It's pretty good and explains everything well. It's also laid out nice, whereas quite a lot of online tutorials can be a be confusing to read what with ads and weird layout.
[QUOTE=The DooD;23964759]I'm learning C++ using the book "Beginning C++ through Game Programming" (2nd edition). It's pretty good and explains everything well. It's also laid out nice, whereas quite a lot of online tutorials can be a be confusing to read what with ads and weird layout.[/QUOTE] Yea i have that book however it only teaches command line programs and i wish to learn more, of course i will have to start off with command line apps. [editline]05:22PM[/editline] BTW do any of you use Dev C++? i think its my favourite c++ IDE however i find it simple and without many features DW i have just seen its 5 years old (how i didn't realise it before i don't know) seeing as every time i downloaded it within the last year it was always the same version
[QUOTE=ZeekyHBomb;23945740]autofilling? You mean auto completion stuff? Well, hardly an important feature, as well to a beginner. The advantages of the two alternatives I mentioned are they are more lightweight (occupy less space) and by default they pack a compiler, which is more standard-conform afaik, which probably is a good thing. At least it can't hurt. Additionally you can easily run them from a portable drive, e.g. a USB-Stick. IMO they also have more charm as they are open-source. Not really an important or impressive point though. I still use MSVC (short for Microsoft Visual Studio C++) on Windows occasionally.[/QUOTE] So anyways, which of the two would you recommend?
I haven't used Code::Blocks in quite a while, though when I was comparing back then my preference was CodeLite. I think I had problems with Code::Blocks often crashing on the schools computers, but CodeLite would run fine. Recently I have switched to gedit with an integrated terminal, though as a beginner you will probably be more delighted to press a button and have the program running. In these forums at least, Code::Blocks is more popular I think, so it's probably wise to choose this one in case you run into any problems with the IDE.
Vim is incredible if you want just a text editor and not an IDE. (There's a graphical version too, if you don't like terminals. The graphical version I see the most is gvim) [editline]09:31PM[/editline] Also on Windows - Notepad++ is kewl.
I'll give Code::Blocks a shot, anything I should know about before I get too involved with it?
Make sure you understand everything the book/tutorial tells you. Often following chapters (or even just paragraphs) will assume that you did. And feel free to ask about anything (programming-related :P) in the "What do you need help with?"-thread.
Sorry, you need to Log In to post a reply to this thread.