From: | Stefan Monnier <monnier@iro.umontreal.ca> |
Newsgroups: | comp.compilers |
Date: | Sat, 05 Mar 2011 13:44:54 -0500 |
Organization: | A noiseless patient Spider |
References: | 11-03-006 11-03-014 |
Keywords: | syntax, history |
Posted-Date: | 06 Mar 2011 13:44:00 EST |
> As for me, I don't like conditional assignments,
> much preferring the traditional form --
> if e > f then a := b else a := c;
It's very sad that programmers are trained to artificially separate the
world into "statements" and "expressions" and hence end up, as above,
preferring the less precise and more redundant form.
To me
a := if e > f then b else c;
has various advantages, e.g.:
- common subexpression elimination.
- make it blatantly obvious that this whole thing sets `a' without
having to check what each branch does.
Stefan
Return to the
comp.compilers page.
Search the
comp.compilers archives again.