Questions About Cocoa and Mac Programming

Discussion in 'Mac Apps and Mac App Store' started by Fender2112, Jul 25, 2003.

  1. Fender2112 macrumors 65816


    Aug 11, 2002
    Charlotte, NC
    I have wanted to learn Mac programming for a long and have never taken the time to do it. A few weeks ago I decided to embark on this adventure. I am currently take an online course for C++ at and well be taking a C++ course this fall at a community college. I chose C++ because I understood it to be the language of chioce for Mac programming.

    Tonight I was at a local book store browsing some books on Cocoa. Several of the books mention Objective-C as being the prefered language for Cocoa programming.

    My questions:

    1. How different are C++ and Objective-C?
    2. Which should I focus on?
    3. What would be an appropriate path to take to learn Mac programming.

    I'm doing this as a hobbie, not as a career. As such, I will only be taking even classes or online selfpased courses.

    I will be most greatful for any advice.
  2. Vlade macrumors 6502a


    Feb 2, 2003
    Meadville, PA
    I am programming in Objective-C/Cocoa right now, and all I can say is its awesome!!! I haven't done much with C++, but if your doing Mac Only stuff (not porting to PC) than Object-C/Cocoa is better with Project Builder. I recomend you stick with c++ because Code warrior was made for it, and Project Builder was made for Cocoa mostly.

    I have to go now, sorry for the brief reply.
  3. shake macrumors regular

    Aug 14, 2002
    Toronto, CANADA
    stick with C++... what you will learn about object-oriented programming will benfit you when you eventually start using cocoa(obj-C). I am also taking programming as a hobby in school. I took Java, then C, now C++... once you know the ideas in object oriented programming, obj-C is not that bad.
  4. cubist macrumors 68020

    Jul 4, 2002
    Muncie, Indiana
    Just to clarify: Both Objective-C and C++ were born as object-oriented extensions to C. They are completely incompatible with each other, but both can work with C.

    If you have CodeWarrior, you can use C++ with libraries to work with Carbon. If you wish to use the Cocoa libraries, which they call "frameworks", you must use Objective-C.

    The original purpose of Carbon was to make it easier to port existing (legacy) Mac code to work with Mac OS X. As such, the Carbon API is complicated for new programmers. I was disappointed in the CodeWarrior tools for learning Carbon; they are much like pointing to the pedals on a bicycle, saying "put your feet here", end of lesson.

    The O'Reilly book "Learning Cocoa" has surprised me by being much better than I expected. It explains things.

    I've been programming C since well before the Mac ever appeared, so I'm not a novice programmer. Of the two, I think that Cocoa does appear to be a faster way to get from square zero to a working program.

    If you're concerned that it will be a Mac-only program, there is a GnuStep project underway which may lead to cross-platform compatibility of Cocoa applications.
  5. Vlade macrumors 6502a


    Feb 2, 2003
    Meadville, PA
    Actually you can program in Objective-c++, but its pointless and compile times take FOREVER
  6. Catfish_Man macrumors 68030


    Sep 13, 2001
    Portland, OR
    For a hobby, Objective-C/Cocoa will be infinitely more fun and intuitive than C++/Carbon. C++ is powerful, but it does crazy things with pointers, and has some really weird difficult to understand things. Objective-C and Java are both easier and more fun. I'm writing a Newtonian gravity simulator in Cocoa. It's about 50 times as cool as any other program I've worked on, while using about the same amount of code and not taking as long.
  7. johnnowak macrumors 6502

    Jul 24, 2003
    New York, New York
    I personally am avoiding Cocoa, at least for now, for reasons of portability.

    But yes, for OS X, Objective-C is probably the way to go.

Share This Page