Slashdot Mirror


Cocoa Programming for Mac OS X

Michael Simmons contributed this review of what he claims is the best of the very few books out there for folks who want to learn Cocoa programming. The field is so small, in fact, that he can give a nutshell review along the way of the only other one he's encountered, O'Reilly's Learning Cocoa. Update: 12/13 15:45 GMT by T : Please note: Simmons is thanked in the acknowledgements of Hillegass' book. He explains: "I went to the Big Nerd Ranch, where the author teaches an amazing Cocoa course. While there, I received a pre-release copy of the book (it's the coursebook, actually.) I had found a bunch of errors and typos, and helped Aaron correct those errors and inconsistencies, so I'm guessing he is thanking me for my contributions to quality." Just to clear that up! Cocoa Programming for Mac OS X author Aaron Hillegass pages 416 publisher Addison-Wesley rating 8.5 reviewer Michael Simmons ISBN 0201726831 summary Learn to program OS X applications

Intro to Cocoa
If you're interested in programming for Mac OS X, you've definitely heard of Cocoa by now. Cocoa is the name of the library of frameworks that gives you the ability to write advanced applications with ease. The Cocoa frameworks enable you to perform tasks that used to take a decent amount of code and implement it in a very straightforward manner. The hardest thing about learning Cocoa is that because it's so simple, it takes some getting used to.

You can write Cocoa applications with either Objective-C or Java. If you aren't familiar with Objective-C, it's an extension to the C language that makes it object-oriented. I'm not sure why Apple decided to offer Java support for Cocoa, since almost every source of information on the Internet and all Cocoa resources seem to only refer to Objective-C. Since Java-written Cocoa applications will not run on any platform other than OS X, it was probably done as a marketing "thing" -- Apple is giving Java programmers the ability to program Cocoa applications, opening up the potential for more Cocoa engineers.

Until today, there was only one book if you wanted to learn Cocoa. That book is Learning Cocoa , which is published by O'Reilly and written by Apple Computer, Inc. The new kid on the block is Cocoa Programming for OS X, which is published by Addison-Wesley and written by Aaron Hillegass of the Big Nerd Ranch. With two books out, Cocoa programmers now have an actual choice of which book to buy. Which brings us to the point of this review -- which book is better?

Is it really O'Reilly?
Since Learning Cocoa was out first, I'll start with my analysis of it first. When I heard that O'Reilly was going to start publishing OS X programming books, I was stoked. O'Reilly books have historically been amazing -- very complete and straightforward sources that any programmer would be proud to have in his or her arsenal of knowledge. Unfortunately, Learning Cocoa falls short of the O'Reilly tradition, and makes me wonder if O'Reilly actually supervised the printing of this book.

There are some good points about the book. It was the first and only Cocoa book, so when I got my copy back in May, I was looking forward to learning the language. It does provide some good examples on how to write Cocoa applications, which allows one to dive straight into Cocoa programming. The introduction to Cocoa is really good -- it gives a very in-depth description of Object-Oriented and Cocoa program design, which I really like. Additionally, it gives a very good background to the concepts and techniques of using Cocoa.

However, there is a real problem with this book. This book reads more like it was meant to be an internal reference at Apple, rather than a book for the beginner. Another problem is that the layout and order of the content is confusing. Unlike past O'Reilly books and other quality programming books, it seems like this time they took a bunch of internal technical documents on Cocoa, and sent them to the binding machines without further editing. That the book credits "Apple Computer, Inc." as the author provides good evidence for my theory.

The heart of the problem is that the reader has to really dig and explore through this book to find that info that he or she wants. When learning a new language or programming concept, a book should be easy to follow and it should allow the reader to focus on learning the actual concepts, and not having to figure out the flow of the book.

Aaron hits a home run
The "flow" statement is a perfect segue into my analysis of Cocoa Programming For Mac OS X. Right away, I could tell that I was going to like this book. The author, Aaron Hillegass, wrote this book like he is a friend speaking directly to the reader -- he takes you through each concept like he is right there with you. This book teaches you Cocoa by specifically having you write applications, and in each new chapter, you add new features. As you add each new feature, you'll learn an important Cocoa concept.

O'Reilly's book also has the reader write applications and add features, one by one, but it does so in a very sporadic way. I was never really sure what the purpose of adding a certain method was, whereas with Aaron's book, each chapter is focused on an ordered and very specific concept, making it very clear what I was about to learn, and why.

