From: <lm...@bi...> - 2006-11-06 03:03:40
|
On Sun, Nov 05, 2006 at 10:59:10PM +0000, Donal K. Fellows wrote: > Will Duquette wrote: > > Alternatively, if one used ":=" as the assignment operator for > > TIP 282 there'd be no active harm in using the enhanced syntax > > in "if" and "while". You *could* write "if {a := $b}" if you > > really wanted to, but you'd be much less likely to do it > > accidentally. > > I agree with and strongly support this suggestion. Many years of > experience with C and Java (learning, using, and teaching) tells me that > the "BCPL mistake"[*] is a horrible thing that always leads to trouble. > If we ensure that "=" is not legal, it forces people to choose between > definitely equality (==) and definitely assignment (:=). I've done this > in the past in other languages, and it makes for fewer user errors. For what it is worth, we have 8+ years of usage and we do horrible things like unless (f = fopen(file, "r")) { error stuff here } and I can't remember an instance of someone getting it wrong because we did an "==" instead of an "=" or the other way around. I think this is a newbie error that simply doesn't happen with pros. -- --- Larry McVoy lm at bitmover.com http://www.bitkeeper.com |