Slashdot Mirror


Cocoa Programming for Mac OS X, 2nd Edition

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.

162 comments

  1. Mmmm... Cocoa by skzbass · · Score: 2, Funny

    in realated news Dutch cocoa maker Godiva comes out with a book on properly programming your microwave to make the perfect drink.

    --
    Sig (appended to the end of comments you post, 120 chars)
    1. Re:Mmmm... Cocoa by Anonymous Coward · · Score: 1, Funny

      Of course, being naked on horseback is a requirement for good cocoa.

    2. Re:Mmmm... Cocoa by acey72 · · Score: 0, Offtopic

      Grrrrr - Godiva are Belgian, not Dutch!!!!

    3. Re:Mmmm... Cocoa by VanillaCoke420 · · Score: 0, Offtopic

      Yesterday was the rerun of that Spin City episode with Alyssa Milano as the Mayor's daughter. She was riding a horse naked too. :)

    4. Re:Mmmm... Cocoa by skzbass · · Score: 0, Offtopic

      Fine... but as long as your going to be right, its Godiva is Belgian.

      --
      Sig (appended to the end of comments you post, 120 chars)
    5. Re:Mmmm... Cocoa by Nexum · · Score: 0, Offtopic

      As long as you're going to correct people so meticulously you may as well learn some grammar. ;)

      --

      This sig has been deprecated.
    6. Re:Mmmm... Cocoa by skzbass · · Score: 1

      god-damnit, well that's our fine education system at work fellas. The ironic thing is that i'm reading slashdot and not doin' the english project that was due yesterday...

      --
      Sig (appended to the end of comments you post, 120 chars)
    7. Re:Mmmm... Cocoa by unother · · Score: 1

      That's not ironic.

  2. In case anyone is wondering.. by AKAImBatman · · Score: 5, Informative

    ...he mentioned Java because there's a Bridge mechanism in OS X that allows Java code to call ObjC code, and ObjC code to call Java code. I've used it myself and found it to be an effective way to write Java programs that are native to the OS X platform. Be warned, however. Differences in the way ObjC and Java handle objects causes quite a bugs. Not everything can be 100% mapped, so you'll find yourself writing some ObjC anyway.

    1. Re:In case anyone is wondering.. by metamatic · · Score: 1

      I was wondering why he mentioned C++, actually.

      --
      GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
    2. Re:In case anyone is wondering.. by AKAImBatman · · Score: 1

      Yeah "quite a bugs" like erasing your whole User folder when you try to use the Java.net.* classes.

      Err... quite a few bugs. Can't say I've seen it erase any folders, though. Should I ask why you have a link to some game site, or should I just tell moderators to mark you as -1 Troll?

    3. Re:In case anyone is wondering.. by AKAImBatman · · Score: 1

      I was wondering why he mentioned C++, actually.

      That's a good point. A C++ app would use Carbon instead of Cocoa.

    4. Re:In case anyone is wondering.. by golgafrincham · · Score: 1

      ...he mentioned Java because there's a Bridge mechanism in OS X that allows Java code to call ObjC code, and ObjC code to call Java code

      sounds interesting. does it work like jni ore more like using the python - c bridge?

      --
      beer as in "free beer"
    5. Re:In case anyone is wondering.. by BasilBrush · · Score: 3, Insightful

      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.

    6. Re:In case anyone is wondering.. by Abjifyicious · · Score: 2, Informative

      Well, it is possible to mix Objective-C with C++ - the result being an abomination known as "Objective-C++" - but it's not something you typcially need to know about unless you're trying to do something weird, like use a C++ library from within an Objective-C program...

    7. Re:In case anyone is wondering.. by AKAImBatman · · Score: 1

      If I understand correctly, the compiler generates "glue" code at compile time. This makes it (almost) completely transparent to the programmer.

    8. Re:In case anyone is wondering.. by mad.frog · · Score: 2, Informative
      it's not something you typcially need to know about unless you're trying to do something weird, like use a C++ library from within an Objective-C program

      What's so weird about this? Personally, I find Objective-C to be a problematic, weird language, with an unappealing syntax. I know Apple considers the dynamic binding to be a "feature", but I'm all about static type checking... hell, I'd add more rigid type checking to C++ if I could :-)

      I vastly prefer to work in C++. No way do I want to use Objective-C more than I have to.

      (For the record, I have written plenty of code in Objective-C, back in the pre-Apple NextStep days. So this is not a completely ignorant comment :-)

    9. Re:In case anyone is wondering.. by AcornWeb · · Score: 1

      Yeah, he did specifically mention Java. However, what he said was "just don't do it". :-)

      Not exactly glowing praise.

      --
      Your Windows PC is my other computer.
    10. Re:In case anyone is wondering.. by Abjifyicious · · Score: 1

      Oops, sorry, I guess I forgot for a second that not everyone likes the same languages as me ;-) Actually though, I like C++ almost as much as Objective-C, it's just the mixing of the two that seems unwieldy to me.

    11. Re:In case anyone is wondering.. by TheEnigma · · Score: 1

      I know a lot of people feel the way you do, but personally I am much happier with dynamism. If I want to ensure that an object can receive a message I want to send it, I just send it -respondsToSelector: first. It means that I have to do part of the work instead of the compiler, but this pays dividends later when you want to extend the software, since later, one can add a category to any object that implements a method corresponding to the selector -- no subclassing required, and no fragile base class problem. I love it.

      Of course it is easy to abuse, but I just don't do that. Self-control is important in Objective-C. But in exchange, you get the power of delegation, which is so sweet I can't begin to express it. For end-user apps on Mac OS X, you'd be crazy to overlook it.

      --

      Stand back. I've got a brain and I'm not afraid to use it.

    12. Re:In case anyone is wondering.. by Art+Tatum · · Score: 1
      Personally, I find Objective-C to be a problematic, weird language, with an unappealing syntax.

      Amusingly, I feel the same about C++. It seems kind of confusing to reuse procedural syntax for OO functionality. And don't even get me started on operator overloading...

  3. Differences from first edition by tenuki · · Score: 3, Interesting

    How different is this one from the first edition?

    1. Re:Differences from first edition by skarth · · Score: 5, Informative

      This version is written for Panther, and thus covers the new features of Cocoa that were introduced in Panther, such as bindings.

    2. Re:Differences from first edition by Roofus · · Score: 4, Funny

      This one goes up to 11.

    3. Re:Differences from first edition by lacrymology.com · · Score: 5, Funny

      "How different is this one from the first edition?"

      Brushed Metal pages?

      -m

      --

      #
      # Modus Ponens
      #
    4. Re:Differences from first edition by for_usenet · · Score: 5, Informative

      The chapter on GNUStep is also new. This is of interest to me, as I do a lot of work on Linux, but have been wanting to do some OS X coding as well. I've heard that GNUStep still has a "bit" of catching up to OS X's implementation of OpenStep. But with applications like GNUMail, maybe this isn't all hopeless, and might actually be useful.

    5. Re:Differences from first edition by Art+Tatum · · Score: 4, Interesting
      I've been playing with GNUstep happily for quite some time now. And one thing you absolutely *have* to see (if you haven't already) is Renaissance. You define your GUI with an XML document (including targets, actions, and outlets) and it's automagically laid out on both OS X and GNUstep. This not only makes porting much easier, it will also make it much easier for your GUIs to adapt to foreign languages, the upcoming GNUstep theme support, and different end-user fonts.

      It's still in development, and there isn't a graphical builder for it yet, but it's very promising.

    6. Re:Differences from first edition by drauh · · Score: 1

      Don't you mean it goes up to XI?

      --
      This is a tautology.
    7. Re:Differences from first edition by shatfield · · Score: 2, Informative

      I have both editions, and I have to say that the second edition content and writing are better.

      He has incorporated 2 years worth of experiences from the teaching of the first edition at Big Nerd Ranch into this book... so it is little wonder that the second edition is better. He approached the book with the idea that "it'll be released when it is ready", and it shows. He didn't rush this out the door. You cannot find a better resource for Mac OS X programming than this author. I suggest reading anything he writes, if you are serious about programming the Mac.

      As far as the content goes -- everything development (CodeWarrior aside...) in Panther is Xcode, not Project Builder -- and the second book reflects this. I had a terrible time implementing the first edition's projects in Xcode, because all of the screen shots were different -- even Interface Builder has changed quite a lot. If you are looking at both editions and do not have the first one, you won't regret getting the second one. If you have the first one, but have not started learning from it yet, you will want to skip it and get the second one. If you've already gone through the first one, the second one might help you dig more into Xcode, but the Xcode website might be all you need for that.

      I hope this helps.

      --
      "To make a mistake is only human; to persist in a mistake is idiotic." Cicero
    8. Re:Differences from first edition by Brendor · · Score: 1
      "How different is this one from the first edition?" Brushed Metal pages?

      That and if you fold the dogears on the corner of the cover, the book breaks apart into hovering chapters and you can point in midair at the one you wan to read first.

  4. Other good books are... by Space+cowboy · · Score: 5, Informative

    "Cocoa Applications" (excellent step-by-step guide) and "Learning Cocoa with objective C" (more focused on the language than the framework). These are both from O'Reilly and recommended by the ADC (Apple Developer Connection).

    Simon

    --
    Physicists get Hadrons!
    1. Re:Other good books are... by .com+b4+.storm · · Score: 1

      Learning Cocoa with Objective-C does an excellent job at easing you into programming on OS X. I bought it around a year ago, and it really helped me get up to speed on how OS X applications are written, how to use Interface Builder, etc. There's a lot of good detail on Objective-C, of course, but I'd say that's only about 50% of the content. The rest helps you understand how to hook code up to the UI, work with bundle files, and so forth.

      It's a great book to start with, and anyone who's programmed before will likely not need anything beyond that and the reference documentation to build decent apps.

      --
      "Wow, you're like some kind of superhero able to ward off happiness and success at every turn."
      -- Ryan Stiles
  5. C++ is for the weak by NeoGeo64 · · Score: 3, Funny

    Real men code everything in BASIC.

    1. Re:C++ is for the weak by Anonymous Coward · · Score: 1, Funny

      i still have a pascal compiler laying around somewhere for the apple IIe on two five and quarters... ah, here it is. anybody have dual 5.25 inch drives?

    2. Re:C++ is for the weak by Anonymous Coward · · Score: 0

      Hahah. Last time that happened to me was in a rarely taught class at a liberal arts college. Our snobol bootstrap compiler and class notes were on two 5-1/4's.

    3. Re:C++ is for the weak by lacrymology.com · · Score: 3, Funny

      "Real men code everything in BASIC."

      Well, you fail then... the correct answer was:

      10 "Real men code everything in BASIC."
      20 goto 10

      -m

      --

      #
      # Modus Ponens
      #
    4. Re:C++ is for the weak by lacrymology.com · · Score: 2, Funny

      Whoops! I fail too! :p

      I meant:

      10 print "Real men code everything in BASIC."
      20 goto 10

      -m

      --

      #
      # Modus Ponens
      #
    5. Re:C++ is for the weak by TheRealMindChild · · Score: 1

      Who uses number lines? Plus, you need a print statement for that first line to do anything:

      JumpHere:
      Print "Real Men Code everything in BASIC."
      goto JumpHere

      --

      "When life gives you lemons, don't make lemonade. Make life take the lemons back!" -- Cave Johnson
    6. Re:C++ is for the weak by uberdave · · Score: 1

      Real BASIC uses line numbers. You're using some sort of pseudo BASIC that was developped by people who couldn't handle C.

    7. Re:C++ is for the weak by Ilan+Volow · · Score: 1

      Strange. I had always been told that real men speak with a LISP.

      --
      Ergonomica Auctorita Illico!
  6. I'll wait by Bingo+Foo · · Score: 4, Funny

    I'll wait for the third edition: Protocol Handler Exploit Programming for Mac OS X.

    --
    taken! (by Davidleeroth) Thanks Bingo Foo!
  7. Good Read! by Capt.Gingi · · Score: 5, Informative

    I've read several of the other Cocoa books out there and Aaron's is the only book that intelligently steps you through adopting this language and the design metaphors that Apple encourages you to adopt to build applications to best effect that leverage all the capabilities of the system foundations versus trying to do everything yourself.

    The additions of covering bindings is just how to get around the new Xcode interface including the revamped Interface Builder makes this book a must read. Starting with any of the other books you'll be banging your head against the wall as what you see and what they describe in terms of many of the actions will not match the current tools.

  8. Second Edition Errata by bcolflesh · · Score: 4, Informative
  9. ACT UP says by Anonymous Coward · · Score: 0

    We Bash Back

  10. I'm . . . by Prince+Vegeta+SSJ4 · · Score: 4, Funny

    kookoo for Cocoa Progs

    1. Re:I'm . . . by Prince+Vegeta+SSJ4 · · Score: 1
  11. BASIC is weak by millahtime · · Score: 2, Funny

    Real men code everything in assembly

    1. Re:BASIC is weak by nkh · · Score: 2, Informative

      That's what Java is all about: you can be an assembly zealot and still be platform independant with the JVM opcodes ;)

    2. Re:BASIC is weak by Anonymous Coward · · Score: 3, Funny
      0000000: 2052 6561 6c20 6d65 6e20 636f 6465 2065 Real men code e
      0000010: 7665 7279 7468 696e 6720 696e 206d 6163 verything in mac
      0000020: 6869 6e65 206c 616e 6775 6167 650d 0a00 hine language..
  12. Good Tutorial by druske · · Score: 4, Informative

    I read through the first edition about a year ago, and found it to be an excellent hands-on tutorial, gradually walking the reader through the construction of increasingly complex apps. I came at the book from a strong C++ background and various Microsoft technologies, and zero experience with Mac software development, and left with a reasonable beginners knowledge of Objective-C and Cocoa. Supplement this tutorial with resources like Apple's reference material and the mindshare at the Cocoa developer list archives, and you'll be well on your way to developing your first Mac app.

    I'm glad to see that the second edition added AppleScripting and material on implementing Undo, even if at the expense of the Java chapter. (No surprise, there: in the beginning of the first edition's Java chapter, Hillegass basically says this about programming Cocoa using Java: "DON'T.")

  13. I'll be programming at.... by millahtime · · Score: 4, Funny

    the cocoa, cocoa cabana....

  14. can cocoa... by millahtime · · Score: 1

    Can Cocoa use the same objsect code produced in Mono?

  15. THAT is an old story... by argent · · Score: 4, Interesting

    From what I've heard Apple is taking this more seriously than Microsoft.

    After all, this is the same basic design flaw that led me to ban IE and Outlook at work about ... jeeze... getting on for a decade ago, and that about nine out of ten email viruses and worms exploit, and that Microsoft not only refused to fix but spent five years in lawsuits with the justice department to defend... even though every other person in the security business was telling them it was a bad idea.

    HEY, PEOPLE, DON'T USE THE SAME PROGRAMS AND HELPER APPLICATIONS FOR LOCAL DATA AND THE INHERENTLY UNTRUSTABLE INTERNET!

    Sheesh. This isn't rocket science. Hopefully Apple has some rocket scientists and won't spend the next decade patching one hole after another.

    1. Re:THAT is an old story... by dasmegabyte · · Score: 4, Interesting

      I'd have to say you have a very skewed opinion of how programs work.

      See, if you have to do something twice, you only write it once. Because if you had to write it twice, each version would be twice as buggy. Which in your case would mean twice as many exploits. It really isn't rocket science to see which is a better idea from a process management perspective. If you want stable code, you can't go writing a separate version of something just for use on the internet.

      What you should do, however, is never make the assumption that what the program is being told to do is what the USER wants the program to do. This works for local exploits as well...like when your brother starts trying to screw around with the network settings. If your program is being asked to do something twitchy...like delete something, change a system setting, open a port, etc...then your program should require user input before doing so. It should never automatically execute anything that might be unsafe.

      Which is where Apple's one step better than Windows. It asks you for your system password before mucking with the system. It asks for your system password before deleting system wide programs. It unpacks archives automatically, but doesn't run the files inside. And it can be made to ask for your user password before messing with your user settings.

      --
      Hey freaks: now you're ju
    2. Re:THAT is an old story... by argent · · Score: 1, Interesting

      I've been writing software professionally since 1978, I've been managing computer systems and computer networks since 1984, and I've written safety-critical (as in, if I screwed up people would die) software for railroads and the oil industry. I think it's fair to say that I know how programs work.

      And, well, there's this thing called a "subroutine library" that solved this straw man you've built up. You're a smart guy, I'm sure you've heard of them: you write it once, use it from two places.

      As for "never automatically execuite something that might be unsafe", well, if a document (say a web page) wants to open a file, a new network connection, even a new window on the display... it shouldn't be allowed, right? Imagine trying to use a local resource, like a text editor, with those restrictions! "TextEdit has tried to open a new window, should it be allowed?"...

      This isn't a theoretical question, by the way. Try installing Paranoid Android (a fine program by Unsanity) and then opening a document in Butler (a fine application by Peter Maurer). "Butler is attempting to open a "file:" URL... huh, how about that? :)

    3. Re:THAT is an old story... by The+Almighty+Dave · · Score: 2, Insightful
      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?

    4. Re:THAT is an old story... by Paradise+Pete · · Score: 2, Insightful
      This isn't rocket science. Hopefully Apple has some rocket scientists

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

    5. Re:THAT is an old story... by argent · · Score: 1

      I would draw a Venn diagram explaining this for you, but the margin is too narrow to hold the graphics. I will simply suggest you consider that there are more possibilities allowed by set theory than disjoint sets.

    6. Re:THAT is an old story... by dasmegabyte · · Score: 1

      And, well, there's this thing called a "subroutine library"...you write it once, use it from two places.

      And this is exactly what Windows does, more or less. UN-fortunately, certain programs were told to, by default, automatically handle files using functions from these libraries -- including libraries which handle executable scripts that basically have free reign over the system. This is the problem -- not that the same libraries were used for both user functions and "teh intarnet," but that the designers foolishly allowed scripts from an alien source (such as the internet) to run uninhibited in user space.

      never automatically execuite something that might be unsafe

      There's a big difference between opening a text file for edits and opening a system configuration window. What Apple does is prevent casual users and their programs from making edits to system files without realizing an edit will be made...basically, by forcing the user to run in user mode and setting all important system files owned to root and with access set to 755. "Administrator" users under OS X are members of wheel, and thus can use sudo to temporarily assume root access to system files. Apple has automated this process in their installer and system preferences programs.

      OS X is still vulnerable to spyware that might be piggybacking onto desired installers...but it takes more than an autoexecing script or a few mis-clicks to do so.

      --
      Hey freaks: now you're ju
    7. Re:THAT is an old story... by argent · · Score: 4, Informative

      No, you're missing the point. The problem isn't that this or that application is not secure, it's that there are readically different approaches that the high level part of an application has to take when it's dealing with untrusted objects. An application that is designed for an untrusted environment has to implement mandatory access control, what some people call a sandbox. An application that is designed for convenient use by the end-user in an environment where it doesn't have to deal with untrusted objects would be terribly cumbersome if it applied mandatory access control to everything. There are systems that apply MAC everywhere, what they call compartmentalised mode systems, and they're terribly difficult and unfriendly.

      So applications like web browsers, mail software, media players, anything that implements a mechanism to access and display untrusted data, have completely different requirements from applications like Finder or Help Viewer. It is very difficult to design a single set of rules that can aply to both, even if you use "Zones" to separate them, because it's difficult to determine *what* zone something is supposed to be in.

      That's how the "cross zone" exploits on Windows work, the typical example is to trick an application like Outlook into opening a document on the local disk that has been provided by the exploit script. It's local, so it's trusted, and bob's your uncle... the bad guy is in.

      This is exactly the same problem these recent exploits on the Mac use.

      The right fix is to have the application keep track of the history of an object and never let it at the "trusting applications" list. And to have applications that deal with untrusted data by default assume that everything they're dealing with is untrusted. In Microsoft's case, instead of having a single "internet explorer" application (actually the MS HTML Control) that you call with a file and have it figure out whether to trust it or not, you would have an IE application that handles access, and calls an HTML entity that only does display and goes back to the application for access. Apple has a different display model using PDF that doesn't do access, so they don't have that problem... all they need to do is split LaunchServices into a "for trusted data sources" and "for untrusted data sources" list. Applications that open remote documents use the "for untrusted data sources" list for references in those documents, and you ONLY put applications that expect untrusted data in that list.

      There's little duplication, because there's very little duplication between what you want to do with trusted and untrusted data... and you would generally be able to make do with a wrapper.

      As for the famous Apple "graphical SU", well, that's a good start. It's part of a security solution and I'm glad it's there... but it's nowhere near a panacaea for this situation. If I have local access on your machine I don't need to do *anything* to your system configuration to make your life just as miserable as if I were running as Administrator on a Windows box or root on Linux. I could send spam in your name, open up a back door that a bad guy could use to perform more sophisticated attacks, set a listener on your email, redirect your browser through my proxy, just about anything that doesn't require actual superuser access. And all it takes is *one* rogue executable to get it in.

      This is not an attack on Apple... there is no way to build an OS that's suitable for a general user population to run arbitrary code on without opening up the possibility that someone might trick the user or the system into running an exploit. You wouldn't want to use a system that sandboxed everything, and neither would I. So don't be in such a hurry to defend Apple's honor... there's no dishonor here for them. It's Microsoft... who created the copreesponding hole in the mid '90s and refused to fix it even when required to under a court order that has egg on their face.

    8. Re:THAT is an old story... by The+Almighty+Dave · · Score: 1

      I have considered that there are more possibilities allowed by set theory than disjoint sets and how it applies to your statement. It looks like I'm going to need that diagram.

    9. Re:THAT is an old story... by Anonymous Coward · · Score: 0

      This isn't rocket science. Hopefully Apple has some rocket scientists

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


      Those rocket scientists would sure come in handy for enacting some "Regime Change" up in Redmond...

      (missiles home in on Redmond...)
      Gates: Someone set us up the bomb! Do something, MonkeyBoy!

      Ballmer: (jumps around panting, screaming, and sweating) Developers! Developers! Developers! Developers!

      Giant Head of Steve Jobs: All your Airport Extreme Base Station are belong to us. Microsoft software limited to 640K programmed in LOGO from now on. Submit or die.

      Ballmer: I...LOVE...THIS...COMPANY! ARRR!!!!!

  16. Assembly is weak by dasmegabyte · · Score: 4, Funny

    Real men don't care WHAT the real answer is...instead, they choose one at random and beat the shit out of anyone who disagrees.

    Which is why true && false == true. What, you wanna start? BRING IT ON!

    --
    Hey freaks: now you're ju
    1. Re:Assembly is weak by Short+Circuit · · Score: 1

      You accidentally left out a line:

      #define true=false

      Then your statement works out just fine.

    2. Re:Assembly is weak by Anonymous Coward · · Score: 0

      Actually, 'true && =false == true' is meaningless

    3. Re:Assembly is weak by Short+Circuit · · Score: 1

      Oops. That should be:

      #define true false // At which point it becones // 'false && false == false' // Which is false. :)

    4. Re:Assembly is weak by Short+Circuit · · Score: 1

      Gah!

      Make that...

      #define true false

      // At which point it becones
      // 'false && false == false'

      // Which is false. :)

    5. Re:Assembly is weak by Anonymous Coward · · Score: 0

      I'd have it written as:

      true || true == false

  17. Same for GnuStep it seems... by mariox19 · · Score: 1
    [I]n the beginning of the first edition's Java chapter, Hillegass basically says this about programming Cocoa using Java: "DON'T."

    I was browsing the second edition at a bookstore (I own the first edition), and the the Java chapter seems to be replaced with a chapter on GnuStep. Maybe I'm reading it wrong, but it seems he basically has the same advice, saying something about GnuStep being announced 10 years ago and still not at a 1.0 version, and also being both difficult to install and a bit buggy.

    I think he puts these chapters in his book only to answer the question, "I wonder what Hillegass thinks about coding in such-and-such."

    --

    quiquid id est, timeo puellas et oscula dantes.

    1. Re:Same for GnuStep it seems... by Art+Tatum · · Score: 3, Interesting
      I wonder how long he spent looking at it. The GNUstep-base (Foundation) reached 1.0 a long, long, long time ago (currently at 1.9.1) and is stable and featureful on both UNIX and Windows. GNUstep-gui (AppKit) is at 0.9.2 and is also very stable and useful on UNIX, getting there on Windows.

      GNUstep has very fine InterfaceBuilder and ProjectBuilder clones, a quickly growing number of excellent end-user applications.

      Also, it seems to me that the install is *not* difficult. Granted, I've been working with it for a long time, so maybe I'm just used to it. And I'm sure Hillegass wasn't used to dealing with Linux (or BSD, or Solaris, or whatever he tried to install it on).

      But considering the very small number of people working on the GNUstep core, I'm amazed at the quality and completeness of the project.

    2. Re:Same for GnuStep it seems... by mariox19 · · Score: 1

      Well, I'm glad I posted, because I'm glad to read your response. Can I ask, if you're running it on Linux, what distribution? I run Debian (and alternately RedHat), and I'm wondering if the Debian package is just too old (I'm running stable).

      I am now (again) interested in giving it a try. I would love to be able to use it to develop Linux apps.

      --

      quiquid id est, timeo puellas et oscula dantes.

    3. Re:Same for GnuStep it seems... by Art+Tatum · · Score: 1
      Can I ask, if you're running it on Linux, what distribution?

      I've used RedHat and Gentoo. I'm not sure who maintains the Debian packages (or even *if* they're maintained). I always build from CVS since it's usually stable and there are often improvements and additions.

      If you're going to do development with it, you might consider trying Renaissance. You describe your user interface in XML and it's portable to other platforms, languages, or themes. There's no GUI builder for it yet, however.

      If you have any trouble, feel free to ask for help: jhclouse -at- juno -dot- com. You can also ask questions on the mailing list.

  18. Objective C, pshaw by zx2c4 · · Score: 0

    Why did apple choose to use Objective C? Why not just use C++? What are the differences? Is objective C more like C#?

    --
    ZX2C4
    1. Re:Objective C, pshaw by anactofgod · · Score: 4, Informative

      Why don't you Google to answer your silly question on why NeXT (not Apple) chose Objective-C over C++.

      You may as well as why ID chose NeXT and Objective-C over Windows and C++ to develop the original Quake engine.

      But, to save you the effort of typing "Objective C versus C++" in a Google search field, I cut & paste a short paragraph out of an article (returned by said search) printed in the Linux Journal on Sept 13, 2003.

      As for C#...Objective-C pre-date C# by decades. It was developed independently and comtemporaniously with C++.

      ---anactofgod---

      An introduction to Objective-C for programmers familiar with C++ or any other OOP language.

      It is a surprising fact that anyone studying GNUstep or the Cocoa Framework will notice they are nearly identical to the NEXTSTEP APIs that were defined ten years ago. A decade is an eternity in the software industry. If the framework (and its programming language--Objective C) came through untouched these past ten years, there must be something special about it. And Objective-C has done more than survive; some famous games including Quake and NuclearStrike were developed using Objective-C.

      Why Should I Learn Objective-C?

      Objective-C gives you the full power of a true object-oriented language with exactly one syntax addition to C and, unlike C++, about a dozen additional keywords.

      Since Apple purchase Next for $400 million and Mac OS X ships with Objective-C, recycling NEXTSTEP (later called OpenStep), as well as the fact that GNUstep is delivering the rock-solid window-manager Window Maker, Objective-C is (rightly) getting more attention because it is more flexible than C++ at the cost of being slower.

      In reality, Objective-C is Object C and is as close to Smalltalk as a compiled language can be. This is no surprise as Brad J. Cox added object-oriented, Smalltalk-80-based extensions to the C language.

      So objective-C is a hybrid between Smalltalk and C. A string can be represented as a `char *' or as an object, whereas in Smalltalk everything is an object. As with Java (int, double,.. are no objects) this leads to faster performance.

      In contrast, C++ traditionally is associated with the Simula 67 school of object-oriented programming. In C++, the static type of an object fixes what messages it can receive. In Objective-C the dynamic type of an object determines what messages it can receive. The Simula 67 format allows problems to be detected at compile time. The Smalltalk approach delays typing until runtime and therefore is more flexible.

      A GNU version was written by Dennis Gladding in 1992 and then Richard Stallman took over the development. The current GNU version is derived from the version written by Kresten Thorup when he was a still a university student in 1993. He ported that version to the NeXTcube and joined NeXT.

      Apple chose Objective-C for Cocoa, as NEXTSTEP was based on Objective-C. But, even if they had written it from scratch, they might have decided to use Objective-C because it is object-oriented, which is undoubtedly a must for big software projects. It extends the standard ANSI C, so that existing C programs can be adapted to use the frameworks, and programmers can chose when to stick to procedural programming and when to go the object-oriented way. C was intended to be a good language for system programming. C is fine as it allows the programmer to do exactly what she wants, all the way down to the hardware. C also keeps the gold old pointers, which can be used for efficient code.

      Objective-C is simple, unambiguous and easy to learn. But most of all, it is the most dynamic language of all object-oriented languages based on C. Its dynamic late binding offers flexibility and power. Messages are not constrained by either the class of the receiver or the method selector, allowing rapid change and offering access to information about running applications.

      The following i

      --

      ---anactofgod---

      "Equal opportunity swindling - *that* is the true test of a sustainable democracy."
    2. Re:Objective C, pshaw by Jeremy+Erwin · · Score: 3, Informative
      Because NextStep has always used Objective C.

      The most striking difference is the message passing syntax. For instance, if "hello world" is a string,
      mystring.substring(2,5);
      returns "llo w" as a new C++ string, while
      [mystring substringWithRange:NSMakeRange(2,5)]; returns the same content as a Objective C NSString. (NSMakeRange is a C convenience function)

      Here's some code that interates through a C++ vector, invoking a method on each member.
      <ecode>
      for(myvectortype::iterator pos=myvector.begin(); pos !=mvector.end(); pos++)
      {
      pos->do_something();
      }
      or, more simply
      for_each(myvector.begin, myvector.end(), do_something());
      In Objective C, the NSArray colllection class is similar
      NSEnumerator *enumerator = [myArray objectEnumerator];
      id object;

      while (object = [enumerator nextObject]) {
      [object doSomething];
      }
      similarly, there's the more concise method:
      makeObjectsPerformSelector:@selector(doSomething);
      Objective C is also a dynamically typed language, which makes GUIs somewhat easier to write.

    3. Re:Objective C, pshaw by b17bmbr · · Score: 1

      actually, obj-c is quite powerful and easy to learn. i have been prgramming in perl, php, python, and java for several years. so, it is safe to say that i understand the basics of programming. i'm not a CS major, but picking up a new language is a matter of mechanics. i don't need to learn how to do conditionals, for instance. every time i tried to dick with linux and c, especially with gtk/gnome, it turned into a disaster. however, obj-c gives you the ability to call ALL c functions, and have OO code, and have some level of memory protection. it is awesome really. after you figure out the crazy [object method] crap, it is really powerful and the cocoa API is awesome. obj-c was a good choice. i was able to pick up cocoa/obj-c in a few days. far faster than mfc shit, or tkinter, or swing (blech).

      --
      My problem? I was perfectly gruntled, until some numbnuts came by and dissed me.
  19. No xcode? by tf23 · · Score: 4, Interesting

    From this review it says that the book starts out with how to start a Cocoa application project with Project Builder

    Where are the Xcode books???

    I'd love to see a "more up to date" version of this that deals strictly with using Xcode. That seems to be the tool of choice for the OSX Cocoa developer's future.(imho)

    1. Re:No xcode? by clichekiller · · Score: 4, Informative

      This book does use XCode, its a typo in the reviewers review. I've just started reading it and the first thing it has me do in the first example is fire up XCode so no worries there.

      --
      Sir, there is a dragon outside with an armful of armor. He's inquiring if we offer free refills.
    2. Re:No xcode? by xirtam_work · · Score: 1
      I agree entirely. I wanted to get started with Cocoa & ObjC only to find that every book I could find dealt with Project Builder!

      Seeing as this is a 2nd edition I would have thought that they'd had time to address this by know, as Xcode was released along with Panther (10.3) and there's plenty of Panther books around nowdays.

    3. Re:No xcode? by technomancerX · · Score: 2, Informative

      You'll note the review you linked to is for the FIRST edition and this is about the SECOND edition. The second edition is revised for 10.3 which includes XCode. You can identify the second edition easily as it seems to have a scary bright yellow cover. Hit the B&N link under the review to see a photo

      --
      .technomancer
    4. Re:No xcode? by BasilBrush · · Score: 2, Interesting

      Is XCode really that different from Project Builder and associated apps that came before? I've got the first edition of this book, that I worked through with Jaguar. Would I need to get the second edition too if if I wanted to use Xcode, or are the differences fairly minimal?

  20. MVC Shite!... by tonywestonuk · · Score: 2, Interesting

    I'm a Java programmer, and used to program Mac's in the system 7 era. So, I thought I'd take a look at using the Cocoa API. There is a java-cocoa tutorial on apples developer site, so I fired up x-code / Gui Builder and jumped in.

    After spending a good few hours understanding how to develop in this environment,I honestly think that the effort and pain needed to put together this simple currency converter app, is not worth it.... I could have done the same thing in any other environment (Swing/VB/ old Res-edit & Pascal), in minutes... What is the big deal surrounding MVC for a GUI?

    Tell me, Can I make a dynamic screen, that adjusts itself based on the data inside it (AKA Java Swing).... What about creating reuseable, database linked components, that can be dropped into any screen in a line of code?

    1. Re:MVC Shite!... by Anonymous Coward · · Score: 1, Funny

      What is the big deal surrounding MVC for a GUI?

      And that, my young padawan, is why you fail.

    2. Re:MVC Shite!... by BasilBrush · · Score: 1

      When you are learning anything new, you start with small examples, that don't really use the power of the new concept. For example it might be easier and quicker to do that simple currency converter app in a procedural language than an OO language, but that doesn't mean OO "is shite". When you come to do larger apps with multiple views, then, eventually, the benefits of MVC will become clear to you. Particularly if you want to do any unit testing of the non-UI bits.

    3. Re:MVC Shite!... by Anonymous Coward · · Score: 1, Informative

      I'm a Java programmer, and used to program Mac's in the system 7 era. So, I thought I'd take a look at using the Cocoa API. There is a java-cocoa tutorial on apples developer site, so I fired up x-code / Gui Builder and jumped in.

      After spending a good few hours understanding how to develop in this environment,I honestly think that the effort and pain needed to put together this simple currency converter app, is not worth it.... I could have done the same thing in any other environment (Swing/VB/ old Res-edit & Pascal), in minutes... What is the big deal surrounding MVC for a GUI?

      If you read the tutorial, it tells you what the big deal is. The MVC stuff is a nice way of separating your logical code from your GUI code. True, it wouldn't be needed for something as simple as the Currency Converter, but then, would you rather they give a tutorial on writing an incredibly complex piece of software? Just like any class in a university, the Currency Converter program is being used to demonstrate the MVC model. By using a small, simple example to give a hands-on experience.

      Tell me, Can I make a dynamic screen, that adjusts itself based on the data inside it (AKA Java Swing)....

      Yes, I believe I've seen this done. And using my limited knowledge, I can think of at least one way to try it, but haven't given it a shot yet.

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

      Don't know, but I assume so. Even if you can't, why judge a language/toolkit on a feature of another specific language/toolkit? Might as well say that Lisp is the best because I can do things in one line that take mid-sized functions in other languages.

    4. Re:MVC Shite!... by golgafrincham · · Score: 2, Insightful

      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.

      --
      beer as in "free beer"
    5. Re:MVC Shite!... by jrockway · · Score: 1

      I think GUI builders lead to poorly-designed interfaces, myself. I'm writing a rather large app in java right now, and I haven't designed any of the forms. I come up with an idea for how the form should work, then I add widgets to JPanels (to group them) and add those to layouts (and can repeat). The end result is a layout that looks good when the dialog comes up and continues to look good when the user resizes it. Plus, I didn't have to deal with some other programmer's naming conventions, or autogenerated code that gets munged every time I compile, etc. If you haven't done UIs by hand, you should consider it.

      --
      My other car is first.
    6. Re:MVC Shite!... by jamesmrankinjr · · Score: 4, Interesting

      Tell me, Can I make a dynamic screen, that adjusts itself based on the data inside it (AKA Java Swing)....

      Yuck. Gag. Barf. Retch.

      First off, MVC is really not very controversial. Most developers accept that MVC design is a Best Practice for applications with a significant user interface.

      Secondly, if you honestly prefer writing a ton of code to create a Swing GUI to drawing exactly what you want in IB and being done with it, you are a masochist. With bindings, it's even easier now to hook up the GUI to your model. And if you use a tool that generates the GUI code for you, you're justing putting the pain off a little bit. Sooner rather than later, you will need to dive into all that autogenerated code, and what you see won't be pretty.

      Thirdly, yes, I'm sure you can do the Currency Converter app faster in VB. BUT THAT'S BECAUSE YOU'RE MORE EXPERIENCED IN VB! Maybe you can save a small amount of time writing Currency Converter in VB if you eschew MVC design, but that's just because Currency Converter is not a serious application. Write anything more complex, and a good MVC design will give you a huge advantage in development time and code quality. It's a matter of being penny wise and pound foolish.

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

      Apple owned the definitive technology in this space. It was called Enterprise Objects (it kind of still exists but only Java and only works with WebObjects). Apple apparently decided it gave them too much of a competitive advantage for enterprise development and were afraid it might lead to success in that market segment, so they dropped Cocoa support for it.

      Peace be with you,
      -jimbo

    7. Re:MVC Shite!... by shawnce · · Score: 4, Informative

      I guess you don't understand very well how Apple's Interface Builder works or Cocoa (AppKit) in general. Interface Builder (IB) doesn't generate code (like most RAD tools do for other language/frameworks) it constructs real objects, connects those objects with each other and then archives that object graph to a file called a nib. Using IB you can test you interface without having to compile or building the application, simple use the live objects that you are working with (it has a test interface mode).

      When your application runs the nib is loaded as needed and that object graph is unarchived.

      You can implement rather complex GUIs without writing a single line of code yourself (more so now thanks to the contoller objects supported) and without any other tool generating code for you.

      If you haven't really used Interface Builder and AppKit you should consider taking it for a serious spin... often their is no need to code your GUI by hand.

      Also note that you can load a nib (with one or more views, etc.) and have its views inserted into the view hierarchy as needed and multiple times.

    8. Re:MVC Shite!... by Ilan+Volow · · Score: 3, Interesting

      Right now, I'm developing a Java app in Cocoa. I vastly prefer it to Swing because every Swing UI builder I've ever used is clunky while Interface Builder is simply elegant. And the nice thing about Java is that is has a large number of classes for stuff like X509 certificates and regular expressions don't really have counterparts in Objective-C (or if they do, crappy third-party counterparts).

      In regards to the dynamic sizing issue (if I understand the complaint correctly), you can have dynamically changing sizes. Open up an inspector for a control and select "Size" from the pop-up menu at the top. You should see a box within a box. Clicking on different areas of the box draws little springs--those springs represent in what ways the control is allowed to grow/shrink.

      The biggest advantage of the MVC for a GUI, IMHO, is portability. While the UI/View for my Cocoa app will be mac-specific, the logic/model for the app is completely cross-platform. I could probably also make the controller code cross-platform by wrapping it for the system I'm porting to, especially if that system supports the MVC paradigm.

      --
      Ergonomica Auctorita Illico!
    9. Re:MVC Shite!... by Fermata · · Score: 3, Insightful

      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!

    10. Re:MVC Shite!... by BasilBrush · · Score: 1

      MVC=Model-View-Controller, and has nothing to do with whether a GUI builer is used or not. I've done more MVC style apps wthout GUI builders than with.

    11. Re:MVC Shite!... by Archibald+Buttle · · Score: 2, Interesting

      Firstly as other people have said there is no surprise in the fact that you could program a currency converter app in another environment. The two main reasons are that you are not yet familiar with XCode and Interface Builder (IB), and secondly that the Currency Converter example is overdesigned to demonstrate the principles behind MVC.

      As for the dynamic screen that adjusts itself to the data inside it, of course you can do this. This has always been fairly easy to accomplish, but 10.3 adds a concept called "bindings" which builds on the MVC paradigm to allow UIs to automatically update whenever the underlying data model changes.

      As for re-usable database linked components, of course you can do that too, and if you do it right you don't need to write any code to reuse them. WebObjects is designed to do that kind of stuff, although of course there's a license fee involved. There's a few other frameworks available to for this which interface with Cocoa.

    12. Re:MVC Shite!... by HeghmoH · · Score: 1

      You can implement rather complex GUIs without writing a single line of code yourself (more so now thanks to the contoller objects supported) and without any other tool generating code for you.

      My favorite trick is the do-it-yourself web browser, done entirely in IB.

      Start IB, make a new empty nib, and drag a window into it. Drop a WebView in that window, size to your liking, and leave a bit of space at the top. Next, drag a text box into the window, then control-drag from the text box to the WebView, set its action to "takeStringURLFrom:". Then drag a button into the window, rename it to "Back", control-drag to the WebView, hook it to "goBack:". Press cmd-R, and you have a fully-functioning, albeit rather basic, browser. Type "http://slashdot.org" into the text box and away you go. (The http:// is not optional, unfortunately.)

      As a bonus, I'm making this post from a browser that I constructed in IB using this technique. It works great!

      --
      Mod down posts with a "Free Mac Mini/iPod" sig, they're spam!
    13. Re:MVC Shite!... by Anonymous Coward · · Score: 0
      geez, i'm not the only one cursing this pattern insanity nowadays.
      Have you ever noticed that the GoF have a section in their intro on MVC, but they don't call MVC a design pattern itself. Instead they describe all the patterns contained with in it. I'm convinced that most people who talk about the MVC pattern have no idea what they are doing.
  21. Aaron Hillegass - a personal opinion by anactofgod · · Score: 5, Informative

    I was an consultant for Apple back in the heady days right after NeXT acquired Apple, when Jobs was Apple's "interim CEO" (the term "iCEO" hadn't been coined yet). I had the good fortune of taking a class taught by Aaron on advanced WebObjects programming.

    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'm gonna pick up this book asap.

    ---anactofgod---

    --

    ---anactofgod---

    "Equal opportunity swindling - *that* is the true test of a sustainable democracy."
    1. Re:Aaron Hillegass - a personal opinion by Pixie_From_Hell · · Score: 2, Insightful
      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.
  22. for those of you that like openstep & linux by Anonymous Coward · · Score: 3, Informative

    Here's an openstep workalike for linux, they even have "Project Builder" and "Interface Builder".

    GNUStep project

    useful for getting your feet wet with Objective-C (pretty good) and the *step frameworks.

  23. Oldie but goodie by Anonymous Coward · · Score: 3, Funny

    Real Programmers don't write specs -- users should consider themselves lucky to get any programs at all, and take what they get.

    Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.

    Real Programmers don't write application programs, they program right down on the bare metal. Application programming is for feebs who can't do system programming.

    Real Programmers don't eat quiche. They eat Twinkies. And Szechwan food. (Do not go to eat Szechwan food with a group of Real Programmers unless you are prepared to argue bitterly over the last spring roll.)

    Real Programmers aren't scared of GOTOs... but they really prefer branches to absolute locations.

    Real Programmers don't write COBOL. COBOL is for wimpy application programmers.

    Real Programmers' programs never work right the first time. But if you throw them on the machine they can be patched into working in "only a few" 30-hour debugging sessions.

    Real Programmers don't write in FORTRAN. FORTRAN is for pipe stress freaks and crystallography weenies.

    Real Programmers never work 9 to 5. If they are around at 9 AM, it's because they were up all night.

    Real Programmers don't write in BASIC. Actually, no programmers write in BASIC... after age twelve.

    Real Programmers can take the scissors off the phone cord.

    Real Programmers don't write in PL/I. PL/I is for programmers who can't decide whether to write in COBOL or FORTRAN.

    Real Programmers don't play tennis, or any other sport which requires you to change clothes. Mountain climbing is OK, and Real Programmers wear their climbing boots to work in case a mountain should suddenly spring up in the middle of the computer room.

    Real Programmers don't do documentation. Documentation is for simps who can't figure out the listing.

    Real Programmers don't write in PASCAL, or BLISS, or ADA, or any of those pinko computer science languages. Strong typing is for people with weak memories.

  24. Good book, but by ashpool7 · · Score: 4, Informative

    This book combined with "Learning Cocoa with Objective-C" and AppKiDo is invaluable for a novice Objective-C programmer.

    However...

    Complete knowledge of the AppKit and the Foundation is essential to writing good Cocoa programs (To a lesser extent CoreFoundation (horribly documented!) and Carbon). There are plenty of objects I found post-facto that would have made my life easier had I known they existed. I have yet to find a single book that does this well.

    Currently, the best way to start developing (and gain the kit knowledge) in Cocoa is to read these two books and then just try and develop a program, all the while stopping and searching AppKiDo for useful objects that you think may exist.

  25. Really real men ... by burgburgburg · · Score: 1
    HAND code everything in assembly, from memory, in the dark.

    While the building is on fire.

    1. Re:Really real men ... by Anonymous Coward · · Score: 0
      HAND code everything in assembly, from memory, in the dark.
      While the building is on fire.

      You use buildings? What a pussy.

  26. Better Than This Book? by Black-Man · · Score: 1

    O'Reilly... a well respected publisher (and have bookshelf full of their titles) and Addison Wesley.. another respected publisher.

    Which one to choose if you could only choose one? Thanks.

    1. Re:Better Than This Book? by SGHarms · · Score: 1

      Black,

      I've been trying to become King Cocoa for about a year now with various fits and starts. I've had a really hard time with it.

      I don't think that my difficulty is unique or un-understandable either. Obj-C requires a fundamentally different conception of how to program.

      I know a little C, a litttle java, and a lot of perl. In each of these languages within the first 5 pages of any of those books you're generally feeling good about things like print(), ++, and x= y+1. You see, you have a hold of some critical fundamentals, and you're ready to rock!

      You go through the entirety of Davidson's (and don't get me wrong, i have emailed him personally and said i've learned a lot from his book) book and well, to be honest, I feel as though I have created a bunch of programs witchout having understood the fundamental theory of programming in Obj-C.

      It's like recording in a log book a thousand events of a ball falling from the tower of Pisa -- you still ain't uncovered Gravitation to make all those incidents coherent (aristotelianism vs. platonic science, for those philo. of science fans at home).

      I just started Garfinkel's book to see if it can help me get to that meta core -- but so far, no luck.

      My company has the ORA bookshelf and v.1 of this book -- and i've found a few answers on it...

      But i can't help feeling that all the Obj-C books are falling short of the mark --- they all seem to leave me fuzzy on how to actually do something.

      This is further exacerbated by the fact that so much of Obj-C's core functions are things that you simply have to memorize (or better yet, have easy access to the reference docs). In Perl, it's just Do it (tm) - in Obj-C it's 'look up which methods you need to override and get the data there and we'll do it for you' -- it's well, frustrating, to someone who's used to getting actual work done quickly in code.

      all that said, i like writing in Cocoa (mostly b/c i want Mac to do well) but the learning curve seems pretty whacked.

      It's worth doing, but don't count on being able to implement Your Great Idea for OSX quickly.

      That said, maybe I'm insuff. CompSci oriented....but i don't think it should be this hard -- heck xcode and IB were supposed to make development easier.

  27. NSController by Ilan+Volow · · Score: 5, Informative

    Among the things he adds in the 2nd edition is a piece on NSController, a neat feature that saves you a ton of time you'd otherwise spend creating GUI glue code between your view and controller layers. He also includes some info on creating frameworks, which is kind of hard to come by in most mac programming books.

    --
    Ergonomica Auctorita Illico!
  28. yum by SKPhoton · · Score: 2, Funny

    Ah, so they have Java and Cocoa now, eh? In that case, I have just one question for you:

    Cream or sugar?

  29. Another OBG - Klingon SW Quality Assurance by anactofgod · · Score: 2, Funny


    * Perhaps today is a good day to die... I say we ship it."

    * Specifications are for the weak and timid!!

    * This machine is a piece of GAGH! I need dual Pentium (!) processors if I am to do battle with this code.

    * You cannot really appreciate Dilbert unless you've read it in the original Klingon.

    * Indentation?! I will show you how to indent when I indent your skull!

    * What is this talk of 'release'? Klingons do not make software 'releases'. Our software escapes, leaving a bloody trail of designers and quality assurance people in its wake!

    * Klingon function calls do not have "parameters" - they have "arguments"- and they ALWAYS WIN THEM.

    * Debugging? Klingons do not debug. Our software does not coddle the weak.

    * I have challenged the entire Quality Assurance team to a Bat-Leh contest! They will not concern us again.

    * A TRUE Klingon warrior does not comment his code.

    * By filing this bug report you have challenged the honor of my family. Prepare to die!

    * You question the worthiness of my code? I should kill you where you stand!

    * Our users will know fear and cower before our software! Ship it! Ship it and let them flee like the dogs they are!

    (sources too numerous to attribute)

    ---anactofgod---

    --

    ---anactofgod---

    "Equal opportunity swindling - *that* is the true test of a sustainable democracy."
    1. Re:Another OBG - Klingon SW Quality Assurance by jcr · · Score: 2, Funny

      Thanks for reminding me why I shouldn't hire anyone who shows up for an interview wearing a klingon insignia.

      -jcr

      --
      The only title of honor that a tyrant can grant is "Enemy of the State."
    2. Re:Another OBG - Klingon SW Quality Assurance by Ilan+Volow · · Score: 1

      Klingons do not release (see parent post).
      Your signature has a [ObjC retain] without having a matching [ObjC release].

      Therefore, you are technically Klingon.

      --
      Ergonomica Auctorita Illico!
    3. Re:Another OBG - Klingon SW Quality Assurance by jcr · · Score: 2, Funny

      I'll release ObjC when I'm done with it. That's not going to be anytime this year.

      -jcr

      --
      The only title of honor that a tyrant can grant is "Enemy of the State."
  30. Reference by Ann+Coulter · · Score: 3, Interesting

    I perfer Cocoa Programming by Scott Anguish. It is a great Cocoa book as it describes many aspects of Cocoa, not just making a GUI like most books I've seen. It describes the philosophy, principles, design, and even implementation of Cocoa. It is more in-depth than any Cocoa book I've seen. It is the only Cocoa book I know of that contains more than 1000 pages. And as for value, it is an invaluable reference to any Cocoa programmer and the cost is not much either as you can find it in some outlet book stores for about twenty dollars. I would certainly recommend Cocoa Programming to anyone interested in developing for the Macintosh OS Ten.

    1. Re:Reference by jcr · · Score: 3, Informative

      Actually, that book is by Scott Anguish, Erik Buck, and Don Yacktman. I'd recommend it in addition to, but not instead of Aaron's book. The two books have entirely different purposes.

      Aaron's book is the text that he wrote for his one-week course. Anguish, Buck & Yacktman's book is more of a comprehensive reference, with a great deal of material on style and techniques that just can't be covered in an introductory text.

      -jcr

      --
      The only title of honor that a tyrant can grant is "Enemy of the State."
    2. Re:Reference by Anonymous Coward · · Score: 0

      Way to post a link that gets you money. How honest.

    3. Re:Reference by Anonymous Coward · · Score: 0
      I must also recommend Cocoa Programming by Anguish, Buck and Yacktman. It's not as easy to use to learn Cocoa from ground zero, but it's certainly an excellent text for using Cocoa on a daily basis. It's also the book for old NeXTstep programmers moving to to Cocoa (like me).

      I note that I've got four Obj-C books right now next to each other on my shelf: Apple's Learning Cocoa (crap), Hildegrass's book (quite good), Anguish/Buck/Yacktman's book (quite good), and an original copy (!) of NeXT/Addison Wesley: Object Oriented Programming and the Objective C Language. :-) Now only available online I'm told...

  31. Porting your apps to Mac users by richmaine · · Score: 1

    "...porting your apps to Mac users..."

    Interesting idea. I thought most Mac users had to be programmed in English, though. :-)

    1. Re:Porting your apps to Mac users by Anonymous Coward · · Score: 0
      Interesting idea. I thought most Mac users had to be programmed in English, though. :-)

      Actually, no. Most Mac users have to be programmed in pictures.

      (And I'm using a Mac right now, actually...)

  32. Please explain by Shimmer · · Score: 1

    If you are experienced in C++ or Java programming, Cocoa development will seem familiar enough. Objective-C is used throughout the book.

    Are you saying that familiarity with C++ or Java is sufficient to learn Objective-C with no further effort? Or perhaps you're saying that the book teaches me how Objective-C along with Cocoa?

    Without some sort of clarification, the two sentences above seem rather contradictory.

    --
    The most rabid believers in American Exceptionalism are the exact same people whose policies are destroying it.
    1. Re:Please explain by BasilBrush · · Score: 1

      The book does indeed tech programming in Obj-C as well as Cocoa, but only at the level of the differences from other OO languages. Hence the prerequisite for C++ or Java. I do C++ and had no problem picking up enough Obj-C from this book to get by. But it's probably too advanced for someone who's not already up to speed with OO GUI programming of some sort.

    2. Re:Please explain by TheRaven64 · · Score: 1

      Objective-C is a very simple language, and takes under a day to pick up if you are already familiar with OO concepts, however it has little in common syntactically with C++ or Java. If you know C and understand OO design then you should have no problem with Objective-C.

      --
      I am TheRaven on Soylent News
  33. Soungs good, but not on Safari... by SuperKendall · · Score: 1

    It does not look like even the first edition of this book is on Oriley's Safari site (they do have other Addison-Wesley books), which is very unfortunate. Hopefully with the new update they'll consider moving the book online.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:Soungs good, but not on Safari... by buckhead_buddy · · Score: 1

      Perhaps O'Reilly feels that this book's audience too closely overlaps the one for their "Learning Cocoa on Mac OS X" book.

      Perhaps O'Reilly paid through the nose to be the exclusive "Apple Developer Connection Approved Documentation" label (or whatever the exact phrase is) and simply doesn't want to share.

      Perhaps there is some bad blood betwixt Mr. Hillegass and his former employer (Apple/NeXT).

      There are many possibilities, but my suspicion is that you won't see this great Addison-Wesley book show up on the O'Reilly website.

  34. No referral link in URL, try it and see. by Anonymous Coward · · Score: 0

    I like to smash and bash the Amazon-sponsor-link trolls as much as anyone, but this has no referral link in it. The "ref" completely valid -- in fact, try it yourself from the main Amazon page. You'll get it.

    To spot referral links, look for the string "-20" after a suspicious looking username, like "ccats-20". That's your tip-off.

  35. What is the world coming to? by Abjifyicious · · Score: 1
    Assembly?!?

    What ever happened to creating binaries from scratch in a hex editor??

    1. Re:What is the world coming to? by Anonymous Coward · · Score: 0

      What ever happened to creating binaries from scratch in a hex editor??

      Believe it or not... I've done it.

      Only for a simple VM, but it still counts, right?

  36. Moderated funny? by NSAnonymousCoward · · Score: 2, Insightful

    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...

    1. Re:Moderated funny? by erikvcl · · Score: 1

      Mod parent up!

      I'd mod it up myself if I wasn't already meta-moderated to hell.

  37. Where's the project builder? by djohnsto · · Score: 1

    So I looked on that site and found Gorm (Interface Builder), but where exactly is the project builder clone?

    --
    Dan
    1. Re:Where's the project builder? by TheInternet · · Score: 1

      but where exactly is the project builder clone

      Project Center

      - Scott

      --
      Scott Stevenson
      Tree House Ideas
    2. Re:Where's the project builder? by djohnsto · · Score: 1

      Would be nice if they listed that in, say, the official GNUStep Application Database, under, hmm, development tools...

      --
      Dan
    3. Re:Where's the project builder? by Art+Tatum · · Score: 1

      The App Database (and the web design itself) is new and not everything has been moved yet. They probably should have waited on replacing the old site until things were a little more complete, though.

  38. Re:MVC Rocks! by kwerle · · Score: 1

    After spending a good few hours understanding how to develop in this environment,I honestly think that the effort and pain needed to put together this simple currency converter app, is not worth it.... I could have done the same thing in any other environment (Swing/VB/ old Res-edit & Pascal), in minutes... What is the big deal surrounding MVC for a GUI?

    As could I with xcode/IB.

    Tell me, Can I make a dynamic screen, that adjusts itself based on the data inside it (AKA Java Swing)....

    Sure.

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

    If you feel you need to write code to do that, you're doing something wrong. You should be able to drop something like that into your screen in ZERO lines of code.

  39. Aaaahgh!! I just bought the first edition!!! by d00ber · · Score: 1

    ...

    Oh well.

    One thing that is recent and got put into GCC 3.4? is Objective-C exception handling with @try @catch, @throw. Is this in the new book?

    I can't find the message in the GCC mailing list about which version introduced objective C exceptions.

    1. Re:Aaaahgh!! I just bought the first edition!!! by Acrimonious+Coward · · Score: 1

      Do you know if this addition is from Apple or from the GNUStep people? If it's not an Apple sanctioned addition to the language, it probably won't be in the Cocoa spec.

    2. Re:Aaaahgh!! I just bought the first edition!!! by Art+Tatum · · Score: 1

      The actual compiler guys from Apple are (gradually) contributing their changes back into GCC mainline. I think they're even working on Objective-C++ support in GCC.

  40. Controller objects/cocoa bindings by TheInternet · · Score: 1

    You can implement rather complex GUIs without writing a single line of code yourself (more so now thanks to the contoller objects supported

    Recently wrote an article on this, for those that are interested:
    Introduction to Bindings

    - Scott

    --
    Scott Stevenson
    Tree House Ideas
  41. Better "dive in" well before... by macserv · · Score: 3, Insightful

    ... 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.

    1. Re:Better "dive in" well before... by Jeremy+Erwin · · Score: 2, Insightful

      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.

    2. Re:Better "dive in" well before... by Art+Tatum · · Score: 1

      Objective-C++ is serviceable for its initial purpose: making easy calls to C++ libraries from Objective-C code. But it's kind of like the infamous flying car: the design philosophies are so divergent that it just doesn't work when you try to make serious use of it.

  42. What part of "Think Different".... by Anonymous Coward · · Score: 0

    do you not understand? Geez, Objective C is used because it's different. It's also better as is all things that Apple does. Even when Apple gets them from somebody else and said it was stupid before they got them. Objective C is good for you. Shut up and drink the koolaid.

  43. A few addenda by buckhead_buddy · · Score: 4, Informative

    I think Spencerian probably answers 90% of the questions most people have about this book: author qualification, tools required, prequisite expertise required, and changes from the original. I won't get involved in the flame wars about Objective-C versus Java and Mac OS X versus GnuStep, but I do have some additional comments (maybe better stated as additional opinions).

    Tools:
    You must have Panther (10.3) or later to use this book. It was possible to read the first edition (written for 10.1) and make some mental leaps forward, but the reverse is impossible. Besides the differentces between XCode and the GUI screenshots, Apple deprecated a number of methods (like takeValue:forKey:) in favor of much cleaner names (e.g. setValue:forKey:). Aaron doesn't mention the deprecated names (quite rightly IMHO) so that will make the Jaguar programmer have to refer to Apple's website to do the translation back to the older APIs. You may need to do mental exercises like that when you have to read someone elses code or when you're back porting your app, but if you're still learning, be sure to get Panther before trying to use this book.

    Presentation:
    Many of the books screenshots look much cleaner than the prior version. I think that's mainly attributable to Apple deciding to tone down much of the visual clutter in the Aqua theme. The lack of the pinstripes in windows and menus really makes the documentation much easier on the eyes. The change is really much more dramatic and makes for a much more readable book.

    If You Read the First Edition:
    I've read the first edition, and I have to say that I got impatient with much of the earlier portions of the book. I wanted the examples for Bindings and other new additions to Cocoa. I was already comfortable with the trivial examples in the early chapters, so it was hard to force myself to go back and really read and work through them. Do it. I remember most of the big points made, but some of the subtler points make more sense now. Whether these were in the last edition, I'm not certain but it was still good a good review.

    Applicability to a New Programmer:
    I'll underscore that this isn't for a new programmer. If you are new to C, I'd suggest reading the non-GUI text "Programming in Objective-C" by Stephen G. Kochan. An extensive background in object-oriented programming isn't as necessary (and in fact may be detrimental if your background is multiple inhereitance of the C++ world). But it does include some tips and advice on good OO techniques that Objective-C programmers use. You won't see any explanation on pointer tricks, handles, NULL, or many of the other plain C conventions. If you are a strong Unix programmer, you may feel more comfortable reading the Aaron Hillegass and Mark Dalrymple's "Core Mac OS X and Unix Programming" first. That book is billed as the sequel to this one (and it does use a little bit of Objective-C code), but it probably addresses your interests far more than this Application-centric book does.

    The lessons of this book are quite worthwhile to certain audiences, but finding whether you are a target for it's wisdom may be tricky. Don't get frustrated. If you find it to be over your head, read another intro book but I'd definitely come back to this one at some point in the future.

  44. Re:MVC Shite? by buckhead_buddy · · Score: 1
    Another Addison-Wesley book called Design Patterns, Elements of Reusable Object-Oriented Software written by a gang of four programmers might explain the advantages and limitations behind something like the Model/View/Controller pattern more clearly than Apple's or Mr. Hillegass's references

    The Currency Coverter is really designed to show this pattern at it's most simple. Sure there are all sorts of short cuts you can take if you are really writing a simple currency converter, but the point of the exercise is to show those people who already find value in this common pattern how to go about doing something this basic.

    Actually, there's another book that many Cocoa programmers should probably check out besides the Gamma book. It's an Addison-Wesley book called The Design Patterns Smalltalk Companion and it's pretty easy to make the mental leap and convert their design advice to Objective-C. (There are other books that probably do this better if your interest is Java).

    As an aside, there's a lot of great advice in these two books that Apple clearly had in mind when developing Cocoa. As much as I brissle at the original poster's comment about the "value" of MVC, it disappoints me how few Cocoa programmers recognize their applicability. Please don't limit your Cocoa education to simply books that have Cocoa in the title.

  45. Don't really need to know C++ nor Java... by Whatchamacallit · · Score: 2, Insightful

    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.

  46. Differences from the first edition? by cnladd · · Score: 1

    I have the first edition of this book, and found it to be excellent. I'd consider it the first of two essential books for Cocoa programming (the second being the O'Reilly book, which I use as a class reference).

    I've seen the list of what's been updated, but it isn't enough to convince me that getting the second edition is worth the price if you already own the first. Are the differences enough to warrant the additional investment?

    --

    --
    Welcome to the land of the easily amused...

  47. Cocoa or Carbon? Daddy or Chips? by Tim+Browse · · Score: 1

    Right, here's a question that pops into my head whenever I see references to Cocoa/Carbon on slashdot...

    See, I've written some libraries that I use to write my apps, and I deliberately chose to make them portable, in case I ever decided to switch from Windows to Linux or Mac OS X - so I wouldn't end up losing all my software (or having to put a lot of work into porting them).

    So I have APIs for general OS interface and GUI programming, which I designed to be portable, having passing familiarity with Linux and Mac OS APIs. The libraries are currently implemented for Windows, but I try to wrap Windows specific functionality in a generic 'GUI' way (something I wish other libs would do a bit more, wxWindows I'm looking at you).

    Anyway, the libraries have a C++ interface, and are implemented in C++ on top of Win32.

    My question is: if I want to create Mac OS X versions of these libraries, should I use Carbon or Cocoa?

    My understanding is that both will work, but Cocoa is the nice shiny API that does all the clever stuff, and Carbon is being phased out, and I shouldn't use it. So new UI widgets, dialogs, various functionality have clean, comprehensive implementations via Cocoa, and Carbon is a sort of DIY solution if you want to use the new stuff. I'm also not sure how well IB works with Carbon (if at all).

    But: Cocoa seems heavily oriented towards Objective C. It seems possible to mix C++ and Obj-C in an app, but how feasible is it for me to implement a version of my lib that exposes a C++ interface, yet uses Cocoa/ObjC internally? And even if it works, would it be full of nasty hacks?

    If any Mac programmers can offer me any insight here, I'd be grateful.

    Please note that such insight does not include "You should just use Objective C for everything", just to warn you in advance. I use C++ because of its ubiquity, my familiarity with it, and the large amount of code I already have that uses it. Objective C might be absolutely wonderful, but as all I ever hear about it is this fantastic new (sic) idea called MVC, it's hard to tell :-)

    If I'm going to learn/use a different language, I'd rather try something really portable like Python. Objective C still seems like an 'oddball' language to me, that's only used on Macs. While I want to support Macs with my libraries, I'm not re-architecting and re-writing the whole lot just because Apple decided the preferred interface to their OS/GUI was an OO interface, and they wanted to use Objective C, because NeXT used it.

    Thanks....

    1. Re:Cocoa or Carbon? Daddy or Chips? by davidcake · · Score: 2, Informative

      I've taken a look at the same problem recently.
      My feeling is that while Cocoa is a better choice for developing Mac OS X specific stuff, Carbon may end up being more similar to other platforms, and so possibly a bit easier for this specific use. Cocoa is still very doable for the same problem - but essentially, I suspect many C++ methods would just end up being a call to an equivalent Cocoa method (though often one you've written yourself). Mixing C and C++ is not particularly ugly or hackish in most cases. You can more of less mix the two syntaxes easily enough with Apples Objective-C++ support.

      It kind of depends on your specific libraries, though. If your libraries are such that your objects correspond fairly closely to Cocoas, you might be better off using Cocoa.

      The real value of Objective-C lies in its dynamic nature, which if you were writing a cross-platform C++ library you might not be able to make much effective use of.

      I wouldn't worry that Carbon is being phased out, or that there will be new shiny functionality only accessible from Cocoa. In my experience thats not really the case at all. There is definitely functionality only accessible from Carbon (and lots of it) and Carbon is quite well supported. A lot of non-GUI Cocoa stuff (FoundationKit) is more or less duplicated with CoreFoundation (which is a straight C interface, accessible from both and interoperable with corresponding Cocoa classes). Lots of important apps are written in Carbon. Carbon works well with interface builder (you end up writing a LOT of event handlers, but they are straightforward).

    2. Re:Cocoa or Carbon? Daddy or Chips? by Art+Tatum · · Score: 1
      But: Cocoa seems heavily oriented towards Objective C. It seems possible to mix C++ and Obj-C in an app, but how feasible is it for me to implement a version of my lib that exposes a C++ interface, yet uses Cocoa/ObjC internally? And even if it works, would it be full of nasty hacks?

      I wouldn't do it. Objective-C++ is really intended for making calls to C++ libraries from Objective-C code. The languages are just too different to be very robust for the kind of thing you want to do. I understand that templates cause great difficulty, for example.

      Please note that such insight does not include "You should just use Objective C for everything", just to warn you in advance.

      My advice: just use Objective-C. :-) On a more serious note, I think if you're absolutely committed to porting your libraries, Carbon is probably the way to go. I've never used it; but I think it's more similar to your current win32 backend code than Cocoa will be anyway.

      Objective C might be absolutely wonderful, but as all I ever hear about it is this fantastic new (sic) idea called MVC, it's hard to tell :-)

      Heh, you probably got hold of one of those "introductions to Objective-C" that was written by NeXT marketing back in 1988. One of the things Apple did was to take the old NeXT documents, replace all instances of 'NeXT' with 'Apple' and slap them up on their website. They've been steadily updating and replacing them but there's still a lot of old cruft in there. Briefly, Objective-C is Smalltalk grafted onto ANSI C. You get dynamic binding and typing and all that good jazz, while still having fast native-compiled code. If it helps to place the concepts, Java was heavily modeled on Objective-C.

      If I'm going to learn/use a different language, I'd rather try something really portable like Python. Objective C still seems like an 'oddball' language to me, that's only used on Macs.

      Actually, it is portable. The language itself is supported by GCC. And GNUstep is an LGPL'd implementation of the Foundation and ApplicationKit frameworks which runs on UNIX and Windows systems.

  48. fuck you by Anonymous Coward · · Score: 0

    you're koo-koo for negro cockz

  49. Aaron Hillegass - a FEMALE's personal opinion by Anonymous Coward · · Score: 0

    You might think so, but when I worked at NeXT, he was creepy. He started stalking me around the office and eventually he moved into a condo right across the street from me. Fortunately, I got a new job in San Diego and that was the last I heard from him.

    1. Re:Aaron Hillegass - a FEMALE's personal opinion by bignerdranch · · Score: 1

      I think you must have me confused with someone else:

      • I've never stalked anyone in my life.
      • I've never lived in a condo. The only place that I have ever lived in California is in a house on Forest Avenue in Palo Alto.
      • I know that you are a woman who worked at NeXT and that you moved to San Diego, yet I have absolutely no idea who you are.
      I really don't think that I am your stalker.

      If it actually was me who made you feel uncomfortable, I'm very sorry. No one should be made to feel uncomfortable in their workplace.

      Sincerely,
      Aaron Hillegass

  50. Quake? Lies by harveyswik · · Score: 1

    It's a common misconception, but neither of those games were ever written in Objective-C. Here Carmack talks about it:

    http://www.gamers.org/dEngine/quake/QuakeEd/qedi t_ info.html

    And here's the code for QuakeEd:
    http://www.gamers.org/dEngine/quake/Quak eEd/source .html

    I can't find the references for Nuclear Strike right now but it's the same case where the Map Editor was written in Obj-C.

    1. Re:Quake? Lies by Art+Tatum · · Score: 1

      Carmack did all his development on NeXT machines for a long time and used Objective-C to rapidly build development tools. But, as you say, he didn't actually use Objective-C for the games themselves. There was an interview with him in Game Developer magazine back in 1994 where he raves on and on about the greatness of NeXT and shows a lot of DooM code in ProjectBuilder.

  51. It's in the Apple Docs by TheInternet · · Score: 1

    Do you know if this addition is from Apple or from the GNUStep people? If it's not an Apple sanctioned addition to the language, it probably won't be in the Cocoa spec.


    It's in the Apple docs for Objective-C.

    - Scott

    --
    Scott Stevenson
    Tree House Ideas
  52. Key Value Coding in Java (Cocoa) by akihabra · · Score: 1

    If you could point me towards a source that has the KVC Currency Converter example written in Java I would be extremely grateful. Apple KVC Obj-C Sample

    I can't seem to find an interface anywhere that provides the method setKeys(), which results in none of my classes being key value coding compliant.

    It's a shame, because the Cocoa controllers look amazingly useful. I guess I've found out why the book recommends using Obj-C :( Java seems to be a second class citizen in Cocoaville.