🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #1443

Re: Use of nested functions (Was: Proposal for default scope)

#1443
From: Greg Noel
Date: Sun, 10 Jan 1993 02:34
33 lines
2415 bytes
Steve Clamage <steve@taumet.com> writes:
>I have to disagree with this point.  C++ hides a lot of grungy detail
>from the programmer, with the consequence that simple constructs may
>require a lot of compiler-generated code.

There's a difference between hiding a lot of grungy detail and intrinsic
inefficiency.  If the compiler filling in the grungy details is what is
causing the inefficiency, the programmer can always replace it with something
more efficient.  If it's inefficient because of something required by the
language, that's not possible.

It's curious---I posted my original article to try to start a discussion
about how something like modules or packages could be added to C++ as
seamlessly as possible, because I see that as something that the language
doesn't handle well and needs badly.  But most of the responses have been
from people who reacted to one throw-away clause as a disparagement of
nested functions, which is not what I intended at all.

Personally, I'd prefer to let those who feel passionately about nested
functions debate this point.  As it is, I'm mooting a point about which
I don't care very much.  In my thirty years of experience, including using
languages that provided them, I've only wanted nested functions a few
times---and I've _never_ wanted to take the address of one.  If I don't
use them and if they don't cause me any inefficiency, then I don't really
care if they are present or not.

On the other hand, there are literally hundreds of times I've wanted to
have a helper function that was not externally visible.  In C, a static
function provides most of the functionality I want, while in C++ it's
all but impossible.  If C++ wants to be considered a ``better'' language
than C, that's something that will have to be addressed.
-- 
-- Greg Noel, Unix Guru         greg@qualcomm.com  or  greg@noel.cts.com
Technical Details
Message-ID: <1993Jan10.023440.27522@qualcomm.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!swrinde!network.ucsd.edu!qualcom.qualcomm.com!harvey.qualcomm.com!greg
References: <1993Jan9.173310.13214@taumet.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c++
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!swrinde!network.ucsd.edu!qualcom.qualcomm.com!harvey.qualcomm.com!greg
From: greg@harvey.qualcomm.com (Greg Noel)
Subject: Re: Use of nested functions (Was: Proposal for default scope)
Message-ID: <1993Jan10.023440.27522@qualcomm.com>
Sender: news@qualcomm.com
Nntp-Posting-Host: harvey.qualcomm.com
Organization: Qualcomm, Inc., San Diego, CA
References: <1993Jan9.173310.13214@taumet.com>
Date: Sun, 10 Jan 1993 02:34:40 GMT
Lines: 33