Categories
Development Mac

My Cocoa Education – First impressions

Xcode icon I wanted to document my first impressions with learning how to program in Cocoa. As I had posted previously, I’m using Aaron Hillegass’s book Cocoa® Programming for Mac® OS X, Third Edition on Safari Online’s site. Due to other commitments, I’ve only covered the first six chapters of the book.

In a nutshell – this isn’t for beginner programmers. Writing Cocoa applications seems to be extremely complex and may be more than budding programmers can get their arms around immediately. Anyone wanting to learn Cocoa basically has to have a foundation in OOP, C (not necessarily Objective-C), and C++ under their belts. Dusting off those C++ skills is really challenging for me…

The Xcode interface is great! However, it is not Visual Studio. Some major features need to be introduced into Xcode – Intellisense, include some automatic plumbing, and a unified development environment.

Intellisense is such a great technology and should be added because it will radically reduce the amount of typing one has to do to reference simple objects that already exists (you’ll have to experience the amount of type and retyping of same ole thing over an over to get the idea here.)

They have to add some automated plumbing — Simply adding a button to a window requires modifying a header file, dragging some dependencies together, and then you still have to manually code the structure of the event yourself. In Visual Studio, the same process is simply drag a button onto a form and pick your event from a drop down menu and/or double click on the button to bring up the default event. Visual Studio will automatically create the event code for you saving you some typing. In this sense, Xcode is simply a enhanced text editor.

Lastly another major needed improvement is to make the Interface Builder – the application that helps create your GUI objects, part of Xcode. Make the two applications seamless. As of right now I don’t see any sense for the applications to be separated.

I am amazed at the depth and ease of which it gives programmers access to some serious functionality. Once you get past a lot of the mechanics, the Apple API is extremely rich. For instance, one of the first applications that the book I’m using has you build is a speed synthesizer for reading a line of text. You will be able to create the program in about 20-25 lines of code. That’s not half bad.

I’m sure I’ll have more to write about the deeper I get into this book. Until then…

-JT

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.