Carbon is a C/C++ API, and Cocoa is an API for Obj-C. I'd recommend going the cocoa route, it's far easier to learn. Carbon pretty much just around for porting C/C++ programs and for those who did Mac programming in the pre-OSX days.

I don't think I really use either Carbon or Cocoa. Technically I use Cocoa for SDL but other than that I'm just using C++. I would recommend Cocoa however as there are some very useful functions to use when reading/writing files as well as other things. The downside to Cocoa is the inability to be easily ported.

If you plan on writing a game - C/C++ for the low-level graphic routines and either C/C++ or scripting language like Python/Ruby/Javascript for the game logic.

If you are writing a game - look at all the free/open libraries available to you. If you are making a 3d game look at Dim3. If you are making a 2d arcade game look at SDL. Look at cross-platform libraries for your image and audio needs.

ObjC and Cocoa is definitely the way to go for regular user interface programming, and Carbon is the API of choice to access the OS from C/C++. There is no general best way to go, always get the right tool for the job.

I use the diagonalization principle, and for each of their arguments, I take the opposite of what they say, I form a programming language you should use based on that. Since no such programming language exist, you should either:
a) not program
b) program in whatever you damn well please cause I know that most of the time, whatever we say in regards to what a person should program rarely ever changes what they eventually program in.

Everyone has posted some really good advice thus far. All I'll say is:

I'm in the same boat as you, C/C++ is my primary language for over 5 years (4 of it professionally). When I started learning Cocoa, it took me a lot longer to get use to that style of coding than it did to actually learn the concepts, syntax, and Cocoa API. Often I would try to do things that weren't legal in objective-c, or just not how it's suppose to be done.

I then went to learn Carbon for a while. I felt a little more comfortable there because it's at least a language I'm more familiar with. But my stumbling block was the fact that I've been a Windows programmer for so many years, the most notable difference was the way message and event handling was done.

So whatever your background is, if you can let go of old habits it'll be easier. I've done Windows programming, PalmOS, Linux, BeOS. But MacOSX is an entirely new beast to me.

Specifically with game development, I often hear that using the C language is better because there's less overhead. The "overhead" is in regard to object-oriented languages and data structures. Using smaller, tigher, "struct" data types rather than entire classes may yeild more performance than making everything a class. On the other hand, it does limit you feature-wise, of what you can do in code. If you have a good handle on inheritance and code reuse, C++ might be very useful and almost if not as fast a C code.

There's been a lot of talk about which is better performance-wise: Carbon on Cocoa. I use to hang out in other Mac forums and I notice that there's a lot of misconceptions out there. Many Mac users still don't understand that Carbon has been updated for OSX and the Mach-O executable format. Long story short, the binaries are equally fast. But the more you rely on the API and framework, that's where I believe the differences start to be more clear. For example: I wouldn't consider using too many Cocoa classes that encapsulate data types. Like if I wanted to convert a string of text into a float or an int, the C runtime has functions for that type of operation which I'd gladly use over the NSString object to do the conversion.

With Carbon, I'm a little annoyed when it comes to strings. There's a difference between a Carbon string and a C string, and they're not always compatible. So that involves a string conversion routine before the 2 can be interchanged, and that costs time and memory.

Vertizor Wrote:With Carbon, I'm a little annoyed when it comes to strings. There's a difference between a Carbon string and a C string, and they're not always compatible. So that involves a string conversion routine before the 2 can be interchanged, and that costs time and memory.

I'm curious what you mean when you say "Carbon string". There's CFStringRef, Str63, Str255, HFSUniStr255, char * (which I assume is what you mean by C string), UniChar *, and probably a few others I'm forgetting...

I believe it's the CFStringRef vs. char* that I'm complaining about. Most Carbon functions that take a string argument, such as creating a window and setting its title text, take a CFStringRef. I just remember it being kinda tedious having to convert a char* into a CFStringRef then pass that to the function.

start with java. truly, it's very easy to learn, and the concepts are easily applied to objective c or c++. learn c after java, though - then you'll be able to deal with memory management (very important).

skyhawk: Java is an excellent choice for learning how to program. It's very intuitive, and the library is large and strong. I found it very easy to learn - certainly easier than any other language I ever tried to learn on prior to it. Just speaking from experience.