Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site decvax.UUCP Path: utzoo!linus!decvax!minow From: minow@decvax.UUCP (Martin Minow) Newsgroups: net.lang Subject: Re: Superstition in Programmers Message-ID: <327@decvax.UUCP> Date: Thu, 5-Jan-84 19:06:25 EST Article-I.D.: decvax.327 Posted: Thu Jan 5 19:06:25 1984 Date-Received: Fri, 6-Jan-84 02:57:48 EST References: <598@dciem.UUCP> Organization: DEC UNIX Engineering Group Lines: 39 Mark Brader pointed out that my example used a while loop where a for loop would be more appropriate and that I counted from a value down to zero where a more tool-oriented approach might be, say, function(max_value) int max_value; { register int count; for (count = 1; count <= max_value; count++) { something(); /* count is only a counter */ } } Note some interesting "superstitions" that the above illustrates: 1. I used the "fortran" style of loop (1 to N) rather than the C style (the count was not used as an index): for (count = 0; count < max_value; count++) { 2. I didn't write the loop in a bizarre (C and assembler hacker) fashion while (--max_value >= 0) { or (ecch): do { /* We know max_value is non-zero */ something(); } while (--max_value > 0); Furthermore, I didn't transmit the negative of max_value and count UP to zero, as I learned on the 7090 of blessed memory. Speaking of 7090's and superstition. I always remove the write ring from a tape as soon as I remove it from a tape drive. Always. Without fail. Tapes with write rings in are writable. You learned that lesson once. Martin Minow decvax!minow