Xref: utzoo comp.lang.c++:12132 comp.object:2696 comp.lang.objective-c:192 Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!news!nujoizey!gwu From: gwu@nujoizey.tcs.com (George Wu) Newsgroups: comp.lang.c++,comp.object,comp.lang.objective-c Subject: Re: Static typing, OOP efficiency, and programmer error Message-ID: <1860@news.tcs.com> Date: 8 Mar 91 01:12:32 GMT References: <27C523A2.2155@tct.uucp> <27CE9C05.4F64@tct.uucp> Sender: root@tcs.com Reply-To: gwu@nujoizey.tcs.com (George Wu) Followup-To: comp.lang.c++ Organization: Teknekron Communications Systems Lines: 38 In article <27CE9C05.4F64@tct.uucp>, chip@tct.uucp (Chip Salzenberg) writes: |> According to pcg@cs.aber.ac.uk (Piercarlo Grandi): |> chip> Besides, as far as I know, there is no guarantee that the message |> chip> set supported by a given class will not expand after the users of |> chip> that class have already been compiled. |> |> pcg> The idea in Objective C is that you resolve statically what you can, and |> pcg> turn to dynamic overloading for what you cannot. |> |> But the Objective C compiler never knows when you have made an error |> by sending a message that the recipient cannot understand. That error |> is impossible in a C++ program. |> |> pcg> ... [in Objective C, a message] just gets resolved dynamically instead of |> pcg> statically. In C++ you simply don't have this option in the general case. |> |> True. I consider this omission a feature, personally; it keeps me |> from discovering at run-time that I have requested an impossible |> operation -- an error the compiler could have detected. I would consider this sort of run-time error checking inadvisable for commercial products, to say nothing of mission critical applications, although I'm sure there are people out there using Objective C and Smalltalk for commercial systems. It simply isn't a good idea for a sold product in customer hands to crash with an error. (Yeah, I've seen commercial systems core dump, too. :-) It's just easier to have high confidence in software which does as much error checking as possible at compile time. Of course, if one just performed exhaustive testing before releasing a product . . . . George ---- George J Wu, Software Engineer | gwu@tcs.com or uunet!tcs!gwu Teknekron Communications Systems, Inc.| (415) 649-3752 2121 Allston Way, Berkeley, CA, 94704 | Quit reading news. Get back to work.