Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Fender2112

macrumors 65816
Original poster
Aug 11, 2002
1,141
403
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 CodeWarriorU.com 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.
 
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.
 
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.
 
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.
 
Originally posted by cubist
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.

Actually you can program in Objective-c++, but its pointless and compile times take FOREVER
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.