Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!watcgl!kdmoen From: kdmoen@watcgl.UUCP Newsgroups: comp.lang.misc,comp.lang.smalltalk,comp.lang.c++ Subject: C++ vs Objective-C Message-ID: <1811@watcgl.waterloo.edu> Date: Sat, 19-Sep-87 13:25:04 EDT Article-I.D.: watcgl.1811 Posted: Sat Sep 19 13:25:04 1987 Date-Received: Sun, 20-Sep-87 13:42:13 EDT References: <3405@ece-csc.UUCP> <638@its63b.ed.ac.uk> Reply-To: kdmoen@watcgl.waterloo.edu (Doug Moen) Organization: U. of Waterloo, Ontario Lines: 38 Xref: utgpu comp.lang.misc:644 comp.lang.smalltalk:300 comp.lang.c++:389 csrdi@its63b.ed.ac.uk (Rick Innis, CS4) writes: >... I'd also like C++, and may well end up porting >that myself, but I've been told that Objective-C is a better language - >any versions available? Strange... My understanding is that C++ is the better language. I've used C++, but not Objective-C. I have talked to someone who spent a significant amount of time using Objective-C, and who warned me against it. Here are my impressions: 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. The two universes obey very different laws; code and data exist in either one universe or the other. Of course, there are various interfaces between the C and Smalltalk parts (eg, Smalltalk object pointers can be stored in C variables), but it's a lot messier than programming in a single unified language. For example, if you want to manipulate character strings, you can use either Smalltalk strings or C strings; the two kinds of strings obey different rules, and you might occasionally have to worry about converting between the two string formats. C++, on the other hand, is a single unified language. Classes are a straightforward extension of structures. This means you can take an existing C structure definition, and simply add methods to it, without invalidating existing code that uses the structure. In Objective C, you would presumably have to translate the structure definition into Smalltalk, and change all the code that used the structure into Smalltalk code. I'd be interesting in seeing the opinions of people who have had non-trivial amounts of experience with both languages. -- Doug Moen University of Waterloo Computer Graphics Lab UUCP: {ihnp4,watmath}!watcgl!kdmoen INTERNET: kdmoen@cgl.waterloo.edu