ObjC > C
After spending 6 weeks at work learning Cocoa/OpenStep and Objective C and then writing some GUI apps, coming back to Gtk+ and C makes me kinda sad. I hate typing out really long function names. I hate the class casts required to do just about anything. I hate the boilerplate code I have to write every time I make a new GObject subclass (yes, I know about GOB, but just the presence of that code annoys me). I hate crap like G_OBJECT_CLASS(foo_object_parent_class)->finalize(obj) – yes, I know you often have to do things like [super dealloc] in Objective C, but look how shorter that is.
I love Objective C. Is it perfect? No, of course not. Not having class variables seems a little weird (but a ‘global’ static variable in the implementation file will do). It’s a bit slower than C (though probably only about 10% in a typical GUI app). Is the syntax a little weird? Yeah, but it’s not bad. Having to type out method parameter names along with the parameters themselves can be a little annoying, but it’s often more clear.
I really wish there was an up-to-date Objective C binding for GObject and Gtk+. I found GTKKit and GToolkit, but they were written for Gtk+ 1.2.
Anybody know of a more recent ObjC binding for Gtk+ that I didn’t notice?
Oh, and on a side note, I also love Interface Builder. Maybe I should look at Glade sometime.