🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac.oop.macapp3
Article #365

Re: Re2: C++ (was re: bedrock defe

#365
From: Mark Lanett
Date: Thu, 28 Jan 1993 01:32
40 lines
2734 bytes
ALANDAIL@AppleLink.Apple.COM (Personal Software, Alan Dail,PRT) writes:

>You wouldn't have to remove features, just design them to coexist better.  For
>example, if you overload a function and then override one instance of it, all
>of the other instances get hidden.  Why not allow these featues to coexist
>instead of conflict.

The "hiding" *is* a feature, provided so C++ can warn you about covariant
relationships, on the theory that overriding one function but not its
siblings is more likely to be a logical error. You are free to provide
pass-through overrides of the siblings if it applies to your situation.

>Changing the default would improve reliability without having to impact
>performance.  All a programmer would have to do to get the performance would be
>to explicitly declare critical methods as nonvirtual.

Or use an intelligent DevEnv like Component Workshop. A lot of C++ stupidities
have more to do with the need to parse it as text and compile it without knowing
what context it's going to be used in. As we climb out of the text-based
DevEnv hole, the language will be able to evolve to take advantage of
information provided by the development environment.

>I agree that stack-based objects are usefull.  However, I don't think they are
>quite the same thing as a class and could be restricted to structs.  Doing this
>would allow class to be changed to have virtual for its default (or even
>better, have no default).

Heh, never tried resource acquisition? If MacApp had real exception handling
you'd see a LOT of stack-based classes for that purpose. It would do away
with almost all FailInfo clauses that exist in your code today. That's a
real plus.

>I don't think any of these changes would this would impact the power of C++,
>but would make it less error prone and easier to learn.

How do stack-based objects make C++ harder to learn? The only situation I
can think of is declaring one with the parenthesis for a default
constuction (i.e. "CFoo f();") which instead declares a function returning
such an object. It results in a compile-time error anyway, so all you need
is a compiler that provides an intelligent error message in that case.
Technical Details
Message-ID: <1993Jan28.013214.26233@netcom.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!pageworks.com!world!eff!news.byu.edu!gatech!paladin.american.edu!howland.reston.ans.net!spool.mu.edu!sdd.hp.com!decwrl!csus.edu!netcom.com!knee
References: <728150543.6883842@AppleLink.Apple.COM>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.mac.oop.macapp3
Path: arc1-ca.pugleaf.net!sparky!uunet!pageworks.com!world!eff!news.byu.edu!gatech!paladin.american.edu!howland.reston.ans.net!spool.mu.edu!sdd.hp.com!decwrl!csus.edu!netcom.com!knee
From: knee@netcom.com (Mark Lanett)
Subject: Re: Re2: C++ (was re: bedrock defe
Message-ID: <1993Jan28.013214.26233@netcom.com>
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
References: <728150543.6883842@AppleLink.Apple.COM>
Date: Thu, 28 Jan 1993 01:32:14 GMT
Lines: 40