🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c
Article #9759

Not only that, but...

#9759
From: H. Munster
Date: Fri, 07 Nov 1986 18:24
29 lines
1759 bytes
In article <630@dg_rtp.UUCP>, throopw@dg_rtp.UUCP (Wayne Throop) types:

>Again folks, play it safe: *NEVER* have two side-effects on a single
>object in a single expression.

Not only that, but: don't even *USE* an assigned-to object anywhere else
in the expression!

An example, given by K&R on p. 50:

a[i] = i++;

What is the value of i in the subscript?  Who knows?  Keep in mind this quote
from the same page: "When side effects (assignment to actual variables) takes
place is left to the discretion of the compiler, since the best order strongly
depends on machine architecture."  I interpret this to mean that the assign-
ment doesn't have to be done *anywhere* within the statement...in fact, it
doesn't have to be done until just before the variable is referenced again!
---
It's been said by many a wise philosopher that when you die and your soul
goes to its final resting place, it has to make a connection in Atlanta.

Dave Cornutt, Gould Computer Systems, Ft. Lauderdale, FL
UUCP:  ...{sun,pur-ee,brl-bmd}!gould!dcornutt
 or ...!ucf-cs!novavax!houligan!dcornutt
ARPA: wait a minute, I've almost got it...

"The opinions expressed herein are not necessarily those of my employer,
not necessarily mine, and probably not necessary."
Technical Details
Message-ID: <166@houligan.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!gatech!akgua!codas!peora!ucf-cs!novavax!houligan!dave@murphy.UUCP

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!gatech!akgua!codas!peora!ucf-cs!novavax!houligan!dave@murphy.UUCP
From: dave@murphy.UUCP (H. Munster)
Newsgroups: net.lang.c
Subject: Not only that, but...
Message-ID: <166@houligan.UUCP>
Date: Fri, 7-Nov-86 13:24:36 EST
Article-I.D.: houligan.166
Posted: Fri Nov  7 13:24:36 1986
Date-Received: Sun, 9-Nov-86 03:22:52 EST
Organization: Gould Electronics, Ft. Lauderdale, Florida.
Lines: 29