Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!husc6!purdue!decwrl!megatest!djones From: djones@megatest.UUCP (Dave Jones) Newsgroups: comp.lang.c++ Subject: Re: Object-oriented techniques in C Message-ID: <576@goofy.megatest.UUCP> Date: 27 May 88 20:33:40 GMT References: <384@otc.oz> Distribution: comp Organization: Megatest Corporation, San Jose, Ca Lines: 51 From article <384@otc.oz>, by mikem@otc.oz (Mike Mowbray): > In article <552@goofy.megatest.UUCP>, djones@megatest.UUCP (Dave Jones) says: > >> Still, almost anything you can do in C++, you can do in C. (Proof: cfront >> generates C-code.) > > Yes. > > I think I will probably strangle the next person around here who tells me > that they can do what C++ does in C, (or some other language of similar > level). I could do what C++ does even in assembler; [Proof: C++ gets turned > into C which gets turned into assembly code]. Extrapolating that argument one > step further implies that we make do with binary machine code(!) > > "There is none so blind as he who ...." > I think I will probably decapitate and eviscerate the next person who says he will strangle me. :-) Now that the pleasantries are disposed of, let's see here about this "blindness" premise: I don't think your assembly language *reductio ad absurbum* holds water. With C, it is usually possible to write machine-independant code. Not so with assembler. C does semantic translation from the C-virtual machine to the machine for which it is compiling (perhaps real, perhaps virtual). C++, though very useful, has the same underlying virtual machine as C -- intentionally so. The value of C++ is that it automates name-space reorganization from an o-o hierachy of classes to the flat name-space of C. This you can do "by hand", although at the expense of some tedium and an increased likelyhood of mistakes. But having done so, you will have a machine-independant computer program. As I noted in the original letter, C++ does more than just reorganize the names. Inline procedure expantion is an example I gave where C++ does semantic translation, rather than just reorganiztion. But you can fake that somewhat with macros. They're not as good, but you can survive. There are other examples. Still I stand by what I say. Purhaps I should have said, "C++ is a very useful tool. But there is more to be gained from organizing libraries and programs around data-objects than there is to be gained from selecting a programming language which is desinged for that purpose. It is extremely desirable, however, to select a language which is supported on a large variety of architectures." Your truly, J. Ripper, ret.