PDA

View Full Version : Starting Programming


Nick
2004.07.14, 02:24 AM
I have built up a small bookshelf of programming book so far. I have Teach Yourself C++ in 24 Hours, Teach Yourself Game Programming in 24 Hours, Tricks of the Mac Game Programming Gurus, Mac Game Programming, and Mac Programming For Dummies. So far I've learned a lot of useful information but none of it really is helping me. The first book is just C++, not really about Macs, games, or anything beyond DOS, really. The second book is all 2D games on Windows. The third book is 9 years old so really is outdated in all respects other than discussion on AI and game design. The fourth book was written for OS 9 so the program used is different and the commands don't seem to work. I've tried to convert the script with docs and even the author's help but to no avail. The last book I just got was all written intended for use with CodeWarrior and OS 9. It is also not specifically about games but that's ok. The book did include a free version of CodeWarrior (trial) but I don't really like it. So far I've managed to keep spending down to about $80 for all the books but the other books I've seen really will dent my wallet.

Long post short, how did all of you (who actually can make a program or game) learn to program? Such answers could include "... this site..." or "...this book..." or even "...my buddy down the road...". I don't actually need to use you're learning material but am more just curious due to my failure to learn it with the internet, this great site, and my 5 books.

Any response is appreciated as always.

Josh
2004.07.14, 02:46 AM
Reading books about C/C++, posting questions on forums, trial and error, reading various online tutorials.

sealfin
2004.07.14, 05:04 AM
Reading books about Pascal/C/C++/Java, posting lots and lots of questions on various forums, writing lots and lots 'thought-experiment' code on how a game mechanic might possibly be implemented (to this date, I've never read (or rather, directly used anything I've skim-read) any online tutorials on games, only general coding/API tutorials), lots and lots of time...

Najdorf
2004.07.14, 09:39 AM
At what point are you really in the learning process? I mean, do you manage to make something move on the screen following the arrow keys? If you did not get to that yet... well you could try with one of the basics to have some fun or SDL+Opengl to get things going fast. Once you get the grip of a graphic engine/library, then you can start to learn programming, otherwise you'll just get bored.

Thats it: first goes the graphics, then comes the programming

(this actually supposes that you have a grasp of the basics of programming, otherwise you may not understand the graphics library)