Another part of this book that I really appreciate is the chapter on Objective-C. In just one chapter, I understood Objective-C. You must already know C and at least one object-oriented language (like C++ or Java,) but after reading this chapter, you will be able to write Cocoa applications in Objective-C.

This book comes with an online counterpart, powered by Techstra. Techstra is an online engine that allows you to enter any page of the book and get "extras." The extras include examples not in the book, solutions, errata, and even input from readers. It's very cool and very helpful.

A final and very strong point of Aaron's book is that it reflects the latest update of the Mac OS X development tools, Project Builder and Interface Builder. Apple just updated the development tools to version 10.1, substantially changing the UI and functionality, and the latest version is reflected in Aaron's book.

Conclusion
It's clear to see which book I'm giving the nod to. I know it appears like I'm being biased towards Cocoa Programming For OS X, but if can get to your local bookstore and actually compare the two books side by side, you'll see why I'm so enthusiastic about Aaron's book.

I think having both books is a good choice, as the O'Reilly book does offer very in-depth information, which is useful once you learn Cocoa using Aaron's book. If O'Reilly changed the title to After Learning Cocoa, I think my perception of the book would be different.

Cocoa allows programmers to write powerful applications in a very short amount of time. I am amazed at the power and simplicity of the Cocoa frameworks, and can't wait to see what myself and other programmers end up creating in the future. I'm sure other books will come out in the future, but for now all we have is two. The one I'd recommend is Cocoa Programming for Mac OS X, but you already knew that. :)

You can purchase this book at Fatbrain. Want to see your own review here? Read the book review guidelines first :)

