Cocoa and Objective-C
So I want to learn how to program on the Mac "for real," which, sadly, means pretty much starting from scratch in that I need to learn Objective-C and all this other Cocoa (was OpenStep was NextStep) stuff.
So here's my starting backround. I know how to program, in the most abstract sense. I've taken classes on C++ (so I also know C), and used to do Mac stuff with Think Pascal back in college (I graduated in 1998 from Haverford College). I'm an expert at the totally useless art of Lingo (Macromedia Director's scripting langauge) programming, which is an object oriented language that is frighteningly loosely typed (this can sometimes be very annoying, such as when you think you're dealing with a float, but the value has been cast to an integer). I know Javascript (although not that well, since it is the world's most painfully thing to debug), and some Perl (which I learned for some simple CGI and text processing stuff). I also know Java to the level that I could figure anything out if I had a need for it (I've never needed to use AWT or Swing, and never tried since it looks like such a painfully way to do GUI design), but well enough that I appreciate the joys of automatic garbage collection, and how making everything an object can sometimes be annoying.
I also took at shot at learning Carbon a few years back, but gave up since the Apple documentation was far too annoying to work with. It also always seemed like there was some secret subset of C that one needed to know that was never explained (things like "static pascal," which I never understood, but were thrown around in sample code like everyone should know what a static pascal type was). Also, doing a GUI in Carbon was just as hard as in Java (well, actually much, much harder), and never appealed to me since I could code up a nice, working GUI in Director or RealBasic in 1/100th the time it would take using Carbon (this is a recurring grip of mine - you always need to choose between a "slow" interpreted language-based IDE like Director or RealBasic, or get the speed you want, but contemplate suicide when trying to make the GUI). I also hated all those damn pointers used in Carbon programming. I have nothing against pointers (which is a good thing since every object in Objective-C is a damn pointer), but they were so interspersed as parameters in function calls that it would take hours to figure out what information was actually being passed to a given function. I just never had the patience to stick with it.
I should mention a quick thought on Java here. Java is pretty damn cool, if they had an easy way to make a GUI (I believe there are development tools for this, but I never bothered to play with them), and if they had real support for graphics, video and audio. I believe that it's still the case that you can't play an mp3 file from within Java without jumping though a lot of hoops (or using QTJava, which may not be supported beyond 2 weeks from yesterday). Whenever I wanted to do something "fun" with Java (not just data crunching), I would run back to Director, where media support was outstanding. I built a pretty nifty dual mp3 playing DJ program that supported multiple sound cards several years back using Director, which would have taken me years using Carbon, and wasn't even possible with Java (multiple sound outputs? Be happy you can even play any sound at all). So that's my grip with Java.
But back to Cocoa. So the other day, I decided to run myself through the Cocoa tutorial on Apple's developer website. They run you through making a pretty lame currency converter application, which I did. The neat things was, however, that I finally got to see what the heck Interface Builder was good for (sexy, easy GUI design), and the basics of Objective-C (not a very hard language, once you start to understand the whacky syntax - what the heck is myString = @"Hello world" all about?). I realized the potential ease with which one could make some cool software using Interface Builder and all the Cocoa frameworks. And then I realized that with the release of Tiger there was going to be all these new Framewords for accessing the cool features of Tiger from Objective-C. I was especially excited about Core Image, Core Video and Core Audio (also related to QTKIT, the Quicktime Objective-C interface), since they would allow me to do the "fun" things I like so much, without all the pain of Carbon, or the slowness (and possible obsolecence) or Director or RealBasic.
So I decided it was time to really get into learning Cocoa and Objective-C, even though the Apple market is a total unknown, and this skill set might become completely useless (like it is now) in a few years. On the other hand, if Apple can run with this iPod halo effect, and make inroads into the Windows world, maybe there will be a demand for Cocoa programmers in the near future (do a Monster.com search for it right now, and you might find 3 jobs that mention Objective-C. Compare that with a search for C#...). And that's what I'm doing. More on this in the next post...
As an aside, I'm a bit freaked out by the fact that when I spell checked this post, there were not mis-spellings. This just doesn't happen to me. Weird.

0 Comments:
Post a Comment
<< Home