From: Scott Thompson Date: 2003-08-30T23:50:34+09:00 Subject: Re: Objective-C (was Re: Why would you abandon Ruby?) > Martin DeMello wrote: >> >> MetalOne wrote: >> >>> I am sorry I rambled a bit. I hoped that helped somebody. I am just >>> frustrated because I dislike C++ and I can't seem to get away from >>> it. >> >> Have you looked at Objective C? I keep wanting to learn it, but I'm >> not >> doing anything speed-critical, and there always seems to be a more >> interesting language I'd rather learn instead. > > If you're on Mac OS X, Objective-C is probably great. I used to work > on > NEXTSTEP, and from what I can tell the libraries haven't changed too > dramatically from the OPENSTEP days. Well... This is true and not true at the same time. On the one hand many of the fundamental concepts you have remember from the OPENSTEP days are still true. Some of the basic classes like NSView and NSWindow follow the same basic rules as they always have. On the other had, the classes have continued to evolve in the 6 or 7 years since OPENSTEP. That evolution has been accelerated and greatly benefited from time and attention that Apple has been willing to put into the framework's growth. If you are/were an OPENSTEP programmer it would probably be very easy to pick up Cocoa. There would, however, still be things to learn. > On the other hand, Objective-C on nearly any other platform is almost > pointless (unless perhaps you're using GNUStep). For nostalgia's sake, > I tried writing a web server in Objective-C. I gave up after a few > afternoons, < problem details removed for brevity > FWIW, I know folks that would disagree with you. Much like the Macintosh itself, Objective-C has a small, but fervent, following even among those who haven't yet switched to the Macintosh platform. I don't have experience with Objective-C on platforms other than Mac OS X myself so I can't say much from personal experience. I am sorry that your experience was a disappointing one, though. > After poking at it for a while, I realized that there was nothing in > Objective-C I couldn't do better/faster in Ruby. That would, of course, depend on your needs. My needs are not satisfied entirely by Ruby so I employ an additional mix of Objective-C and C++ in my work. I find ruby to be an excellent language for "command line level" tasks (as opposed to shell scripting, or awk which is where I would have spent my time a year ago). I also have found myself writing prototypes for object-oriented designs in ruby to try out abstract concepts. As a C-like language, Objective-C would have all the advantages of a high-level-to-assembly compiled language. Those advantages would come, for example, at the cost of having more structure like the ref-counting memory management scheme. As you point out Objective-C is required when interacting with Cocoa and I find the fact that Objective-C is dynamically dispatched a welcome change for some tasks when compared to the hoops that C++ requires you to jump through because of it's strong typing. At the same time, I find C++ a handy language for representing and manipulating low-level data (i.e. the model objects in an MVC scheme). C++ has the additional advantage (for my work anyway) that C++ model objects can run and behave similarly regardless of the Hardware/OS platform you compile them on. Of course if you prefer ruby, but find yourself on Mac OS X and would like to bridge to the Objective-C language runtime, you can check out RubyCocoa at: http://www.imasy.or.jp/~hisa/mac/rubycocoa/ Scott