Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Programming Books Media Businesses Book Reviews Apple IT Technology

Cocoa Programming for Mac OS X, 2nd Edition 162

Spencerian writes "Aaron Hillegass new book, Cocoa Programming for Mac OS X, 2nd Edition, is a very helpful book for developers interested in getting not only their feet wet, but become totally immersed in creating applications using the OpenStep-derived API known now as Cocoa. Don't dive in without knowing how to swim in C++/Java, however." Read on for the rest of Spencer's review.
Cocoa Programming for Mac OS X, 2nd Edition
author Aaron Hillegass
pages 450
publisher Addison Wesley
rating 9
reviewer Kevin H. Spencer
ISBN 0321213149
summary Aaron Hillegass new book, Cocoa Programming for Mac OS X, 2nd Edition, is a very helpful book for developers interested in getting not only their feet wet, but become totally immersed in creating applications using the OpenStep-derived API known now as Cocoa. Don't dive in without knowing how to swim in C++/Java, however.

The author is no stranger to OpenStep, having worked at NeXT as well as Apple in OpenStep application development and training. Currently, Hillegass teaches Cocoa programming for The Big Nerd Ranch.

Cocoa Programming for Mac OS X, 2nd Edition is written in a way that makes you feel like you are in a class. There are prerequisites you must know and understand before you can begin, and, as a good professor would, the author points out what you need to have and know before beginning. Happily, the author is quite meticulous and has generously provided useful resource links and help where readers may explore for their supplies and primers and the like.

Essentially, anyone with a copy of Mac OS X 10.3 Panther has all that should be required--the Developer Tools CD contains all developer software and documentation necessary (the author notes in the book specific locations for key primers and references).

If you are experienced in C++ or Java programming, Cocoa development will seem familiar enough. Objective-C is used throughout the book (the author notes that development in Java is possible, but not recommended) for the various and numerous exercises. Cocoa development is made easier with Apple's Xcode application, however, Cocoa is not for the timid or novice programmer. This book is well-written and easy to follow IF you have a respectable level of C/C++ or Java development under your belt.

The text, as well as its diction, is easy on the eyes and mind, and while this is a programming book, the author's voice speaks well, allowing you to feel as if you can ask the book questions as if you were in a classroom. Graphics and text are plentiful, but information is not packed on every page, so following along is far from drudgery. Each chapter does stack itself on information from the previous, so this isn't a reference book in the strictest sense.

Addison-Wesley, the publisher, has formatted the book nicely, with a pleasant font that won't tire the eyes, consistent code and text conventions, and a detailed Table of Contents and Index, However, it's thickness and binding doesn't lend itself to lying flat, so you'll have to weight the book pages down to read the book hands-free as you type in examples. Speciality bindings that could have been useful for this book are not cheap, based on my publishing experience, and such a binding would add more to the book's $45 US cost. (Amazon has a great deal on the book at the time of this review.)

Five new chapters were added in this 2nd edition, which discuss creating AppleScriptable applications, integrating OpenGL, adding Undo abilities, creating reusable frameworks, and tinkering with GNUStep, the raw open-source tools for those curious about making Cocoa apps under Linux.

If you're a UNIX or Windows developer who picked up a Mac OS X machine recently in hopes of developing new apps or porting your apps to Mac users. this book should be strongly considered as one of your essential reference and training tomes.


You can purchase Cocoa Programming for Mac OS X, 2nd Edition from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, carefully read the book review guidelines, then visit the submission page.

This discussion has been archived. No new comments can be posted.

Cocoa Programming for Mac OS X, 2nd Edition

