Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!dciem!nrcaer!cognos!geovision!kim From: kim@geovision.UUCP (Kim Fillmore) Newsgroups: comp.lang.c++ Subject: Re: C++ vs Objective-C Message-ID: <181@geovision.UUCP> Date: Thu, 24-Sep-87 09:25:04 EDT Article-I.D.: geovisio.181 Posted: Thu Sep 24 09:25:04 1987 Date-Received: Sat, 26-Sep-87 13:56:34 EDT References: <3405@ece-csc.UUCP> <638@its63b.ed.ac.uk> <1811@watcgl.waterloo.edu> <604@artecon.artecon.UUCP> Reply-To: kim@geovision.UUCP (Kimberly Fillmore) Organization: Geovision Corporation, Ottawa, Canada Lines: 54 In article <604@artecon.artecon.UUCP> donahue@artecon.UUCP (Brian D. Donahue) writes: >In article <1811@watcgl.waterloo.edu> kdmoen@watcgl.waterloo.edu (Doug Moen) writes: >> >>Objective-C is apparently C with Smalltalk code embedded using escape >>sequences. The problem is that when you program in Objective-C, you >>have to deal with two universes: the C universe, and the Smalltalk universe. > >whoa! what universe did your friend come from? Objective-C is a >preprocessor that outputs straight C code. It has nothing to do with >Smalltalk at all (except for object oriented concepts of course). > >bd > >--- >Brian Donahue {seismo, sdcsvax}!esosun!artecon!donahue Yes, after you have run the preprocessor, the code it puts out is straight C, which you then run through your favourite C compiler. The code that comes out can contain structures like case statements with 400 cases, and lines that are hundreds of characters long, which is why it doesn't work well on small systems; their C compiler isn't up to it. BUT, when the programmer *writes* the Objective-C code, he embeds Smalltalk commands, enclosed in [], in the C code. As I understand it, the syntax of the embedded commands is pure Smalltalk. In C++, there is only one syntax, and, as stated before, a unified language. Also, no preprocessing step to *translate* to C. Another dubious feature of Objective-C is that allows you to define the Smalltalk special object *self* and then lets the C code stomp on it and change its value (kind of destroys the credibility of the self object :-). Also, it will allow access to internal fields of an object by coercing the pointer (ie. I know if I add x to my pointer it will give me y, and so what if I've just introduced a hard to trace bug if y's definition is changed). I recognize that people can get around almost any safeguards if they try hard enough (which they always do :-). I was at a talk on Objective-C, given by Kurt Schmuker of PPI, and I thought there were some serious problems with it, although I've never worked with it. The big drawback was that it was Smalltalk pasted on top of C. C++, on the other hand, is a new, extended (improved? :-) C. I've never *used* Objective-C, although I have used C++ and Smalltalk. I too would be interested in hearing from someone who has used both C++ and Objective-C. All the usual disclaimers. ---Kim -- Kimberly Fillmore (613) 722-9518 | Duct tape is like the Force - it has GeoVision Corp, 350-1600 Carling Ave | a light side and a dark side, and Ottawa Canada K1Z 8R7 | holds the universe together. UUCP: ...!utzoo!dciem!nrcaer!cognos!geovision!kim