All posts for the month August, 2009

Learning C programming with Cocoa

After almost 12 years of C  programming under my belt I often find myself answering questions from people asking me how to get started.  Most will ask what I think is the one single book to read when learning how to program in C or do I need to know C before I learn other C languages such as Objective C and C++.  There are many avenues to learning how to write in C which can often leave a new comer feeling overwhelmed. However, I think there is one approach that works well and provides a step wise approach to learning C.  Oddly enough, it does not envolve learning traditional C directly.  Learn to program in Apple’s Cocoa language and ease into traditional C.

For the most part, there is not one book.  Usually it takes 3 or 4 really good books to get a handle on C programming. Each book provides its own unique aspects to teaching, skipping some topics while covering other in depth.  One of the things that I like about using Cocoa as a starting point is instant gradification.  Using Cocoa(R) Programming for Mac(R) OS X (3rd Edition) as a learning tool can provide the new comer with a good sense of how programming works.

Cocoa is apple’s native way to program for the Mac.  Cocoa utilizes Objective-C as its underlying language.  Objective C is a Object oriented sub set of C much like C++.

While Cocoa is a great language it is almost impossible to be really good at it or any C dialect without knowing C.  So Why learn Cocoa First?  In short Arron Hillagas’s Cocoa Programming on Mac OS X

One of the things you will notice is that there are not a lot of books on Cocoa. However, the completeness of Cocoa(R) Programming for Mac(R) OS X (3rd Edition) and the style of Cocoa makes it easy to learn and deduce.  The Cocoa language is so well done syntactically it is very conducive to teaching and Aaron’s book is it’s perfect complement. In my opinion there is not one single book on any language that is as complete from beginner to intermediate as this book.  When you read the text and follow the examples to the end it will leave you comfortable with the language and wanting to learn more into the intermediate level.  With all that said, there are a few must have books that build on the knowledge learned from Aaron’s book.

If you are interested in learning C through Cocoa here is a list of books I would recommend (In order of learning level). Go here for an easy link to each.

  • Cocoa(R) Programming for Mac(R) OS X (3rd Edition)
  • Learn Cocoa on the Mac (Learn Series)
  • Programming in Objective-C 2.0 (2nd Edition) (Developer’s Library)
  • Learn C on the Mac (Learn Series)
  • Cocoa Programming