[Edu-sig] Truth values and comparisons

Scott David Daniels Scott.Daniels at Acm.Org
Mon Nov 6 00:51:08 CET 2006


Arthur wrote:
> <some code with an issue addressed by Dan Crosta>
> ... Is concerning myself with this distinction sound programming, or is 
> the hard core answer more to the effect what works works, what doesn't 
> doesn't - and one should focus only on that, and perhaps the performance 
> impact of available alternatives?

For my money (and that of most professional programmers I don't revile),
it is _vital_ to concern yourself with such distinctions.  Writing code
should be an exercise in "how do I express this the most clearly," not
"how can I make it run as fast as possible."  Code first must be
correct, then "obviously" correct, then "fast enough" (which in some
special cases is "as fast as possible").  Clearly correct can either
come from how the code itself is written, or (if necessary hen getting
the speed up) through comments that help the reader understand why it
is correct.

> Though I guess we are all allowed to define "sound programming" for 
> ourselves.

With the exception you pointed out about space shuttles.

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Edu-sig mailing list