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 ---
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.