carbon vs cocoa

BSDimwit

Registered
Ok here goes... forgive my ignorance but...

What is the difference between a cocoa app and a carbon app? Is one of these the so called os X native app that folks talking about or is it something different.

My guess is that cocoa is an app compiled under OS X using all the cool aqua widgets etc.

Carbon would be something that was compiled for OS 9 and is run through some sort of converter to get it to work with OS X?

Am I close?

Clue me in fellas...
 
sort of... these words refer to different APIs. every operating system has it s own API=application programming interface. it gives the developer access to all the things that the OS handles for you. like window management and stuff like that, so you don t have to reinvent the wheel everytime you write an app. it also ensures consistency across all applications on the platform.

carbon is an API which can be found both in OS9 and OSX, which means that code compiled for one can run on the other, with almost no changes.

cocoa is the NeXTSTEP API. it uses all that PDF formatting stuff, and layering and anti-aliasing. cocoa apps will only run on OSX. a lot of the objects in the cocoa api have names like NSWindow or NSObject. that NS stands for NeXTSTEP. so cocoa is the API that comes from NeXTSTEP. carbon is an API which is some intersection of the features of the old API of classic MacOS and OSX without some of the neat features.

and of course there is the classic API, which is for OS9 only applications. note that the carbon API is provided only as a migration path to cocoa. it makes the transition to OSX easier for developers. carbon apps can be compiled on OSX. they do not run through a converter. the APIs of OSX include carbon.

to be truly considered OSX native however, you should be cocoa. only cocoa takes full advantage of the features offered by the aqua interface. when adobe tells you that photoshop 7 is OSX native, they just mean that you don t need to run it in classic mode (which they consider a useful solution. personally, i cannot stand classic mode, and don t even have OS9 installed.) a good example of an app that is truly OSX native is OmniWeb. it used to be the only web browser available for NeXTSTEP. they have been developing NeXTSTEP applications for a long time, so they almost didn t even have to port their apps to OSX.
 
Back
Top