Strange Brouhaha

Sunday, October 03, 2004

Objective-C

I've been trying to learn a little bit of Macintosh development recently. I've got my eye on moving some of my test databases to the iMac on my desk at work, and I'd like to create some programs to interface with those databases a little bit better than the MySQL command line. After all, filling out a form and clicking a button is a little bit more friendly than typing "INSERT INTO autotest (ID, Result, Date, Time, Comment) VALUES ('001', 'FAIL', '2004-10-03', '13:22:00', 'Test failed with return code 0');" on a command line.

I like working with Xcode, the Mac development environment, and I've been using Java because I understand it a lot better than I understand the other available language: Objective-C. Objective-C goes back at least to NeXT, which would explain why Apple is using it as its primary development language and why all of the object names begin with "NS" (for NextStep). What I don't get is why you'd want to use it.

The hell of it is, I DO understand why you'd want to use it. You're forced to separate objects into implementation files and interface files, which I like in languages like Ada. It organizes your thinking in a way that C++ doesn't (unless you have the discipline to do it yourself), while at the same time keeping you from being able to get as incredibly anal as you can with Java. (I let my Java programs get disastrously Byzantine.) You're forced to do a lot of things that make your program better.

It just seems unnecessarily verbose. "Hello World," which is not a good test of programming languages, takes three files and fifty lines of code to implement--albeit in a way that doesn't allow a buffer overrun--where straight C with the same functionality takes about a dozen lines and Java takes five (and in Java you can let the system free the memory without worrying about it AND exactly one of those five lines actually does any work; of course, the Java version takes five times as long to run).

Anybody out there have any experience with Objective-C that they'd like to share? Since Mac development is pretty much keyed towards it, I'm going to have to learn it if I want to move ahead with this project.

0 Comments:

Post a Comment

<< Home