Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site bbncca.ARPA Path: utzoo!linus!bbncca!keesan From: keesan@bbncca.ARPA (Morris Keesan) Newsgroups: net.lang Subject: Re: Superstition in Programmers Message-ID: <448@bbncca.ARPA> Date: Fri, 6-Jan-84 10:38:26 EST Article-I.D.: bbncca.448 Posted: Fri Jan 6 10:38:26 1984 Date-Received: Sat, 7-Jan-84 02:18:32 EST References: <598@dciem.UUCP> Organization: Bolt, Beranek and Newman, Cambridge, Ma. Lines: 13 ---------------------------- Actually, I don't consider "counting downwards to 0 instead of upwards to how_many_times" to be superstitious behaviour, as Mark Brader does. I do this myself, but I do it on purpose and with the knowledge of why I do it, which is that on many (most?) machines, a comparison with zero is cheaper than comparison with other constants -- that is, the machine instruction takes fewer bytes ior is faster. Likewise, I will use comparisons like "i < 0" in favor of "i == -1" when possible (e.g. checking for error returns from U*IX system calls) because I know that checking sign is smaller/faster than comparison to constant. -- Morris M. Keesan {decvax,linus,wjh12}!bbncca!keesan keesan @ BBN-UNIX.ARPA