Re: Order of argument evaluation in C++, etc.

"Ronald F. Guilmette" <rfg@rahul.net>
Mon, 14 Aug 1995 09:52:45 GMT

          From comp.compilers

Related articles
[18 earlier articles]
Re: Order of argument evaluation in C++, etc. jthill@netcom.com (1995-08-10)
Re: Order of argument evaluation in C++, etc. chase@centerline.com (1995-08-11)
Re: Order of argument evaluation in C++, etc. mfinney@inmind.com (1995-08-10)
Re: Order of argument evaluation in C++, etc. hbaker@netcom.com (1995-08-10)
Re: Order of argument evaluation in C++, etc. chase@centerline.com (1995-08-11)
Re: Order of argument evaluation in C++, etc. eggert@twinsun.com (1995-08-13)
Re: Order of argument evaluation in C++, etc. rfg@rahul.net (Ronald F. Guilmette) (1995-08-14)
Re: Order of argument evaluation in C++, etc. graham.matthews@pell.anu.edu.au (1995-08-16)
Re: Order of argument evaluation in C++, etc. bobduff@world.std.com (1995-08-16)
Re: Order of argument evaluation in C++, etc. sethml@sloth.ugcs.caltech.edu (1995-08-16)
Re: Order of argument evaluation in C++, etc. ok@cs.rmit.edu.au (1995-08-16)
Re: Order of argument evaluation in C++, etc. msb@sq.com (1995-08-18)
Re: Order of argument evaluation in C++, etc. ka@socrates.hr.att.com (1995-08-19)
[18 later articles]
| List of all articles for this month |
Newsgroups: comp.compilers
From: "Ronald F. Guilmette" <rfg@rahul.net>
Keywords: C++, optimize, design
Organization: a2i network
References: 95-07-068 95-08-081
Date: Mon, 14 Aug 1995 09:52:45 GMT

Jim Hill <jthill@netcom.com> wrote:
>One thing I do like about the no-specified-order rule is that side effects
>are otherwise less obvious in the source: that rule encourages the
>programmer to avoid unobvious side effects...


It seems to me that if this were one of our generally agreed upon goals,
then we could perhaps achieve it in a far more direct (and less subtle
and potentially disruptive) fashion by merely having compilers issue
suitable warnings and/or errors at compile-time, when and if they come
across some expression which has ``unobvious'' side-effects.


If you merely mangle or randomize the order of evaluation of (sub-)
expressions, then you may effectively be punishing someone, but the
punishment then comes at run-time, rather than at compile-time, and
the person who is ultimately punished may be the unsuspecting (and
doomed) airline passenger, rather than the original programmer.


>... I'm a firm believer in the "if you
>misuse it or don't understand it, it should break as fast as possible"
>school of design...


Me too.


>... I've more than once thought that adding a "randomize
>unspecified evaluation orders" switch would be a Good Thing.


No, it would be a Bad Thing, because breaking software ``as fast as
possible'' means breaking it (or at least complaining about it) at
compile-time, rather than later on, at run-time.
-- Ron Guilmette, Roseville, CA ----
---- E-mail: rfg@segfault.us.com ---
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.