logo

 

     
 
Home
Site Map
Search
 
:: Bitwise Courses ::
 
Bitwise Dusty Archives
 
 
 

rss

 
 

ruby in steel

learn aikido in north devon

Learn Aikido in North Devon

 


Section :: books

- Format For Printing...

Objective-C Book Reviews

For books on Mac/iOS programming
Wednesday 18 January 2012.
 

The principal application programming language both of the Mac and Apple’s various iOS devices is Objective-C. It is not the easiest of languages to learn. A beginner may find its mix of C and Smalltalk-like syntax baffling. Even an experienced programmer is likely to have problems, not only learning the language but also getting to grips with the Xcode development environment. Here I look at four books that might help you get over a few of the barriers…

These are the books…

Objective-C Fundamentals $44.99
by Christopher Fairbairn, Collin Ruffenach, Johannes Fahrenkrug
Manning Publications
ISBN-10: 1935182536
ISBN-13: 978-1935182535

Objective-C Programming: The Big Nerd Ranch Guide $39.99
by Aaron Hillegass
Addison-Wesley
ISBN-10: 0321706285
ISBN-13: 978-0321706287

Cocoa Programming for Mac OS X (4th Edition) $49.99
by Aaron Hillegass, Adam Preble
Addison-Wesley ISBN-10: 0321774086 ISBN-13: 978-0321774088

Advanced Mac OS X Programming: The Big Nerd Ranch Guide $59.99
by Mark Dalrymple
Addison-Wesley
ISBN-10: 0321706250
ISBN-13: 978-0321706256

At first sight, three of these books appear to be aimed at more or less the same type of reader: Objective-C Fundamentals, Objective-C Programming and Cocoa Programming for Mac OS X all seem to offer guidance for the first-time Objective-C programmer.

In fact,Objective-C Fundamentals is specifically targeted at iOS developers. So if you want to write standalone programs to run on your Mac, this is not the book for you. Personally, I feel the authors strive to cover an awful lot of ground for an fairly elementary-level book. As a result the book sometimes seems to rush through important topics. For example, chapter 2 begins by creating a database application before it even gets around to discussing absolute basics of programming such as ‘the importance of descriptive names’. The book has chapters explaining everything from creating objects to memory management and debugging. It uses a ‘rental manager’ application as its core example which may risk losing the reader’s interest unless you happen to have a special interest in real estate.

I personally prefer Objective-C Programming. This doesn’t take a monolithic “let’s build an app” approach. Instead it provides more of a topic-related guide that makes it easier for programmers with differing levels of experience to ‘dip in’ and read only the sections that are of particular interest. It provides a sound reference to the main features of the Objective-C language and the core Cocoa framework classes. Its main limitation, in my view, is that it has little in the way of step-by-step tutorials. If you want a book that guides you through the entire process of designing, coding, debugging and deploying, this is probably not the ideal choice.

Cocoa Programming For Mac OS X is a much more substantial book (almost 500 pages). It’s a bit like the big brother of ‘Objective-C Programming’ and, indeed, the author of that book is also co-author of this one. This book concentrates almost exclusively on Mac application development, with only a small section devoted to iOS. It begins with a simple, but useful, tutorial on using Xcode and moves rapidly on to describing the nitty-gritty details of Objective-C and Cocoa. Memory management, debugging, event-handling and multi-threading: these are the types of topics dealt with in reasonable depth. I’d say this is a pretty good choice for a competent programmer moving from some other language such as C#, C++ or Java.

Advanced Mac OS X Programing is another big book (over 600 pages). This one, as the name suggests, is definitely not aimed at the newcomer to Objective-C. It deals principally with the finer details of development such as performance tuning, multi-threading, IO, DTrace and memory management. If you are already a competent Objective-C developer, you should probably think of adding this book to your library. An excellent resource.

In Summary