Comments Filter:
  • by BasilBrush ( 643681 ) on Wednesday May 26, 2004 @03:56PM (#9261744)
    Presumably as few programmers have Objective C experience. At least if you know C++, you know the C parts of Objective C, and hopefully have some OOP experience.
  • Re:MVC Shite!... (Score:2, Insightful)

    by golgafrincham ( 774723 ) on Wednesday May 26, 2004 @04:30PM (#9262026) Journal
    geez, i'm not the only one cursing this pattern insanity nowadays.

    What about creating reuseable, database linked components, that can be dropped into any screen in a line of code?

    i also think that ides do make a difference (i'm trying to say that ides influence your way of coding and also your productivity. not to forget the fun). using eclipse for example is like using xwindows and, say, gnome. it takes some time until everything is configured well, but when it is, you do drop your db linked components into any frame without writing even a line of code. a company i once worked for was primilary doing frontends, mostly for databases. all widgets in the gui part are standard widgets, wrote once, wrapped in beans. so the only real work was creating a laf according to style guides and occasionally to modify some jdbc drivers for rare dbs. like oracle (man, "classes.zip" somehow works, but it is the worst jdbc driver i saw. and you have to pay much if you want their network protocol in order to write your own drivers. or you jad and sniff;)

    it is also possible to ship complete ejb applications with a one (nearly one) click installer (just use the ant classes. their license allowes this and it's the best way to gain access to the os). every technology that wants to incorporate with java should not restrain that way of coding (that's the reason i use this language). cocoa does.
  • by The Almighty Dave ( 663959 ) on Wednesday May 26, 2004 @04:33PM (#9262054)
    Sheesh. This isn't rocket science. Hopefully Apple has some rocket scientists and won't spend the next decade patching one hole after another.

    I am having a hard time following your logic. If this isn't rocket science, why do you hope Apple has some rocket scientists? Wouldn't it be better to have someone who is not a rocket scientist to deal with problems that are not rocket science?

  • by Paradise Pete ( 33184 ) on Wednesday May 26, 2004 @04:47PM (#9262150) Journal
    This isn't rocket science. Hopefully Apple has some rocket scientists

    Well, if it isn't rocket science then what good would that do?

  • Moderated funny? (Score:2, Insightful)

    by NSAnonymousCoward ( 756801 ) on Wednesday May 26, 2004 @05:05PM (#9262380)
    Are the food jokes about Cocoa (and Java) really still amusing? Or were they ever? There's enough derivative/inflamatory crap on this site without having skim over peoples lame-ass regurgitated humor...
  • Re:MVC Shite!... (Score:3, Insightful)

    by Fermata ( 644706 ) on Wednesday May 26, 2004 @05:11PM (#9262458)
    Hmm...you must have skimmed through the tutorial without reading closely, since it *specifically* tells you that the Currency Converter is overdesigned to introduce the MVC concept:

    "This design for Currency Converter is intended to illustrate a few points, and so may be overly designed for something so simple. It is quite possible to have the application's controller class, ConverterController, perform the computation and do without the Converter class. By adhering to the MVC paradigm in this tutorial, however, you will learn the fundamentals of good Cocoa design which will assist you greatly as you begin to work on more advanced projects."

    Of course, a full justification of the MVC approach is beyond the scope of this reply!
  • by macserv ( 701681 ) on Wednesday May 26, 2004 @05:39PM (#9262728)
    ... you get screwed up by C++.

    Well, OK, not screwed up, but C++ experience should not be considered a good background for learning Objective-C Cocoa. Its approach to programming with "objects" is very different, and the transition to Objective-C, IMHO, leads to a mix of techniques that is hell to read/debug, making for buggy Cocoa apps. If you're a C++ vet, it may be a good idea to unlearn a lot of what you know, and assimilate the conventions of the seasoned Objective-C coders.

    That said, even though C++ may not give you a good start for Objective-C development, it can still be very beneficial to leverage C++'s speed in various parts of your application. You can, for example, build your engine from C++, and your widgetry in Objective-C Cocoa.

    A strong Java background makes for a fairly easy to transition into Cocoa, trading in a few conveniences for greater flexibility, more mature classes, and easy GUI development. Java is quite similar to Objective-C and both can be used/mixed to build Cocoa applications (most don't though).

    If you're a C jockey, Objective-C is like adding a new weapon to your arsenal. Objective-C is a superset of C. Those who are fluent in the design patterns of both languages will get the most from their Cocoa applications. Indeed, the ability to (fairly) freely intermix C, Objective-C and C++ is a great advantage, allowing you to use the tool that's right for the job.

    As a switcher from any language, one of the biggest hurdles can be getting some fundamental OO design patterns down, which are expected by most of the Cocoa API. For example, you can't go one step in learning Objective-C without being taught the MVC (Model-View-Controller) paradigm. In contrast, a great many mature Java/C++ developers have never learned, or even heard of, this concept.

    Just some observations... YMMV.
  • by Pixie_From_Hell ( 768789 ) on Wednesday May 26, 2004 @06:33PM (#9263190)
    He struck me then as someone that falls into the category as a "Big Brain", esp wrt to training/educating on software programming. And a super nice (and patient) guy, to boot.
    I went to graduate school briefly with Aaron. (He left soon after he started to pursue his NeXt / Apple / Cocoa interests.) He was indeed a super nice guy; he helped me through first year differential geometry (and now I think of myself as a differential geometer).

    Go Aaron!

    I'm gonna pick up this book asap.
    Alas, I'm not his target audience anymore. (No C, C++, or Mac for me.) But he is a good guy.
  • by Whatchamacallit ( 21721 ) on Wednesday May 26, 2004 @07:19PM (#9263545) Homepage
    One does not really need to know C++ nor Java as Objective-C is really ANSI C + Smalltalk extensions. Obj-C on it's own is really rather simple. It's much easier and some may argue more powerful then Java or C++.

    What this book does is introduce you to the Cocoa API and the Apple Dev Tools XCode & Interface Builder. The first edition was a blast and I plan on picking up the second edition in the near future.

    If you are coming from a C++ background and you like it, you should study Carbon and not Cocoa at first. You can call Cocoa objects from Carbon and visa versa though. New projects should probably be written in Cocoa. Older projects written in C++ can be ported to Carbon easily. C programs can be ported to Cocoa and Java programs should probably stay Java or be ported to the WebObjects frameworks if it's a web based solution. You can write Java apps using the Cocoa API but it then becomes locked into the OS X platform as the Cocoa API (for Java) is not available on other platforms (maybe GNUStep but it's not all the way there yet) Note, you can run Tomcat and JBoss on OS X!

    The NeXTStep / OpenStep / Cocoa API is rather advanced and can take some getting used to... i.e. you will have a rather steep learning curve to absorb it all and understand the best practices. This book is a great introduction and will get one up to speed quickly.

    I found Interface Builder to be the most difficult part of the development process. This was because I had to unlearn all the preconceived crap in my head that I learned from other GUI interface tools. It turns out IB is much more advanced then anything I've ever used before because it builds live objects and not just GUI code. It then archives these objects into NIB files which are automatically unarchived by a Cocoa application. You literally build objects graphically and then interconnect them to each other and your Obj-C classes and instances. WebObjects does the same thing but with Java. It's a really slick development tool and once you start to understand it, the light turns on and you can see the possibilities.

    Total newbies should probably pick up the "Programming in Objective-C" by Stephen Kochan. This book covers just the underlying Obj-C language and the Core Foundation (NeXStep/OpenStep/GNUStep/Cocoa) API. Programming in Objective-C does not cover the GUI portion of Cocoa programming. I just finished it and it managed to bootstrap my understanding quite a bit.
  • by Jeremy Erwin ( 2054 ) on Wednesday May 26, 2004 @08:33PM (#9264027) Journal
    One thing that still bothers me is that it's difficult if not impossible to use templates with Objective C++, which negates some of the more recent advances of the C++ standard.

I've noticed several design suggestions in your code.

Working...