12 of 300 comments (clear)

  1. Mmm by Anonymous Coward · · Score: -1, Offtopic

    First post to say "Mmmmmmmm ... cocoa"

  2. Cocoa or Chocolate: Not OT by zpengo · · Score: -1, Offtopic

    (This is on topic because it's nearing the Xmas season...) Is it "hot cocoa" or "hot chocolate"? What's the difference?

    --


    Got Rhinos?
  3. Brown colored? by Anonymous Coward · · Score: -1, Offtopic

    Will I have to buy several add-ons to change the colors in the IDE? And will they be translucent?

  4. the TRUTH about editors and modding by Anonymous Coward · · Score: -1, Offtopic

    they finally have admitted it, the mod system here is now worthless. get modded up but the people who run this site don't like it , too bad. hyprocricy in action here folks...here's the admittal, right here!

  5. Using Apple? by Anonymous Coward · · Score: -1, Offtopic

    Weeelllll -

    my cunt is a'drippin',
    your lips are a'sippin',
    my ass is a'crappin',
    your mouth is a'lappin'

    all that comes out of an oracifce
    you eat for a main course-ifice
    poop and pee, all a'yummy
    Sitting proud inside your tummy!

    Thank you, thank you very much. I'll be here all week. Tip your waitstaff.

  6. The recipie by wiredog · · Score: 1, Offtopic

    Hot cocoa is made with cocoa powder (2 tbs each cocoa and sugar per 8 oz milk). Hot chocolate is made by melting chocolate in milk. (IIRC)

  7. Re:Mmm (In Korean) by Anonymous Coward · · Score: -1, Offtopic

    Shit, I just tried to post a witty reparte in Japanese and the FUCKING lameness filter prevented me; said I'm using too many caps. (Obviously Slashdot is fucking USELESS when it comes to UNICODE. Not that I'm surprised, knowing the quality of the so-called programming talent behind this site.)

  8. Michael Simmons by Anonymous Coward · · Score: -1, Offtopic

    is a fucking CENSOR.

  9. Better books by Anonymous Coward · · Score: -1, Offtopic

    Here is my ass
    Which you may kiss.
    Take time and aim well
    You don't want to miss.

    For if you aim low
    And your lips they do fall
    Then you will find
    You'll be sucking my balls.

    If you aim high
    Despite your true heart
    Sucks to be you
    Now you're eating my fart.

    Thank, you're too kind. I'll be in Vegas next week. Please, remember you waitstaff.

  10. coco? by Heem · · Score: 1, Offtopic

    Ahh my first computer. The COCO. 16k of ram, cassette player for storing programs, 300 baud acoustic coupler. Ahh yes. Oh wait, COCOA - nevermind.

    --
    Don't Tread on Me
  11. (S core: 1, Troll) ???! by Anonymous Coward · · Score: -1, Offtopic

    I think Mojo Nixon would approve.
    Emperor Norton would probably be embarrassed such adulation, even for such a great man as himself.

    Norton Is Everywhere

    When I look out into your eyes out there,
    When I look out into your faces,
    You know what I see?
    I see a little bit of Emperor Joshua Norton
    In each and every one of you out there.

    Lemme tell ya...
    Weeeeeeeeeellllllll...

    Norton is everywhere
    Norton is in everything
    Norton is in everybody
    Norton is still the king

    Man o man
    What I want you to see
    Is that the big N's
    Inside of you and me

    Emperor Norton is everywhere, man!
    He's in everything.
    He's in everybody...

    Emperor Norton is in your jeans.
    He's in your cheeseburgers
    Norton is in Nutty Buddies!
    Norton is in your mom!

    He's in everybody.
    He's in the young, the old,
    the fat, the skinny,
    the white, the black
    the brown and the blue
    people got Emperor Norton in 'em too

    Emperor Norton is in everybody out there.
    Everybody's got Emperor Norton in them!
    Everybody except one person that is...
    Yeah, one person!
    The evil opposite of Norton.
    The Anti-Norton

    Anti-Norton got no Emperor Norton in 'em,
    lemme tell ya.

    Michael J. Fox has no Emperor Norton in him.

    And Emperor Norton is in Joan Rivers
    but he's trying to get out, man!
    He's trying to get out!
    Listen up Joanie Baby!

    Norton is everywhere
    Norton is in everything
    Norton is in everybody
    Norton is still the king

    Man o man
    What I want you to see
    Is that the big N's
    Inside of you and me

    Man, there's a lot of unexplained phenomenon
    out there in the world.
    Lot of things people say
    What the heck's going on?

    Let me tell ya!

    Who built the pyramids?
    Norton!
    Who built Stonehenge?
    Norton!

    Yeah, man you see guys
    walking down the street
    pushing shopping carts
    and you think they're talking to allah,
    they're talking to themself.
    Man, no they're talking to Emperor Norton!
    Norton! Norton!

    You know whats going on in that Bermuda Triangle?
    Down in the Bermuda Triangle
    Norton needs boats.
    Norton needs boats.
    Norton Norton Norton
    Norton Norton Norton
    Norton needs boats.

    Aahh! The Sailing Norton!
    Captain Norton!
    Commodore Norton it is.

    Yeah man, you know people from outer space,
    people from outer space they come up to me.
    They don't look like Doctor Spock.
    They don't look like Klingons,
    all that Star Trek jive.

    They look like Emperor Norton.
    Norton!
    Everybody in outer space looks like Emperor Norton.
    Cause Emperor Norton is a perfect being.
    We are all moving in perfect peace and harmony towards Nortonness

    Soon all will become Emperor Norton.
    Everything everywhere will be Emperor Norton.
    Why do they call it evolution anyway?
    It's really Nortonlution!
    Nortonlution!

    Norton is everywhere
    Norton is in everything
    Norton is in everybody
    Norton is still the king

    Man o man
    What I want you to see
    Is that the big N's
    Inside of you and me

    That's right ladies and gentlemen,
    The time has come!
    Time has come to talk
    To that little bit of Emperor Norton inside of you.

    Talk to it!
    Call it up!
    Say "Emperor Norton, heal me!"
    "Save me, Emperor Norton!"
    "Make me be born again
    in the perfect Norton light"

    That's right!
    You've got that Norton inside of ya
    and he's talkin to ya
    He says he wants you to sing!
    Everybody's got to sing like the king!

    Like the king
    Get that leg going now
    Get your lip too.
    Not no fool Billy Idol lip either
    Everybody!
    Yeah, we're rockin now!

    Norton is with us.
    He's with us and he's speaking to us.
    He says "Peoples!"
    "Peoples!"
    "Everybody!"
    "Everybody got to sing!"

    Norton is everywhere
    Norton is in everything
    Norton is in everybody
    Norton is still the king

    Man o man
    What I want you to see
    Is that the big N's
    Inside of you and me

    Norton is everywhere
    Norton is in everything
    Norton is in everybody
    Norton is still the king

    Man o man
    What I want you to see
    Is that the big N's
    Inside of you and me

    Emperor Norton!

  12. Re:You see it coming, don't you? by sporty · · Score: 1, Offtopic

    You know... you are going to hell for that one.

    --

    -
    ping -f 255.255.255.255 # if only