If you are an experienced programmer moving to Xcode from another IDE and to Objective-C from another language, some of these books are not as useful as they might be. For example, try searching for ‘new’ or ‘constructor’ in the indexes. ‘Objective-C Fundamentals’, ‘Objective-C Programming’ and ‘Advanced Mac OS X Programming’ have no index entries on either of these terms. ‘Cocoa Programming’ has an entry for ‘new’ but not for ‘constructor’. If you happen to chance upon the index entries on ‘init’ (in all but ‘Advanced Mac OS X’) you might find what you are looking for. But finding the index entry for ‘init’ rather than ‘constructor’ assumes that you are already familiar with the Objective-C way of doing things which, if you are coming to it for the first time, you won’t be.

‘Advanced Mac OS X’ provides what its name suggests – a fairly in-depth guide to programming the Mac. It assumes that you already know your way around Xcode and need to get to grips with some of the more advanced features of Objective-C. In my view, ‘Objective-C Fundamentals’ is incorrectly named. It is a book that is specifically aimed at teaching the basics of iOS programming. If that’s what you need it does a pretty decent job but I don’t think it’s suitable for a complete novice. ‘Objective-C Programing’ covers both iOS and OS X. I don’t think it’s ideal as a first book for a new programmer but it’s a good choice for someone with at least elementary programming skills who’s already got past the “Hello world” stage in Xcode.

For a programmer experienced in other languages and IDEs but new to Objective-C and Xcode, ‘Cocoa Programming For Mac OS X’ would be my recommendation. It’s a solid book that fairly quickly takes you from the fundamentals to more advanced programming.

AddThis Social Bookmark Button

Forum

  • Objective-C Book Reviews
    1 February 2012, by Brad

    Huw-

    1)What is your opinion of Obj-C as a dedicated Smalltalk programmer?

    2)Do you think the Smalltalk side of Obj-C integrates well with the C side of Obj-C?

    3)How would you compare Obj-C with C#, Delphi, C++?

    4)Do you think it is a mistake for Apple to force such an obscure language as the only dev language for their platforms?

    5)How can there be so many devs making Mac/iPhone apps when you are forced to use such an obscure language that hardly anyone knows?

    6)Do you think a lot of Apple devs just avoid the Smalltalk side of Obj-C and only use the C side as it is a strict subset of C and already a familiar language?

    7)Is it true that you only have to use Obj-C for Cocoa interface programming and you can use whatever other language you want for the rest of your app?

    8)Is it true the Smalltalk side of Obj-C is sort of difficult in the same way C is in that you have to do mental bookkeeping to prevent memory errors?

    9)Will you ever write a tutorial or beginners book about Obj-C programming?

    You should write an article just about the Obj-C language itself as I have yet to have anyone even give me a comprehensive description of the language

    • Objective-C Book Reviews
      1 February 2012, by Huw Collingbourne

      I won’t go point by point through your questions but I’ll offer my general observations. I think Objective-C was a clever idea at the time of its creation and it implements has a nicer version of OOP than, for example, C++.

      However, the Smalltalk-like message-passing syntax makes a poor fit with C and I often feel I have to flip a mental switch to think C-like one moment and Smalltalk-like the next. People who’ve never used Smalltalk must find this even harder.

      I think Objective-C would be a very, very difficult language for a novice programmer and I’m surprised that a cuddly-friendly system like the Mac has such a difficult language as its default. Watch out for MacRuby, though. I’ve been using the beta and it integrates pretty well with Cocoa. It remains to be seen what longterm impression it might make for Mac programmers. However, I think many people will find a "visual" Ruby to be an attractive alternative to Objective-C.

      As to question 9) the answer is "maybe". I think it’s highly likely I’ll at least write some tutorials at some point. Personally, the biggest barrier I’ve found to learning Objective-C has been the environment (Xcode). This works in a way that is completely alien to me. In fact, without the help of some books I’m not sure I would ever have succeeded in writing a "Hello world" program. ;-) That combined with the language must be a very big barrier to programmers moving from Windows to Mac.


Home