Before going to college I still wasn't sure what to do as a living, so I convinced my parents and used my allowance to buy Metrowerks CodeWarrior for Macintosh, Educational Edition. It came with a C compiler, as I was trying to push myself to learn C on my own, and if I liked it then maybe make a living out of programming. What was surprising was that I was expecting as a second step to buy a book for learning C, but the documentation CD came with a PDF book, for free, called "Learn C on the Macintosh" by Dave Mark on Addison-Wesley Publishing. While it wasn't necessarily a great book and not necessarily programming of the Macintosh per se, it was a good introduction to the language. I used that to learn C on my own. The book was big enough so that I could start, for exercise, coding my own C library for data structures, and eventually I wanted to write some small "card-playing" game.
The best way for me to learn was really to use the C debugger (the CodeWarrior C debugger), because it lets me catch the bugs and null pointer exceptions before they actually crash the machine. That's because back then on the Macintosh, if you had a null pointer or anything that's "bad memory" it would crash the entire machine. And since the compiler was running from the CD-ROM drive, rebooting the machine and running the compiler again and running the program again would typically take about 5 minutes. So that's a very good way of learning how to not have null pointers in your code.
From there I was ready to embark on learning C++ with an additional free book as a PDF on the documentation CD.
Published on August 25, 2009 at 11:41 EDT
Older post: benad.me released!
Newer post: APJ 3: C++ (transcription)