Books To Learn How To Code?


ilovevideogames408

Still Fresh
Joined
Apr 25, 2009
Messages
55
I realize this may take some time and effort on my part, but I would like to learn how to code and one of my teacher's pointed out open-source machines and I was reminded of the Pandora. Anyways, I would love to learn how to code in C++ and code for the Pandora OS in however many years it would take for me to get the hang of it. Any suggestions for some stuff a 17 year old might get? I'm hoping to get into developing games and emulators if that helps?
 
I'd assume it'd be the same "stuff" i.e. books any beginner of programming languages (with a significantly weighted C++ alliance) would purchase, borrow, steal, maim, etc. I've always found Bjarne Stroustrup's "The C++ Programming Language - 3rd Edition Special" to be a great beginner's (and most anywhere, actually) book. Herbert Schildt's "C++ The Complete Reference - 4th Edition" is a great reference book. Really, depending on how you go about things, it's hard to give you information on all of the books for your endeavours, but they are two great starting points. You may also want to check out http://www.cplusplus.com.
 
In my experience, most books don't seem to cover IDE setup enough, so here's my suggestion:

If you're using Windows, try installing Code::Blocks with the MinGW compiler.
http://www.codeblocks.org/downloads/5
It's the second download under "Windows".

Use the default installation options.

Now try something like this:

0. Run Code::Blocks
1. Create a new, empty project. Call it whatever you want, maybe "project-1"
2. Create a new, empty file. Call it "main.cpp"
3. Enter the traditional "first c++ program":

CODE
#include <iostream>

int main () {
std::cout << "Testing..." << std::endl; // Make sure this is a lowercase L, not a 1
return 0;
}


4. Click "Build -> Build and Run" or press F9.

If Code::Blocks opens a console windows that says, "Testing...", then your program works.

Now find any C++ book that your library or bookstore has, and read through it, trying all the examples and reading the text.

If at any point something unexpected or confusing happens, ask for help. Ask Google first. Then ask us. Maybe even ask a C++ forum, I think www.cplusplus.com has a decent one.
 
Learn from my personal experience, don't ask for technical assistance on a forum unless you absolutely have no where else to go. You'll probably figure it out on your own, and leave an embarrassing topic up for the world to see.

Edit: I second teh-programmer's suggestion for cplusplus.com. It is very easy to follow, the material can be learned in a matter of weeks. Just remember to find different ways to reinforce the lessons. Once you've finished with basic C++, you're going to want to work with SDL libraries if you want to program for the Pandora. I recommend checking out this website to learn about that.

http://www.lazyfoo.net/SDL_tutorials/
 
Learn from my personal experience, don't ask for technical assistance on a forum unless you absolutely have no where else to go. You'll probably figure it out on your own, and leave an embarrassing topic up for the world to see.

Edit: I second teh-programmer's suggestion for cplusplus.com. It is very easy to follow, the material can be learned in a matter of weeks. Just remember to find different ways to reinforce the lessons. Once you've finished with basic C++, you're going to want to work with SDL libraries if you want to program for the Pandora. I recommend checking out this website to learn about that.

http://www.lazyfoo.net/SDL_tutorials/
Read tutorials. Try to code.
Read books. Try to code.
Have an idea. Try to code.
I personally figure things out by necessity as and when I need them. Occasionally reading something somewhere inspires how to improve things or sparks off new ideas. The important bit is to keep programming.

I agree you should go to forums last for help when program, it's more satisfying if you figure it out by yourself.
I DISAGREE about it being an embarrassing blemish. Learn from your mistakes and allow other to also learn from them by pointing out what the mistake was and why you did what you did. Don't be a selfish coder.

For Pandora you can use SDL which lazyfoo has been suggested already, you could also try using Penjin(link in sig)

I suggest you order the OpenGL ES 2.0 programmer's guide if you are thinking of doing any 3D work.
 
Last edited by a moderator:
Another place to post questions are IRC channels. Not quite as permanent as forums. Also, if you're serious about learning, consider looking into classes at your local community college. This isn't true of everybody, but I find that I work much quicker if I have due dates. Also, while I like to discover stuff on my own, there are PLENTY of programming pitfalls one can get into, and make a habit of. A good instructor can steer you clear of some of them before they become ingrained, something you have to unlearn before proceeding. (I'd do a little research and make sure that the instructor teaching the classes is a GOOD instructor. If not, I'd probably take a pass.)

The C++ Primer by Stanley B. Lippman is a good book to start with. As is Bjarne's book mentioned earlier.

Most beginner's books on C++ will - rightfully - focus on language features and algorithms. It can be a little dry going sometimes, but worth the effort.

If you're like me, you're interested in programming to create games. While most of the beginning C++ books will cover the topic, some of the problems can be bland. That said, it's good to go ahead and work through them. It will pay off. In the meantime, while you're learning, there are some decent, basic game programming books. The Programming Linux Games book is dated, but covers some SDL fundamentals.

For Linux development on embedded systems, like the Beagleboard or the Pandora, there's a lot to getting your PC to cross compile properly without borking things for your main build environment. Initially I'd suggest building 2d games in SDL to run on your PC, then worry about cross compiling later.

Setting up your build environment, weather it be IDE based or not, becomes important a while after you've gone through the Primer Book(s), especially in Linux. Many of the examples will be something you can write and compile from the command line. (I use VI, so I don't often go back to the GUI. Personal preference that.) For MOST GUI programming - I.E. making an application that runs in a windowed environment - programming from an IDE becomes almost inevitable. They also tend to have nicer front ends to things like debuggers than the command line, but plenty can be done from there anyway.

Cheers!
 
I'll be looking for these at my library... This thread helps noobs like myself, I think it should get a pin!
 
And for those people who are already past the C++/SDL stage, the next step (for serious graphics/game stuff) is learning OpenGL. MAKE SURE YOU'RE TOTALLY GOOD WITH SDL AND C++ FIRST. OpenGL is not easy to learn, and if you're at all unsure about programming in C++ or using SDL, you're not ready for OpenGL yet.

When you are ready, I recommend using NeHe's OpenGL tutorials. They're very good, and are quite comprehensive. My suggestion is to scroll down to the bottom of each tutorial, click the link that says Linux/SDL, and read the tutorial while following along with the code you downloaded in the archive. The code on his site uses the Windows WM APIs, and (at least for me), looks really scary. I find it much easier to follow along with the Linux/SDL version, not to mention that SDL is what you'll be using for managing windows and the like (assuming you learned SDL already). Also, the Linux/SDL code is totally cross-platform, which is nice.

After learning OpenGL "standard", you'll end up needing to learn the difference between it and OpenGL ES 2.0 (if you're going to OGL stuff on the Pandora). That's much further down the line though, and you can also probably get by just using OpenGL ES 1.1 (which is much closer to "standard" OpenGL).

EDIT: It seems like NeHe is making a new set of tutorials (they seem to match up 1:1 with his "old" ones) that use SDL instead of the Windows APIs and make better use of OOP. He's only got 3 up there right now, but they'll take you from setting up an IDE to use OpenGL through making a colored cube.
 
Thank you! Some years ago my dad got me a book on 3D game art (he was a few years too early, however), I just remembered it recently, that's partially how I wound up here.
 
Back
Top