[comp.sys.mac.programmer] C++

lsr@Apple.COM (Larry Rosenstein) (09/15/89)

In article <2614@husc6.harvard.edu> siegel@endor.harvard.edu (Rich Siegel) 
writes:

> so elegant? In my opinion, C++ is a kitchen-sink language, some features
> of which are very useful, but many others of which are just in there 
because
> they seemed like the right thing to have. "Typesafe linkage"? So that the
> wrong routine gets called just because I pass the wrong number of
> parameters? "Default parameters"? Just because I'm too lazy to pass the
> right number of parameters?

I agree with you that C++ is a kitchen-sink language.  Its biggest failing 
is that it suffers from the C Philosophy of letting the programmer get 
close to the machine language, and providing the maximum efficiency at the 
expense of elegance.  (The best example is stack-based objects, which are 
nice for efficiency, but introduce a ton of complications into the 
language.)

I disagree about type-safe linking, however.  This actually is a big win, 
for the same reason compile-time type-checking is a win.  It catches 
errors early in the game.  For example, you can catch errors if you try to 
link with a library that was compiled with direct 68881 calls with a 
program that wasn't.  (The type signatures of won't match.)  

Default parameters are useful along with function overloading.  It 
provides another mechanism for overloading a function name, without having 
to write a separate procedure.  It is true, however, that you can get into 
trouble when you use default parameters (and overloading, for that matter).

Larry Rosenstein, Apple Computer, Inc.
Object Specialist

Internet: lsr@Apple.com   UUCP: {nsc, sun}!apple!lsr
AppleLink: Rosenstein1

sxe@beta.lanl.gov (Stephen Eubank) (09/18/89)

I've heard a rumor that Apple had patched cfront to 
generate Cray compatible C. Can anyone tell me whether this
is true, and if so, whether the MPW version will have this 
feature? Or hey, maybe just a Cray cross-compiler :-).

1200 baud -> dislike of cute signatures. Stephen Eubank

mark@intek01.UUCP (Mark McWiggins) (09/19/89)

In article <32259@beta.lanl.gov>, sxe@beta.lanl.gov (Stephen Eubank) writes:
> 
> I've heard a rumor that Apple had patched cfront to 
> generate Cray compatible C.

No patch is necessary.  All you need to do to cross-compile is generate
a "size and alignment file" with information about data sizes, structure
alignment, etc., and put the target C compiler's include files on the
host system, if any are needed.

This should work with any robust K&R type C compiler, but the C code
generated by C++ is *nasty*, so "robust" is the key word.
-- 
Mark McWiggins			Integration Technologies, Inc. (Intek)
+1 206 455 9935			DISCLAIMER:  I could be wrong ...
1400 112th Ave SE #202		Bellevue WA  98004
uunet!intek01!mark		Ask me about C++!