On 10 Apr, 10:00, Kelsey Bjarnason <kbjarna...@[EMAIL PROTECTED]
> wrote:
> On Tue, 08 Apr 2008 13:38:21 -0700, Keith Thompson wrote:
> > I'll just point out that there are plenty of programming languages in
> > which functions (procedures, subprograms, whatever) can modify their
> > arguments, and programmers who use those languages generally manage to
> > cope with the pain.
>
> Sure. =A0C's one such language, but at least in C, there's generally
> something visible at point of call that indicates this, such as the item
> being passed is already a pointer and thus at potential risk of having
> the data pointed at modified, or the presence of an & to indicate a
> pointer is being created, the entire reason for which, generally, is to
> have the data modified.
>
> Yes, one certainly _can_ work around this particular design flaw of C++
-
> and other languages as you note - but IMO one should not have to; the
> fewer impediments to programmer comprehension of the code, the better.
I nearly wrote a post like Keith's, but he beat me to it.
So I'll do a "me too" instead.
It is *not* a design flaw of C++.
By now I'm used to C's lack of a proper call-by-reference
but it sure looked broken the first time I saw it.
I was raised on Alogol-60 (ok that's call-by-name...), Fortran
and Pascal. C is the weird one!
--
Nick Keighley


|