#139417 - Metju - Thu Sep 06, 2007 12:12 am
Okay, i know people probably have asked this about 100 times but i couldn't find any...I have never done any programing and i would like to learn C++. Anyone know any good sites where i could learn it fast and for free? (my Dad knows it but doesn't have time to teach me =P). i have looked some up on Google but they weren't very good...
Thanks a bunch
#139420 - sajiimori - Thu Sep 06, 2007 12:57 am
"Thinking In C++" by Bruce Eckel is downloadable for free.
C++ is very hard. If you find it frustrating, try Python -- it's good for beginners and professionals alike.
#139443 - Diddl - Thu Sep 06, 2007 7:28 am
if you have never done any programming C++ is very hard. start with basic or python. if c++ is a must, it's better to start with pure C.
#139444 - keldon - Thu Sep 06, 2007 7:31 am
Excellent link; added to my MUL here and somewhere else!
I would suggest learning QBasic; it's so easy to get started with the concept of programming. When I got my first PC and had nothing else to use I got to grips with programming using QBASIC. The commands are simple, and since I knew the concept of basic this wasn't hard at all. Mind you I had been through lots of books on BASIC that were written for young children, so I was already accustomed to it, in fact you should be able to find a handful of books on BASIC in the children's section of the library!
#139449 - kusma - Thu Sep 06, 2007 8:43 am
Qbasic is very dated, I'd much rather start out with Python as suggested earlier here.
#139450 - col - Thu Sep 06, 2007 9:35 am
Metju wrote: |
Okay, i know people probably have asked this about 100 times but i couldn't find any...I have never done any programing and i would like to learn C++. Anyone know any good sites where i could learn it fast and for free? (my Dad knows it but doesn't have time to teach me =P). i have looked some up on Google but they weren't very good...
Thanks a bunch |
Eckels book is good as are many others but if you haven't done any programming and you want to learn C++, THE introductory book is
Accelerated C++ http://www.acceleratedcpp.com/
(Edit: It's not free, but considering the huge investment of time involved in learning C++, it would be crazy to refuse the best texts for the sake of a few quid...)
One thing to remember though is that modern C++ programming and gameboy C++ programming are not the same...
probably best to learn the basics using Accelerated C++, then get a good book on C so you can understand the low level techniques that are often used in console C++ programming.
#139456 - tepples - Thu Sep 06, 2007 12:45 pm
col wrote: |
Eckels book is good as are many others but if you haven't done any programming and you want to learn C++, THE introductory book is
Accelerated C++ http://www.acceleratedcpp.com/
(Edit: It's not free, but considering the huge investment of time involved in learning C++, it would be crazy to refuse the best texts for the sake of a few quid...) |
And the best thing about it: it's not by Herbert Schildt.
And yes, if you plan on using GNU tools on small platforms such as the Game Boy Advance, I recommend that you learn C as well.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#139493 - Metju - Thu Sep 06, 2007 8:22 pm
thanks a lot everyone, about learning C, is there any real difference as far as programing GBA games than C++? I don't want to start my game out in C then realize that I can not add some feature or another.
#139496 - gauauu - Thu Sep 06, 2007 8:37 pm
The real difference is how you design and write the code itself. There is no difference in what features of the gba can be used.
#139500 - Kyoufu Kawa - Thu Sep 06, 2007 9:09 pm
Yeah. It basically turns into the same nigh-unreadable gunk anyway. With some added overhead in C++'s case.
That and fright is why I still haven't switched.
#139513 - tepples - Thu Sep 06, 2007 10:52 pm
Metju wrote: |
thanks a lot everyone, about learning C, is there any real difference as far as programing GBA games than C++? I don't want to start my game out in C then realize that I can not add some feature or another. |
I can think of a couple things that might make C++ less attractive for GBA development:
You need to know the true semantics of each language feature. Because C++ is both newer and larger than C, a lot of C++ books get this wrong. After you learn the basics, follow up with Effective C++ CD by Scott Meyers so that you can begin to unlearn any misconceptions you may have learned.
You need to be aware of how much space and time overhead each feature adds. But one of the first things they teach you in C++ (#include <iostream>) has a huge space overhead if you try it with GNU libstdc++ on a small embedded system such as the Game Boy Advance.
But once you overcome these, you should have little problem with C++.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#139518 - Metju - Thu Sep 06, 2007 11:45 pm
right, thanks, i heard you can only program GBA games using C/C++, is that true or could i use other languages like python? sorry, I'm really new to this...
#139522 - tepples - Fri Sep 07, 2007 12:54 am
The Python runtime itself is a huge overhead. It barely fits in a DS, and that has 16 times as much main RAM as a GBA.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#139525 - dantheman - Fri Sep 07, 2007 1:37 am
You can use DragonBasic, though it's relatively limited, so C++ would probably be recommended over it.
#139542 - col - Fri Sep 07, 2007 10:41 am
Kyoufu Kawa wrote: |
Yeah. It basically turns into the same nigh-unreadable gunk anyway. With some added overhead in C++'s case.
That and fright is why I still haven't switched. |
I'm not sure your assumptions differ from my experience, but they do !
I find my C++ code to be readable even on larger projects, more so than if I had had to use plain C. It doesn't have any 'overhead' either compared to equivalent C code...
@the OP
I would suggest that diving straight into GBA coding as a means to learning C++ is a mistake. Coding C++ for a platform like GBA requires so much 'extra' knowledge and so many deviations from 'best' practice that it might be counterproductive....
Learn the basics of modern C++ on a PC using Accellerated C++ that will teach you how to use the important features of the STL, and other stuff that you probably wont use on GBA but would be expected to use elsewhere....
Then when you have that down, learn the C style coding that is required for Some parts of GBA development; learn how to switch off and do without some of the features like Exceptions and RTTI; learn how to avoid using dynamic allocation; learn how to write your own custom memory allocators; how to control the Linker....
...and a whole bunch of other stuff that you need to understand for GBA dev but will get in the way if you are a beginner to programming....
#139579 - sajiimori - Fri Sep 07, 2007 6:37 pm
Crappy code turns into unreadable gunk regardless of language.
#139585 - Kyoufu Kawa - Fri Sep 07, 2007 8:14 pm
Saji has a fine point.
The overhead I referred to was mostly from creating/destroying classes. C++ has its charms though, and I'm very glad C supports /* */ and such.
#139593 - sajiimori - Fri Sep 07, 2007 9:45 pm
If constructors/destructors are generating more code than you would have hand-written in C, then you have room to optimize where necessary, usually by reducing the complexity of your constructors and destructors, or by controlling them more closely with placement 'new'.
Sorry, this is getting a bit off topic! :)
#139609 - tepples - Sat Sep 08, 2007 3:02 am
For a laugh, try reading alleged flamebait about C++ from Linus himself.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.