Boost logo

Boost :

From: John (EBo) David (ebo_at_[hidden])
Date: 2000-11-19 18:10:51


Paul Moore wrote:
>
> Good point. I missed this case. And thanks for the clear and detailed bug
> report.

Thanks. and you are welcome.

> I'd rather add a check as ...
>
> I.e., test at the top, on the pinciple of avoiding unnecessary work. Why
> calculate two GCDs when you won't use them?

even better!

> ...
> I've seen this before, and the rationale is good. But to be honest, no
> matter how good the reason, I simply can't stand the look of the code. 0=den
> just reads completely wrongly to me...

understand. As David Abrahams pointed out most modern compiles produce
a warning so he finds it easier to use warnings, and Joe Mariadassou got
used to reading it in a "(0==den)" manner. It really is a question of
style and preference. I personally got in the habit of coding in this
way after being bitten REALLY bad with a subtle bug that caused me to
loose DAYS worth of work tracking it down. Back in '79 or '80 when I
started programming in C the compilers were not as kind with the error
messages, and I just got in the habit and old habits die hard
sometimes...

The real motivation for my mentioning this as an aside is that I feel
submission of code segments should be internally self consistent. It
would probably annoy many people to be reading away and have the code
read "den==0" in one place and "0==den" 20 lines down -- and for good
reason. So, when I posted a potential fix I coded it up the way I
prefer, pointed out the reason why I prefer this style, and waited to
see if anyone had comments... Since Paul Moore has a preference, any
further bug reports or additions will attempt to duplicate his style
conventions so that they attempt to be indistinguishable from his own
code...

I would also like to second Beman Dawes' feelings that "It's always
great when boost developers can respond promptly to bug reports."

Thank y'all,

  EBo --

Your brother in Boolean -- there is the one, the zero, and the slight
transition in-between...


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk