This is the second installment of my journey to learn Cocoa programming on the Mac under OS X. This month Im going to share my experience in trying to get a simple Cocoa program to run, using three different books as learning tools. The first book I started with was Learning Cocoa with Objective-C, 2nd Edition, by James Duncan Davidson, published by OReilly & Associates (ISBN: 0-596-00301-3). This book is designed to be an introduction to Cocoa, and reminds me a lot of my college programming textbooks. It starts off by getting your first command line and GUI Cocoa programs to run (an important step) and then goes on to explain object-oriented programming (inheritance, methods, etc). I was actually writing working code in less than an hour with the book. This is the first book Ill finish, going through all of the examples, before moving onto finish the others. The second book, Cocoa Programming for Mac OS X, by Aaron Hillegass, is published by Addison Wesley (ISBN: 0-201-72683-1). Aaron is also founder of the Big Nerd Ranch, one of the top Cocoa training schools in the country. This was the first book I picked up, due to the recommendations online. Its not designed for the true beginner, its an introduction to Mac programming for Java or C++ programmers. Being so rusty at serious programming, I wound up skimming the first 100 pages of the book, typing in a few examples, absorbing a lot, but I need more background on object-oriented programming and Cocoa before I dive into this book. The third book I selected to learn Cocoa is Cocoa Recipes for Mac OS X, by Bill Cheeseman, published by Peachpit Press (ISBN: 0-201-87801-1). The thickest of the three, with more than 700 pages, it focuses on building a program that demonstrates many of the features of Cocoa. Bill started archiving and organizing one of the largest Cocoa repositories on the Web at http://www.stepwise.com/StartingPoint/Cocoa.html. I like the book, but the commitment of working with one application for the entire book makes this my last choice, almost a finishing school for what I learn in the other books and online. Skimming through the book, I was able to find examples of many things Id like to be able to put into my programs, so Im sure Ill find this book useful in the future. Books are a personal choice, so dont rush out and buy one based on my recommendation. I suggest you go to your local bookstore, pick up several that seem interesting, find a comfy chair, and select the one (or more) that you find useful. Apple, in addition to providing the very robust Xcode development environment, also provides a lot of documentation in the/developer/documentation/cocoa directory on your hard disk. There are 62 documents in my directory, covering everything from the Objective C language to programming Web services. Several of the books recommend reading Apples Object-Oriented Programming and the Objective-C Language document before starting the examples in the book as a good background. Since Objective C is very closely based on the C language, I would highly recommend the book I used to learn C at my first job and in school, The C Programming Language, (2nd Edition), by Brian W. Kernighan and Dennis Ritchie. A no-nonsense guide to programming, its a fast way to learn C. You can use Xcode to build all of the examples in the book, so you dont need to buy a special compiler to learn C. On the Web, I discovered a whole
series of programming Cocoa articles on OReillys
MacDevCenter.com (http://www.macdevcenter.com/pub/ct/37), including
an excellent beginner series for learning how to program in Cocoa.
Other great starting points include Ranchero Software (http://www.ranchero.com/cocoa/), and also
CocoaDevCentral (http://www.cocoadevcentral.com/). So far, Im pleased with my progress. I wont lie to you and say its easy to program. Its a lot of work and you really have to be interested in learning a lot of new concepts. However, the reward of making a program that actually works and might be useful to others is worth it. Sorry I missed the January meeting; I got stuck in the snow storm, commuting back from the city. Ill have free samples of the MacDeveloper Journal CD at the February meeting if you are interested. |
|
|