ThemsAllTook
2004.07.14, 11:58 AM
I learned C by reading this book (http://www.amazon.com/exec/obidos/tg/detail/-/0131103628/qid=1087062187/sr=8-1/ref=sr_8_xs_ap_i1_xgl14/102-0951859-6709720?v=glance&s=books&n=507846). I've been doing some amount of programming since I was about 5 years old (no joke), but I didn't really seriously get into it until about 2 years ago. I played around with pure C on Linux for a week or two, and wrote a couple of relatively simple programs.

When I was ready to move on to developing on the Macintosh, I went to developer.apple.com and downloaded a bunch of PDFs of their old Inside Macintosh documentation:

http://developer.apple.com/documentation/macos8/mac8.html

I believe "Macintosh Toolbox Essentials" is the first one I read. This is pre-Carbon documentation, but it's still 90% relevant. So, I started writing a few simple programs, trying to get a grasp of the toolbox. It took me probably 2 or 3 weeks to start feeling comfortable with it.

A couple of months later, I entered uDevGame 2003. The iDevGames community was wonderful... Whenever I needed support, I could just go to the iDevGames chat room and ask. I learned LOTS about programming, and Water Tower became my first finished game ever.

After uDevGame ended, I started learning OpenGL with this book (http://www.amazon.com/exec/obidos/tg/detail/-/0321173481/qid=1085976656/sr=8-1/ref=sr_8_xs_ap_i1_xgl14/002-6972357-0732025?v=glance&s=books&n=507846). I entered the Life challenge (http://www.createmacgames.org/index.php?option=content&task=view&id=12&Itemid=28) at CreateMacGames.org, and used OpenGL for my entry. It was functional, but I didn't know enough about OpenGL at that point to really do things the right way.

About a week after that ended, I entered iDevGames' 21 days later contest, along with Will (Akisha on the forums), with a fully 3-dimensional game. Writing that taught me about 3D physics, modeling, trigonometry, vector math, quaternions, and all manner of other wonderful things.

So anyway... My general strategy is to read up on what I need to get past any immediate obstacles, and see how far I can push the limits of my skill. When I hit a barrier, back to reading.

Alex Diener

Nick
2004.07.14, 03:26 PM
How many of you used Apple's online documentation page to learn? I think it would be useful but I don't know which documents to read.

Malarkey
2004.07.14, 04:09 PM
Long post short, how did all of you (who actually can make a program or game) learn to program? Such answers could include "... this site..." or "...this book..." or even "...my buddy down the road...". I don't actually need to use you're learning material but am more just curious due to my failure to learn it with the internet, this great site, and my 5 books.

Any response is appreciated as always.

I graudated with a comp sci degree at UCI when they were still using C++ to teach (though they did start to lean towards Java in my last year). While in college, I also started an intern job at a local development house where I had to work with C++ all day. And I'm still working with C++ all day.

Yeah, so for me, I pretty much learned by being immersed into the language.

Josh
2004.07.14, 04:56 PM
How many of you used Apple's online documentation page to learn? I think it would be useful but I don't know which documents to read.
The Apple docs seem to be descent reference, but I doubt they are very good teaching tools.

PowerMacX
2004.07.17, 01:44 PM
Apple documentation is OK, but Apple's example code is a mixed bag: there are some beautiful, simple apps that get to the point, and there are some with... gotos :mad:

SOUR-Monkey
2004.07.17, 11:37 PM
I learnt by mainly just by learning a little, then try using this new knowledge somewhere. For example, I read about structures, so to reinforce my knowledge I wrote a simple database using linked-list. It worked really well for me.

And as for Apple's docs, well, they are a pretty good reference (although I've noticed they leave out some pretty essential things sometimes) but they're not something I would try and learn from.

Duane
2004.07.19, 09:29 PM
Why get the huge books when you can get the Blue/Red book? I haven't seen it in Print foor a while, though... to small to really cost much... :(

SOUR-Monkey
2004.07.20, 12:58 AM
The blue and red books are not cheap. About $100 each for me, which is far too much.

I have found a number of free PDFs online that do the same thing as the red book. On opengl.org you can download the red book for version 1.1, and there are plenty of other books available online as well, although all that I've found are for old versions.

Is there any real problem with learning from an old version? I can't see any, other than that some of the functions used in it may have been deprecated in favour of more efficient ones in later versions.

ibullard
2004.07.29, 01:52 PM
I learned BASIC first on a Timex Sinclair 2000/Commodore 64, then Pascal on a IBM PC in High School. I taught myself C in college at first then changed my major to Comp. Sci. and learned C++, Prolog, Ada, etc.

I find the best way to learn is to find a program that does what you want and look at the code. Modify it, play with it, just mess around in general to get to know how it works. Then write you own version of it from scratch. For me, programming is a skill that need to be learned with a mentor. Lacking a mentor you need a reference to what you should be doing.

Also, try out some other languages (Python, Prolog, Java, Ruby, etc). They usually have bindings to APIs you want to use and sample code. When you go back to C/C++ after using a higher level language you end up seeing things in a different way that may help you. You may find a language that you like better and can be more productive in.

arekkusu
2004.07.29, 06:38 PM
Apple documentation is OK, but Apple's example code is a mixed bag: there are some beautiful, simple apps that get to the point, and there are some with... gotos :mad:

Yes, they do:

ghostwheel:/Developer/Examples/CoreAudio arekkusu$ grep -r goto * | wc
96 474 6457


But assembly programmers don't fear goto.

Fenris
2004.07.29, 07:28 PM
The only way to learn is to do. There is no point in reading when you don't know what you're looking for. That said, tutorials can be the best way to learn, but only if you actually do the coding. If your fingers aren't hitting the keyboard, you're not learning. (At least not when you're beginning.)

sam
2004.07.29, 09:57 PM
I used cprogramming.com to learn c last year. It's limited, but teaches syntax.

http://www.mevis.de/~uwe/opengl/opengl.html <--This is an excellent reference. It's taken from the Blue Book so it's good, but maybe a little old.

JustinFic
2004.07.29, 11:04 PM
I started with Hypercard in 5th grade. Just dove into it. I got a book on Pascal too called "Just Enough Pascal" but at the time I found Hypercard to be much easier and I could do more with it at the basic level I was programming at.

After 4 years with that I got a book on C. From there it was books, books, books. Somewhere in there I took high school CS classes that taught me nothing, and 4 years of college.

Once I knew how to write code I focused on web resources, like this site, Gamasutra (http://www.gamasutra.com), GameDev (http://www.gamedev.net), and NeHe (http://nehe.gamedev.net), to name a few.

After that, the only way to learn was to actually make something. You can only study a practice for so long without having to go and practice it.

GoodDoug
2004.08.02, 03:44 PM
One good way to learn is to give yourself easy assignments. One thing I used to do was look at a tutorial, figure out what they did. And then try to find a way to change the tutorial into an assignment. For example, way back when (before many of you were born) I found a tuturiall on making a text based craps game in BASIC. I went through that, and then gave myself the assignment of creating a text based roulette game. It forced me to internalize the concepts learned from the tutorial.

Another key is being able to create reasonable assignments. When learning programming, doing a sprite engine is not a reasonable request... animating a square in a window is. Keep your assignments simple and you won't get as easily frustrated.

Use the tools you already have, and come up with simple doable assignments. They may seem trivial, but they'll teach you loads.