Cocoa vs Objective-C

Greetings,

Can anyone describe to me the essential differences between Cocoa and Objective-C. They both use same class methods. Objective-C uses C language code as I have come to learn from Shane’s great book. Which of the two is easier to learn. The reason being, I have been doing ASOC on and off due to my heavy IT work load. But, eventually, I want to go towards programming.

Thanks,
t.

Hi,

Objective-C is the programming language, a object oriented superset of C

Cocoa is the global framework (library of classes) including
Foundation (basic objects)
AppKit (UI elements) and
CoreData (object persistence) framework

I think it won’t hurt you, to know the basics of Objective-C before you dive into Cocoa.

Thanks Stefan. I see Aaron Hillegass has books on Cocoa and Objective-c, hence the confusion

t.

The Reason for aaron to name the differently is because Objective-C is an programming language which can be used for Windows and other platforms. Cocoa comes in two libraries, OS X and iOS. At this moment the Cocoa framework is written to use with Objective-C and/or C. I can create a string object in C (CFString) which can be used in Objective-C as an NSString. DOTNET is a similar framework but only for Windows, it’s only much bigger and better than Cocoa.

Ah DJ, I could go on and on for a week on that topic, especially the “better”. But with Objective-C/cocoa you don’t need that large libraries, because what is in the core, the architectrue doesn’t necessitate it.

I’ll just say I like Objective-C and Cocoa much better. And each to his own. :slight_smile:

You don’t have too. I mean bigger and better literally/physically, not a programmer’s preference/comfort zone . With better I refer to that .net has a more general interface which makes it usable in more than 20 programming languages. Cocoa is only limited to languages that supports the C-Structs otherwise you need heavy narrow bridge like PyObjc and ASObjC. With bigger I meant that it much bigger in amount of classes and functionality. Those facts are hard to argue with… I work with both.

But to stay on topic I’ve only used .net as a an example to show the difference between Cocoa and Objective-C.

I don’t argue, when you have revealed the criteria for better. :slight_smile:

I have too little experience with Objective-C, to debate it anyway, and I am sure there is quircks with Objective-C and Cooca as well. There are many things I find to be pleasant now, that may change over time.

To make it simple, regarding the Mac Objective-C is everything described in Apple’s The Objective-C Programming Language.

Or in terms of a real language, Objective-C is the grammar, Cocoa is the vocabulary

I just started cracking the books on this, but what a great explanation!

This is the flipside of StefanK’s statement which SuperMacGuy beat me to. My point is that AppleScript is in many senses alike the framework programming you do in Objective-C/Cocoa, in the sense that you plug in small pieces.