Posts Tagged ‘cocoa’

WarpedVisions on Objective-C, square 1

Bruce over on WarpedVisions writes on entering the world of Objective-C and Cocoa development.

I’m barely past square one, but I found this an interesting title. Of course, what Bruce means is the whole Mac OS X development experience, but it’s interesting that he worded it in the title as learning Objective-C. It’s a simple, concise yet technically inaccurate way to label the knowledge.1

Objective-C just might be the easiest part of Mac OS X development. The hard part is simply knowing what objects are available in Cocoa, where they are, and how to string them together. Basically, the typical framework problem. Don’t get me wrong, I’m still at the very bottom of the learning curve here!

Objective-C itself is very nice; it’s a truly minimal extension to C. I’m amazed at how it’s still a very complete object-oriented language yet so simple and small, with everything done the simple way.

When I first started with Cocoa, I was thinking of compiling notes together so I could write a short book/essay on “Learning Cocoa for C++ developers,” but as I’ve gone I’ve realized the first chapter should be “Forget everything you know about C++. You think need ___ to do ___? You do in C++, but in Objective-C just use the Cocoa class ___.”

  1. And I’m not intentionally picking on Bruce here. I have said it this way, and probably will again, and he does get it right in the text, as he noted below. []

Despite being promised last year, it looks like Mac OS X 10.5 will not have a 64-bit Carbon. This is actually pretty pathetic - it seems as though Carbon 64 was almost ready. Despite the Carbon team having fewer resources and accomplishing more - and being a better environment for anyone trying to write code in a reusable way - the language bigots in Apple decided to kill it.

And despite years of calling Carbon an API on equal footing to Cocoa and assuring developers would remain fully supported, developers are suddenly left without a path forward. Apple, meanwhile, will just tell users “they can port to Cocoa,” without mentioning how much work that is, or how it is simply impossible in some cases.

Apple, I don’t really care how cool Cocoa is. I’m not using it for anything serious because of Objective C. It’s really that simple.

Apple’s been leading a misinformation campaign for years against developers. First it was about how little effort would be needed for Carbonization, then how little effort to move from CodeWarrior to Xcode, and then how little effort required to move to Universal Binaries. (To be fair, they were very nearly telling the truth about that one.)

I think it’s time for developers to fight back. There’s only one way to win this: Make it as embarrassing to Apple to withhold Carbon 64 as it was to not announce an environmental policy, or to not have a public battery exchange program in effect for iPods. A couple full-page ads in media publications would do it. End users don’t need to know all the technical details, they only need to know there’s a simple problem that Apple is withholding a solution to for political reasons that will cost them hundreds of applications going forward. Apple would roll over before the ink dries.

I’m utterly shocked that major companies such as Adobe and Microsoft haven’t done this yet. It would certainly be cheaper than porting to Cocoa. And better for the Mac OS X platform, too: As long as Mac OS X isn’t the only game in town, Carbon and C++ are far more important than Cocoa and Objective C. It’s sad that Apple needs help seeing that.