Loading ...
Sorry, an error occurred while loading the content.

Re: [hackers-il] Common Abbreviations in Variable Names

Expand Messages
  • mulix
    ... really? never seen those. ... istr something about the i coming from fortran, where the first letter (only letter?) of the variable stood for its type. any
    Message 1 of 16 , Sep 18, 2001
    • 0 Attachment
      On Tue, 18 Sep 2001, Shlomi Fish wrote:

      > a, b - common names for iterators and temporary variables

      really? never seen those.

      > cmd - command
      > i, j - common names for iterators and temporary variables that hold
      > integers.

      istr something about the i coming from fortran, where the first letter
      (only letter?) of the variable stood for its type. any of the old timers
      care to enlighten us?

      > iter - iteration (also: iters == iterations

      also 'it'.

      > num - number
      > obj - object
      > prod - product
      > ptr - pointer
      > ref - reference
      > str - string

      you forgot the great catch all variable, 'tmp'.

      > Of course, there are many speicialized field in computer science which
      > have their own conventions. For instance, when working in Matlab, the
      > convulotion (what is which you don't want to know) is called conv. I used

      err, i think that convulted parantesized clause was a great
      demonstration of a convulation

      > to have variable names like "filters_in_fourier_domain" because I didn't
      > know how to abbreviate it.

      sometimes, giving long meaningfull names to variables is sufficient
      documentation. this is especially true when naming functions. sometimes,
      giving meaningful names to variables is a hinderance.

      i'll let you decide for yourself if using meaningful names in this
      snippet i wrote for the r2l project was a good idea.

      [note: this code sucks. dont bother flaming, i know].

      static void
      delete_argv_members(char* argv[], unsigned int how_many_left, unsigned
      int how_many_to_delete)
      {
      char** start = argv + how_many_to_delete;
      unsigned int index = 0;
      how_many_left -= how_many_to_delete;

      if (how_many_to_delete == 0)
      return;

      while (index < how_many_left){
      argv[index] = start[index];
      ++index;
      }

      for ( ; how_many_to_delete > 0 ; --how_many_to_delete)
      argv[index++] = NULL;
      }


      --
      mulix

      http://www.advogato.com/person/mulix
      http://www.sf.net/projects/syscalltrack
    • Nadav Har'El
      ... Most abbreviations are personal, i.e., someone likes to call a number num , and someone else likes to call it n . I doubt you ll get very far with making
      Message 2 of 16 , Sep 18, 2001
      • 0 Attachment
        On Tue, Sep 18, 2001, Shlomi Fish wrote about "[hackers-il] Common Abbreviations in Variable Names":
        > What many programmers do is use abbreviations for common names. Like "num"
        > for "number" or "iter(s)" for iteration(s). Does anybody know of a
        > collection of such abbreviations? I googlized for it but could not find
        > anything relevant. If all else fails, we (or should I say I) can start our
        > own.

        Most abbreviations are personal, i.e., someone likes to call a number "num",
        and someone else likes to call it "n". I doubt you'll get very far with
        making a list of such abbrevations.

        Some abbreviations got popularized, however, by books, manual pages, and
        the like. For example, it is common to see
        int fd; /* file descriptor */
        FILE *fp; /* file pointer */

        more modern manuals usually name a file descriptor "fildes", not "fd",
        and a file pointer "stream", not "fp" - I'm not sure why, or where they got
        this convention (this is the convention both Solaris and Linux seem to
        follow in the manpages).


        Other names I often see is "s" for string (and s1, s2, etc. for other
        strings), i, j, and k, for loop indices (obviously this use stems not
        only from fortran, but more importantly from the original FORmulae that
        fortran TRANslated, in which i,j,k are typically used as indices).
        c is typically used for character, though it is frequently declared
        as int (see getchar(3) if you don't know why).


        P.S. about your question about Fortran: If I remember correctly, Fortran 77,
        by default, had any variable with its first letter [I-N] be an integer
        and any other variable a "real" (floating-point). You could overide this
        for a specific variable by declaring it, such as
        INTEGER*4 GOD
        (one of my random sigs say "In fortran, God is real unless declared an
        integer" ;) ), or by changing the implicit declaration default, using the
        IMPLICIT command. The command
        IMPLICIT NONE
        cancled the implicit definitions, and forced you to declare every variable.
        But most people just stuck to the defaults, and chose the variable name
        accordingly: so for example, if you need a variable to hold a row number
        in a matrix, you would usually call it "IROW", so it would come out as an
        integer ("ROW" would be real by default).

        --
        Nadav Har'El | Wednesday, Sep 19 2001, 2 Tishri 5762
        nyh@... |-----------------------------------------
        Phone: +972-53-245868, ICQ 13349191 |Does replacing myself with a shell-script
        http://nadav.harel.org.il |make me impressive or insignificant?
      • Adi Stav
        On Tue, Sep 18, 2001 at 08:22:27PM +0300, Shlomi Fish wrote: [snip] ... I use num for remembering sizes of arrays, i.e., struct bar { struct foo *foos; int
        Message 3 of 16 , Sep 18, 2001
        • 0 Attachment
          On Tue, Sep 18, 2001 at 08:22:27PM +0300, Shlomi Fish wrote:
          [snip]
          > Here are some from the top of my head:
          >
          > a, b - common names for iterators and temporary variables
          > cmd - command
          > i, j - common names for iterators and temporary variables that hold
          > integers.
          > iter - iteration (also: iters == iterations
          > num - number

          I use num for remembering sizes of arrays, i.e.,

          struct bar {
          struct foo *foos;
          int num_foos;
          }

          > obj - object

          This should probably never be used. I cannot think of any reasonable
          circumenstances except for when writing your own object system where
          this name can convey any meaning.

          > prod - product
          > ptr - pointer

          I personally use p for pointer

          > ref - reference
          > str - string
          > var - variable

          Ditto obj.

          > x, y, z - the x-y-z dimensions as well as iterators and temporary
          > variables

          h for handler. Arguably ditto obj.


          On Wed, Sep 19, 2001 at 12:02:38AM +0300, mulix wrote:
          > On Tue, 18 Sep 2001, Shlomi Fish wrote:
          >
          > > a, b - common names for iterators and temporary variables
          >
          > really? never seen those.

          *COUGH*sort*COUGH*COUGH*perl*COUGH*COUGH*braindamage*COUGH*

          I also think a and b were used in K&R's original max()/min()
          functions. If not, then they're certainly used in many
          implementations of them.

          [snip]
          > > Of course, there are many speicialized field in computer science which
          > > have their own conventions. For instance, when working in Matlab, the
          > > convulotion (what is which you don't want to know) is called conv. I used
          >
          > err, i think that convulted parantesized clause was a great
          > demonstration of a convulation

          Whatcha gonna do. Prepositions are never correct words to end
          sentences with. Talk about learning how to think in unorthodox
          ways trying to get over a language's limitations :)
        • Adi Stav
          ... My opinion (which admittedly has no Hungarian roots whatsoever) is that a name should complement the type in conveying information. Therefore the only
          Message 4 of 16 , Sep 18, 2001
          • 0 Attachment
            On Wed, Sep 19, 2001 at 12:02:38AM +0300, mulix wrote:
            > sometimes, giving long meaningfull names to variables is sufficient
            > documentation. this is especially true when naming functions. sometimes,
            > giving meaningful names to variables is a hinderance.

            My opinion (which admittedly has no Hungarian roots whatsoever) is
            that a name should complement the type in conveying information.
            Therefore the only reason to call a pointer "p" or "ptr" is if the
            fact that is it a pointer IS its role in the function, as opposed
            to, say, pointing to some specific object.

            I think a name should always be meaningful to some degree. HOW
            meaningful is a delicate decision. But no name should simply
            repeat information that can be otherwise received from its
            delcaration in place of new and more important information.
            On many occasions "tmp" is so much more meaningful than
            "storage_of_pointer_to_foo_struct".

            > i'll let you decide for yourself if using meaningful names in this
            > snippet i wrote for the r2l project was a good idea.
            >
            > [note: this code sucks. dont bother flaming, i know].

            You're using 5-character indentation. May I ask what exactly is
            your hidden political agenda with this? :)

            > static void
            > delete_argv_members(char* argv[], unsigned int how_many_left, unsigned
            > int how_many_to_delete)
            > {
            > char** start = argv + how_many_to_delete;
            > unsigned int index = 0;
            > how_many_left -= how_many_to_delete;
            >
            > if (how_many_to_delete == 0)
            > return;
            >
            > while (index < how_many_left){
            > argv[index] = start[index];
            > ++index;
            > }
            >
            > for ( ; how_many_to_delete > 0 ; --how_many_to_delete)
            > argv[index++] = NULL;
            > }

            how_many_to_delete and how_many_left are good names IMO once you
            strike out "how_many". Not because they're too long, but because
            "how_many" simply repeats information from the type. "argv" is
            obviously a good name, though, because of the immediate association
            to main().
          • Shlomi Fish
            Incidently, once when I was converting a program from C to Java (MikMod) I encountered a variable named done . I believed it was a boolean value, but it
            Message 5 of 16 , Sep 18, 2001
            • 0 Attachment
              Incidently, once when I was converting a program from C to Java (MikMod) I
              encountered a variable named "done". I believed it was a boolean value,
              but it turned out it was an integer.

              The program still run with the variable declared as bool, but it ran much
              faster, once I modified it back to an integer. So, it should have been
              named num_done, or something like that.

              Regards,

              Shlomi Fish



              ----------------------------------------------------------------------
              Shlomi Fish shlomif@...
              Home Page: http://t2.technion.ac.il/~shlomif/
              Home E-mail: shlomif@...

              A more experienced programmer does not make less bugs. He just realizes
              what went wrong more quickly.
            • Adi Stav
              ... This road leads to Hungary. You d have to encode whether every C int is an integer or a boolean. Wouldn t it better to write what is being counted instead,
              Message 6 of 16 , Sep 19, 2001
              • 0 Attachment
                On Wed, Sep 19, 2001 at 09:44:47AM +0300, Shlomi Fish wrote:
                >
                > Incidently, once when I was converting a program from C to Java (MikMod) I
                > encountered a variable named "done". I believed it was a boolean value,
                > but it turned out it was an integer.
                >
                > The program still run with the variable declared as bool, but it ran much
                > faster, once I modified it back to an integer. So, it should have been
                > named num_done, or something like that.

                This road leads to Hungary. You'd have to encode whether every C int
                is an integer or a boolean. Wouldn't it better to write what is being
                counted instead, e.g. bytes_done?
              • Shlomi Fish
                ... Actually, that is not the Mathematical definition of convolution (sorry for my own typo). In Mathematics a convolution is a process that takes two
                Message 7 of 16 , Sep 19, 2001
                • 0 Attachment
                  On Wed, 19 Sep 2001, mulix wrote:

                  > On Tue, 18 Sep 2001, Shlomi Fish wrote:
                  >
                  > > Of course, there are many speicialized field in computer science which
                  > > have their own conventions. For instance, when working in Matlab, the
                  > > convulotion (what is which you don't want to know) is called conv. I used
                  >
                  > err, i think that convulted parantesized clause was a great
                  > demonstration of a convulation
                  >

                  Actually, that is not the Mathematical definition of convolution (sorry
                  for my own typo). In Mathematics a convolution is a process that takes two
                  functions (let's say from R -> R) and create a convolved function by means
                  of sampling the integral of the functions' multiplication when offseted by
                  a new variable. Notice that in the multiplication one of the functions
                  is reversed. (I told you you don't want to know what it is)

                  Convultion has many uses. For instance, it can be used to get the output
                  of a given signal from a Linear Time-Invariant (LTI) system. In a similar
                  manner it can be used to find a comulative system of two cascaded system.

                  Linearily and Time-Invariantly yours,

                  Shlomi Fish



                  ----------------------------------------------------------------------
                  Shlomi Fish shlomif@...
                  Home Page: http://t2.technion.ac.il/~shlomif/
                  Home E-mail: shlomif@...

                  A more experienced programmer does not make less bugs. He just realizes
                  what went wrong more quickly.
                • Shlomi Fish
                  ... Let s settle for num_bytes_done... ;-) So we can have is_it_done vs. num_done with is_bytes_done and num_bytes_done for clarity. Regards, Shlomi Fish ...
                  Message 8 of 16 , Sep 19, 2001
                  • 0 Attachment
                    On Wed, 19 Sep 2001, Adi Stav wrote:

                    > On Wed, Sep 19, 2001 at 09:44:47AM +0300, Shlomi Fish wrote:
                    > >
                    > > Incidently, once when I was converting a program from C to Java (MikMod) I
                    > > encountered a variable named "done". I believed it was a boolean value,
                    > > but it turned out it was an integer.
                    > >
                    > > The program still run with the variable declared as bool, but it ran much
                    > > faster, once I modified it back to an integer. So, it should have been
                    > > named num_done, or something like that.
                    >
                    > This road leads to Hungary. You'd have to encode whether every C int
                    > is an integer or a boolean. Wouldn't it better to write what is being
                    > counted instead, e.g. bytes_done?
                    >

                    Let's settle for num_bytes_done... ;-)

                    So we can have is_it_done vs. num_done with is_bytes_done and
                    num_bytes_done for clarity.

                    Regards,

                    Shlomi Fish



                    >
                    > To unsubscribe from this group, send an email to:
                    > hackers-il-unsubscribe@egroups.com
                    >
                    >
                    >
                    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                    >
                    >



                    ----------------------------------------------------------------------
                    Shlomi Fish shlomif@...
                    Home Page: http://t2.technion.ac.il/~shlomif/
                    Home E-mail: shlomif@...

                    A more experienced programmer does not make less bugs. He just realizes
                    what went wrong more quickly.
                  • mulix
                    ... i beg to disagree. obj should be used exactly in the same place that i or it is used - where it is obvious what kind of object you re talking about
                    Message 9 of 16 , Sep 19, 2001
                    • 0 Attachment
                      On Wed, 19 Sep 2001, Adi Stav wrote:

                      > > obj - object
                      >
                      > This should probably never be used. I cannot think of any reasonable
                      > circumenstances except for when writing your own object system where
                      > this name can convey any meaning.

                      i beg to disagree. obj should be used exactly in the same place that 'i'
                      or 'it' is used - where it is obvious what kind of object you're talking
                      about from the context, and anything more verbose is overkill.

                      then again, i grepped through my source and couldn't find a single place
                      where i've actually used the token 'obj', except in comments, so take
                      the above with a grain of salt.

                      > On Wed, Sep 19, 2001 at 12:02:38AM +0300, mulix wrote:
                      > > On Tue, 18 Sep 2001, Shlomi Fish wrote:
                      > >
                      > > > a, b - common names for iterators and temporary variables
                      > >
                      > > really? never seen those.
                      >
                      > *COUGH*sort*COUGH*COUGH*perl*COUGH*COUGH*braindamage*COUGH*
                      >
                      > I also think a and b were used in K&R's original max()/min()
                      > functions. If not, then they're certainly used in many
                      > implementations of them.

                      this reminds me of another pair of common tokens, 'lhs' and 'rhs'.
                      --
                      mulix

                      http://www.advogato.com/person/mulix
                      http://www.sf.net/projects/syscalltrack
                    • guy keren
                      ... [adi responded] ... actually any program that uses containers, manages objects. object oriented code is exactly about writing your own objet system, even
                      Message 10 of 16 , Sep 19, 2001
                      • 0 Attachment
                        On Wed, 19 Sep 2001, mulix wrote:

                        > > > obj - object

                        [adi responded]
                        > > This should probably never be used. I cannot think of any reasonable
                        > > circumenstances except for when writing your own object system where
                        > > this name can convey any meaning.

                        actually any program that uses containers, manages objects. object
                        oriented code is exactly about writing your own objet system, even if the
                        root object isn't named 'Object'.

                        [muli responded]
                        > i beg to disagree. obj should be used exactly in the same place that 'i'
                        > or 'it' is used - where it is obvious what kind of object you're talking
                        > about from the context, and anything more verbose is overkill.
                        >
                        > then again, i grepped through my source and couldn't find a single place
                        > where i've actually used the token 'obj', except in comments, so take
                        > the above with a grain of salt.

                        actualy, i grepped some of my code, and i used 'obj' in several such
                        cases. most notably, sometimes when iterating (using 'iter') over a set of
                        objects, i used 'obj' to store the current iterated object, in order to
                        perform operations on it.

                        --
                        guy

                        "For world domination - press 1,
                        or dial 0, and please hold, for the creator." -- nob o. dy
                      • Nadav Har'El
                        ... With such a convoluted explaination (pun intented), no wonder convolutions sounds complicated... (just kidding!) They actually aren t that complicated, if
                        Message 11 of 16 , Sep 19, 2001
                        • 0 Attachment
                          On Wed, Sep 19, 2001, Shlomi Fish wrote about "[hackers-il] Convulotions [was Re: Common Abbreviations in Variable Names]":
                          > Actually, that is not the Mathematical definition of convolution (sorry
                          > for my own typo). In Mathematics a convolution is a process that takes two
                          > functions (let's say from R -> R) and create a convolved function by means
                          > of sampling the integral of the functions' multiplication when offseted by
                          > a new variable. Notice that in the multiplication one of the functions
                          > is reversed. (I told you you don't want to know what it is)

                          With such a convoluted explaination (pun intented), no wonder convolutions
                          sounds complicated... (just kidding!)

                          They actually aren't that complicated, if you look at why they were invented,
                          and their original use - as a way to smooth functions. Take one arbitrary
                          function f, and a "smoothing function" g, the latter is a function with
                          integral of 1, say a narrow gaussian.

                          You want to "smooth" f using this gaussian g, by replacing the function value
                          at each point x by the weighed average of the function f at that point x
                          (weighed according to the given gaussian function g). This is the convolution
                          [of the original f and the gaussian g at the given x].

                          This turns out to be the same as doing an integral of the original function
                          times the moved second function (gaussian in my example) and taking the value
                          at the given point. I have to admit I don't remember why the second function
                          is flipped around x=0 (it doesn't matter anyway if the second function is
                          symmetric around x=0, as it was in the above gaussian example).

                          It's all very much easier to understand if you draw a few simple pictures.

                          Of course, this isn't really a math list, so I won't get into exact
                          definitions, uses, or (my favorites) - "distributions" (just to give you
                          a taste: these are entities more general than functions that interact via
                          convolutions. The Dirac "delta" function Physicists so adore is actually a
                          distribution, not a function. Its convultion with a function f(x) results
                          in f(0)).


                          --
                          Nadav Har'El | Wednesday, Sep 19 2001, 3 Tishri 5762
                          nyh@... |-----------------------------------------
                          Phone: +972-53-245868, ICQ 13349191 |The space between my ears was
                          http://nadav.harel.org.il |intentionally left blank.
                        • Adi Stav
                          ... Yes, that is true. Thank you.
                          Message 12 of 16 , Sep 20, 2001
                          • 0 Attachment
                            On Wed, Sep 19, 2001 at 07:31:25PM +0300, guy keren wrote:
                            > On Wed, 19 Sep 2001, mulix wrote:
                            >
                            > > > > obj - object
                            >
                            > [adi responded]
                            > > > This should probably never be used. I cannot think of any reasonable
                            > > > circumenstances except for when writing your own object system where
                            > > > this name can convey any meaning.
                            >
                            > actually any program that uses containers, manages objects. object
                            > oriented code is exactly about writing your own objet system, even if the
                            > root object isn't named 'Object'.
                            >
                            > [muli responded]
                            > > i beg to disagree. obj should be used exactly in the same place that 'i'
                            > > or 'it' is used - where it is obvious what kind of object you're talking
                            > > about from the context, and anything more verbose is overkill.
                            > >
                            > > then again, i grepped through my source and couldn't find a single place
                            > > where i've actually used the token 'obj', except in comments, so take
                            > > the above with a grain of salt.
                            >
                            > actualy, i grepped some of my code, and i used 'obj' in several such
                            > cases. most notably, sometimes when iterating (using 'iter') over a set of
                            > objects, i used 'obj' to store the current iterated object, in order to
                            > perform operations on it.

                            Yes, that is true. Thank you.
                          • Shlomi Fish
                            ... The problem is that it is possible to convolve a function with another function that will sharpen it. ... Actually a convolution of two functions is always
                            Message 13 of 16 , Sep 20, 2001
                            • 0 Attachment
                              On Wed, 19 Sep 2001, Nadav Har'El wrote:

                              > On Wed, Sep 19, 2001, Shlomi Fish wrote about "[hackers-il] Convulotions [was Re: Common Abbreviations in Variable Names]":
                              > > Actually, that is not the Mathematical definition of convolution (sorry
                              > > for my own typo). In Mathematics a convolution is a process that takes two
                              > > functions (let's say from R -> R) and create a convolved function by means
                              > > of sampling the integral of the functions' multiplication when offseted by
                              > > a new variable. Notice that in the multiplication one of the functions
                              > > is reversed. (I told you you don't want to know what it is)
                              >
                              > With such a convoluted explaination (pun intented), no wonder convolutions
                              > sounds complicated... (just kidding!)
                              >
                              > They actually aren't that complicated, if you look at why they were invented,
                              > and their original use - as a way to smooth functions. Take one arbitrary
                              > function f, and a "smoothing function" g, the latter is a function with
                              > integral of 1, say a narrow gaussian.
                              >

                              The problem is that it is possible to convolve a function with another
                              function that will sharpen it.

                              > You want to "smooth" f using this gaussian g, by replacing the function value
                              > at each point x by the weighed average of the function f at that point x
                              > (weighed according to the given gaussian function g). This is the convolution
                              > [of the original f and the gaussian g at the given x].
                              >
                              > This turns out to be the same as doing an integral of the original function
                              > times the moved second function (gaussian in my example) and taking the value
                              > at the given point. I have to admit I don't remember why the second function
                              > is flipped around x=0 (it doesn't matter anyway if the second function is
                              > symmetric around x=0, as it was in the above gaussian example).
                              >
                              > It's all very much easier to understand if you draw a few simple pictures.
                              >
                              > Of course, this isn't really a math list, so I won't get into exact
                              > definitions, uses, or (my favorites) - "distributions" (just to give you
                              > a taste: these are entities more general than functions that interact via
                              > convolutions. The Dirac "delta" function Physicists so adore is actually a
                              > distribution, not a function. Its convultion with a function f(x) results
                              > in f(0)).
                              >

                              Actually a convolution of two functions is always another function. In our
                              case f(x) convolution delta(x) is equal to f(x).

                              Regards,

                              Shlomi Fish

                              >
                              > --
                              > Nadav Har'El | Wednesday, Sep 19 2001, 3 Tishri 5762
                              > nyh@... |-----------------------------------------
                              > Phone: +972-53-245868, ICQ 13349191 |The space between my ears was
                              > http://nadav.harel.org.il |intentionally left blank.
                              >
                              >
                              > To unsubscribe from this group, send an email to:
                              > hackers-il-unsubscribe@egroups.com
                              >
                              >
                              >
                              > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                              >
                              >



                              ----------------------------------------------------------------------
                              Shlomi Fish shlomif@...
                              Home Page: http://t2.technion.ac.il/~shlomif/
                              Home E-mail: shlomif@...

                              A more experienced programmer does not make less bugs. He just realizes
                              what went wrong more quickly.
                            • Nadav Har'El
                              ... Of course - I was just giving a way to think about what a convolution does. People who never heard of convolutions have no idea what it is good for, but
                              Message 14 of 16 , Sep 20, 2001
                              • 0 Attachment
                                On Thu, Sep 20, 2001, Shlomi Fish wrote about "[hackers-il] Re: Convulotions [was Re: Common Abbreviations in Variable Names]":
                                > The problem is that it is possible to convolve a function with another
                                > function that will sharpen it.

                                Of course - I was just giving a way to think about what a convolution does.
                                People who never heard of convolutions have no idea what it is good for,
                                but most people can imagine why you'd want to smooth a function, and how
                                you'd do it.
                                After it is defined, it is used for more complex things.

                                > Actually a convolution of two functions is always another function. In our
                                > case f(x) convolution delta(x) is equal to f(x).

                                You're right. My stupid mistake. The value of the convolution at 0 is f(0),
                                but the convolution itself is indeed f(x), a function.

                                > > Phone: +972-53-245868, ICQ 13349191 |The space between my ears was
                                > > http://nadav.harel.org.il |intentionally left blank.

                                This was an appropriate signature this time ;)

                                --
                                Nadav Har'El | Thursday, Sep 20 2001, 3 Tishri 5762
                                nyh@... |-----------------------------------------
                                Phone: +972-53-245868, ICQ 13349191 |Willpower: The ability to eat only one
                                http://nadav.harel.org.il |salted peanut.
                              • Oleg Goldshmidt
                                ... In the old Fortrans (the default is carried over to the newer ones, for compatibility) variables starting with i,j,k,l,m,n were integers, the rest -
                                Message 15 of 16 , Sep 20, 2001
                                • 0 Attachment
                                  mulix <mulix@...> writes:

                                  > On Tue, 18 Sep 2001, Shlomi Fish wrote:
                                  >
                                  > istr something about the i coming from fortran, where the first letter
                                  > (only letter?) of the variable stood for its type. any of the old timers
                                  > care to enlighten us?

                                  In the old Fortrans (the default is carried over to the newer ones,
                                  for compatibility) variables starting with i,j,k,l,m,n were integers,
                                  the rest - floats, unless explicitly declared. If you program Fortran,
                                  I strongly suggest explicitly declaring all variables and not relying
                                  on the defaults.

                                  >
                                  > > iter - iteration (also: iters == iterations
                                  >
                                  > also 'it'.
                                  >
                                  > > num - number
                                  > > obj - object
                                  > > prod - product
                                  > > ptr - pointer
                                  > > ref - reference
                                  > > str - string
                                  >
                                  > you forgot the great catch all variable, 'tmp'.

                                  Also src, dst, err, addr, incr, decr, del, rem, cpy, etc [this last
                                  one deserves a smiley]. There is any number of these "generally
                                  understandable" algorithms. Note btw [:-)] that some, such as ptr, are
                                  better off in comments than in code.

                                  --
                                  Oleg Goldshmidt | ogoldshmidt@...
                                  "If it ain't broken, it has not got enough features yet."
                                Your message has been successfully submitted and would be delivered to recipients shortly.