Path: utzoo!attcan!uunet!bu.edu!transfer!lectroid!angmar.sw.stratus.com!jmann From: jmann@angmar.sw.stratus.com (Jim Mann) Newsgroups: comp.lang.c Subject: Re: a style question Message-ID: <2556@lectroid.sw.stratus.com> Date: 2 Oct 90 17:28:26 GMT References: <7341@darkstar.ucsc.edu> <8660@ncar.ucar.edu> <1990Sep30.220839.20183@nntp-server.caltech.edu> <1990Oct1.174625.22061@zoo.toronto.edu> <1990Oct2.163853.17004@nntp-server.caltech.edu> Sender: usenet@lectroid.sw.stratus.com Reply-To: jmann@angmar.sw.stratus.com (Jim Mann) Organization: Stratus Computer, Inc. Lines: 26 In article <1990Oct2.163853.17004@nntp-server.caltech.edu>, manning@nntp-server.caltech.edu (Evan Marshall Manning) writes: |>henry@zoo.toronto.edu (Henry Spencer) writes: |> |>If Henry asks it must not be as self evident as I thought. Hasn't this |>ever happened to you: You're thinking that you could apply what you |>just learned on the net and speed up this time-critical bit of code by |>changing the original cout-up loop to a count-down loop. "But wait," you |>say, "What if some later code depends on the value of 'i' after exiting |>the loop? I'll just search for the letter 'i' through 100 lines of |>source." You find that a lower case 'i' appears an average of about |>four times per comment line. 'ix' appears in the comments only when |>the comments are about variable 'ix'. Or, similarly, you 'grep' 'i'. |> If you are using the variable for something other than just a loop counter, you probably want to give it a better name than i or ix anyway. Yes, ix is easier to grep for or search for, but it is no easier than i to figure out when reading through the code. (In fact, it is probably less easy. If I see i, I generally assume that it is probably some sort of simple counter. If I see ix, I'll probably spend some time wondering why the programmer called it ix, what x stands for, etc.) Jim Mann Stratus Computer jmann@es.stratus.com