Several months ago the good folks at Addison Wesley Publishing sent me a review copy of Stephen G. Kochan’s “Programming in Objective-C 2.0, A complete introduction to the Objective-C language for Mac OS X and iPhone development, 2nd Ed.“. It was my intention to read and review the book in a few weeks after its arrival.
I’m not a programmer. The last computer language I studied was COBOL, back in 1976 while in training for my intelligence analysis position in the U.S. Army Security Agency. I don’t write programs or compile kernals. I build computers, I’m a hardware guy. Software is another world. I know enough about both Windows and Linux to install and fix errors, but I’m not a debugger.
So for several months I’ve been trying to understand this book well enough to write an informative review. I really need to complete this task as I’ve promised to send the book to a friend of mine who can actually make sense of it and use it. I’d like to do that before the 3rd edition hits the shelves.
So that you can get an idea of the value of this book, an idea that’s beyond my ability to convey, I’m going to cheat. I’m going to quote from three reviews of the book on Amazon posted by people who exhibit an understanding of the topic and an appreciation for this edition.
E.Kim says:
This book is both comprehensive and easy to understand. The sequence of chapters chosen to be read chronologically is well thought out (e.g. having the reader use static data types before introducing the generic id type, or having the reader declare and implement accessor methods before introducing the property and synthesize directives). The end of chapter exercises are also short (i.e. quick to complete) but also thoughtfully designed.
The author chose to make this book serve not only as a reference, but as a tutorial. In other words, a bit like the “… for Dummies” series in its hand-holding (i.e. tutorial) style. However, this book is certainly not for “dummies” as the author does not assume the reader to be slow or requiring interjections of humor or casualness. Other books will have authors write things like “Now grab a slice of pizza before we hit this really hard subject!”, but this author thankfully spares the reader of this. Kochan is concise and direct. There are very few wasted or unnecessary sentences.
Kochan does not assume prior Objective-C, Cocoa framework, or X-code knowledge. However, if you have experience with just about any procedural or object-oriented language, you will have a much easier time with learning any new language, including Objective-C. If you do not have experience with ANY other language, then you will still have a difficult time with learning all of the Objective-C language as some topics just by their very nature are difficult to grasp immediately without practical experience.
Although there is a chapter each on the Cocoa framework and iPhone development, this book is focused on the Objective-C language and Apple’s Foundation framework. Other resources will have to be utilized to learn Cocoa or Cocoa Touch.
BOOK’S TABLE OF CONTENTS:
1. Introduction
2. Programming in Objective-C
3. Classes, Objects, and methods
4. Data Types and Expressions
5. Program Looping
6. Making Decisions
7. More on Classes
8. Inheritance
9. Polymorphism, Dynamic Typing, and Dynamic Binding
10. More on variables and Data Types
11. Categories and Protocols
12. The Preprocessor
13. Underlying C Language Features
14. Introduction to the Foundation Framework Foundation Documentation
15. Numbers, Strings, and Collections
16. Working with Files
17. Memory Management
18. Copying Objects
19. Archiving
20. Introduction to Cocoa Framework Layers
21. Writing iPhone Applications
22. Appendix A. Glossary
23. Appendix B. Objective-C 2.0 Language Summary
24. Appendix C. Address Book Source Code
25. Appendix D. Resources
In summary, this book will make learning Objective-C about as easy as it can be since it starts with the assumption that the reader has no prior programming knowledge.
Jack (nope, not this Jack) posted:
I had heard about Kochan’s reputation for writing clear and concise books, so I was anxiously awaiting the release of the second edition of what has been recommended to me as THE book to learn Objective-C from. I was certainly not disappointed. I was able to work through this book in a week’s time and even write my first iPhone application, just from the material presented in this text.
Kochan methodically teaches the mechanics of the language, followed by the Foundation Framework, and then the iPhone SDK. In the last chapter on the iPhone, Kochan shows how to use two of the classes taught in the book (a calculator class and a fraction class) to develop a fraction calculator that runs on the iPhone. I was able to get the program running on the iPhone simulator that comes with the iPhone SDK. You should note that there was a mistake in listing some of the code for this example. I contacted the author and he was aware of the error. He mentioned that all the code, the answers to the exercises, and the errata will be posted shortly. It’s helpful to note that Kochan is active in MacRumors forums and seems to respond quickly to questions posted there as well as to the several emails I sent him.
John McSwain adds:
I am a web designer and developer and I’ve programmed in a lot of languages (i.e. HTML, javascript, actionscript, visual basic, etc.). I wanted to learn Objective-C as the quickly as I could. I quickly found out that not having experience in programming in C (the predecessor to Objective-C) made it hard to understand the reasoning behind the code syntax and finding resources that didn’t assume I knew C was almost impossible…
After going through the first three chapters of this book in less than an hour, my confidence in the language has increased exponentially. The book is roughly 624 pages, but I feel like I could code the samples and finish the book in just a few days…
The book is organized into four main sections:
I: The Objective-C 2.0 Language
II: The Foundation Framework
III: Cocoa and the iPhone SDK
IV: Appendixes
The separation of these main topics, Objective-C Language features and the Foundation Framework for example, almost guarantees that there won’t be much confusion if you are learning the language for the first time and that there will be a distinction between the topics and concepts for each section.
Kochan does a good job of creating a deep understanding of the material instead of simply saying `just write the code and we’ll explain later’. For example, each chapter provides instructions on how to fulfill basic concepts using Objective-C such as writing classes, inheritance, loops, operators, etc. At the end of each chapter, there are `Exercises’ which may range anywhere from 5-9, which more or less tests the reader’s comprehension on the material that was just covered.
These and 47 other reviews can be found here. You should read them to gain a better understanding of what this book offers than what I can provide.
As a frequent reviewer (of books I can fathom) I can tell you that for its price, Programming in Objective-C 2.0 is very comprehensive and easy to read. It was published on decent stock, though for a book like this I would have preferred to see them use a technique that allows the book to lie flat when open, which makes following along with tutorials easier. This edition has reasonable margins on each page, handy for making notes.
Based on knowledgeable reviews, I can enthusiastically recommend this book for those who are or plan to become developers for the iPhone or Macintosh platform, though it can be implimented on any system that supports the gcc compiler. You should have a a familiarity with programming languages in general and an understanding of object-oriented programming languages in particular. If you own an iPhone and have an itch to develop your own apps for it, buy and read this book. Perhaps someday you can explain it to me.