Archive for December, 2005

Taming the West

Thursday, December 1st, 2005

Computer languages are designed at a high level of abstraction, and have a relatively short list of rules. Learn the rules and start programming. Frameworks and class libraries, like Cocoa, on the other hand, are very different. They are designed to do a set of specific jobs. How they are designed and implemented will be different depending on what mind collective does the design and implementation. Every group, and individual within the group, will approach it differently. There is no short list of rules. Each object and each of its methods is a set of rules unto itself. Of course there is a great deal of consistency to how things are done in Cocoa and any well-designed library, but it can’t be relied upon. One has to learn each object and each method, one by one.

I think Cocoa is great, but it necessarily has a huge learning curve, compared to learning a computer language. I have programmed in a number of different computer languages, IBM 360 Basic Assembler Language, COBOL, BASIC, PL-1, Forth, Perl, PHP, C, C++, and now Objective C. C was my favorite, but now it’s ObjC. It’s a lovely implementation of objects in C. My least favorite language is C++, which is an abomination, in my opinion. But that is all beside the point. Developing software for the Macintosh is not about Objective C. It’s about Cocoa.

Although I appreciate the advantages of object-oriented programming, and I have done and continue to do a lot of it, I have never liked the feeling of being trapped inside somebody else’s idea of how to do things. If you want to develop a Cocoa app, you have to do it the Cocoa way. No matter how beautifully a library is done, it never quite works the way I want it to. It never quite does all the things that I need to do. The only alternative is to write your own set of classes and use them instead of Cocoa, a more than daunting task. These days, as an application programmer in the modern programming world, you really have no choice. Like Dylan says, “You got to serve somebody”, whether its Cocoa or Carbon, the Windows API, or Gnome, the Devil or the Lord, or any class library or API. You have to do things the way somebody else decided you should do them.

I’m not complaining. I like Cocoa quite a lot, and of course you can always create your own classes that inherit from Cocoa and do whatever you need to do. I’m just saying there’s been a real sea change in the nature of application programming, because of the now ubiquitous practice of object-oriented development. There is more power, but also more restriction. In the olden times, whatever language I was using, or type of application I was developing, I would gradually build up a repository of semi-reusable code that could be cut and pasted into whatever I was currently developing. As time went by there was more and more cutting and pasting and less and less original coding. And everything worked the way I wanted it to, and if it didn’t, I knew how to fix it.

So something is gained and something is lost. I’m sure that assembly language programmers felt the same way about the advent of high level languages, starting with Fortran. In fact that’s one of the things I liked so much about C. It’s really more of a meta-assembler than a high level language. It doesn’t restrict you. It just speeds up your coding, whereas COBOL puts you in the COBOL box. So, what’s the point? No point, just some thoughts from an old guy who’s still programming. I think it’s analagous to the history of a civilization. Over time, everything gets more and more defined, and the original anarchy becomes confined and restricted. It’s the settlement of the Old West. You can’t just shoot anybody you want to anymore, but, as compensation, the streets are paved, and somebody collects the garbage.