Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Stupid variable names

Stupid variable names

Scheduled Pinned Locked Moved The Weird and The Wonderful
21 Posts 18 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P PIEBALDconsult

    What's in a name?

    L Offline
    L Offline
    Luc Pattyn
    wrote on last edited by
    #5

    sadly enough, often all the documentation one gets. :((

    Luc Pattyn [Forum Guidelines] [My Articles]


    Sorry for any delays in replying, I currently don't always get e-mail notifications.


    1 Reply Last reply
    0
    • C CurtD

      I've seen some good ones, but this has to be one of the best

      MyCrapClassVector something_to_which_to_point;

      He thought he had to declare this to pass a "dummy" ptr var to a method. Turns out the code was never executed anyway. But he could have just passed NULL.

      V Offline
      V Offline
      Vasudevan Deepak Kumar
      wrote on last edited by
      #6

      CurtD wrote:

      something_to_which_to_point

      Are you concerned by the nomenclature of this variable? Perhaps he was attempting to desist hardcoding in the parameter and using a constant type for better readability?

      Vasudevan Deepak Kumar Personal Homepage
      Tech Gossips
      A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

      1 Reply Last reply
      0
      • C CurtD

        I've seen some good ones, but this has to be one of the best

        MyCrapClassVector something_to_which_to_point;

        He thought he had to declare this to pass a "dummy" ptr var to a method. Turns out the code was never executed anyway. But he could have just passed NULL.

        D Offline
        D Offline
        Daniel Ch Bloch MCSD MCAD MCTS
        wrote on last edited by
        #7

        Years ago, another developer told me about a special coding horror... he had an developer that falled in love and so he called for the next module all his variables with the name of his beloved... from Susi001 to Susixxx :) Now, try to read such a program ...

        C C 2 Replies Last reply
        0
        • C CurtD

          I've seen some good ones, but this has to be one of the best

          MyCrapClassVector something_to_which_to_point;

          He thought he had to declare this to pass a "dummy" ptr var to a method. Turns out the code was never executed anyway. But he could have just passed NULL.

          D Offline
          D Offline
          Daniel Ch Bloch MCSD MCAD MCTS
          wrote on last edited by
          #8

          The absolut hardes thing I found was when I searched for a bug in a Module written in some kind of PL/I. I tried to understand, why a special line of code does not work, using 'true' and 'false' Boolean statements... now ... my forerunner was able du redefine true and false so that true was 0 and false was -1 ... incredible!

          H 1 Reply Last reply
          0
          • D Daniel Ch Bloch MCSD MCAD MCTS

            Years ago, another developer told me about a special coding horror... he had an developer that falled in love and so he called for the next module all his variables with the name of his beloved... from Susi001 to Susixxx :) Now, try to read such a program ...

            C Offline
            C Offline
            CurtD
            wrote on last edited by
            #9

            Daniel Ch. Bloch (MCSD, MCAD, MCTS) wrote:

            Years ago, another developer told me about a special coding horror... he had an developer that falled in love and so he called for the next module all his variables with the name of his beloved... from Susi001 to Susixxx Now, try to read such a program ...

            :laugh: In the really geeky days, I knew a guy who named all his vars after Star Trek characters. "Spock1", "Kirk42".

            P H 2 Replies Last reply
            0
            • D Daniel Ch Bloch MCSD MCAD MCTS

              The absolut hardes thing I found was when I searched for a bug in a Module written in some kind of PL/I. I tried to understand, why a special line of code does not work, using 'true' and 'false' Boolean statements... now ... my forerunner was able du redefine true and false so that true was 0 and false was -1 ... incredible!

              H Offline
              H Offline
              Hufak
              wrote on last edited by
              #10

              In my first Fortran program I managed to redefine a constant 3 (written as a digit '3' in the source) to something else (by passing it to a subroutine that changed its argument) and then the program would crash at the DO statement which should have executed 3 times. I never figured it out, needed a senior colleague to find it for me.

              1 Reply Last reply
              0
              • C CurtD

                Daniel Ch. Bloch (MCSD, MCAD, MCTS) wrote:

                Years ago, another developer told me about a special coding horror... he had an developer that falled in love and so he called for the next module all his variables with the name of his beloved... from Susi001 to Susixxx Now, try to read such a program ...

                :laugh: In the really geeky days, I knew a guy who named all his vars after Star Trek characters. "Spock1", "Kirk42".

                P Offline
                P Offline
                Pete OHanlon
                wrote on last edited by
                #11

                I used to know a sys admin who named all the hardware after Star Trek things. A server was called StarBase1 and it had printers attached to it called DeepSpace1 and so on. The reason he did this - he was called Pete Warr and we had the habit of using the first 4 characters of the surname and the first initial as user names so he was warrp (mind you, he was luckier than Kenny Cockburn, he really had problems with his login).

                Deja View - the feeling that you've seen this post before.

                My blog | My articles

                R 1 Reply Last reply
                0
                • D Daniel Ch Bloch MCSD MCAD MCTS

                  Years ago, another developer told me about a special coding horror... he had an developer that falled in love and so he called for the next module all his variables with the name of his beloved... from Susi001 to Susixxx :) Now, try to read such a program ...

                  C Offline
                  C Offline
                  Clive D Pottinger
                  wrote on last edited by
                  #12

                  An old favourite of mine was a piece of commercial software code I ran across in college. The programmer had a particular routine which was used to handle error exceptions, close any open files, etc. and terminate. He decided to mark the routine with the label HELL. Why? So that whenever he detected that something had gone wrong he could write GOTO...

                  Clive Pottinger Victoria, BC

                  modified on Tuesday, December 18, 2007 4:48:12 PM

                  P F R 3 Replies Last reply
                  0
                  • P Pete OHanlon

                    I used to know a sys admin who named all the hardware after Star Trek things. A server was called StarBase1 and it had printers attached to it called DeepSpace1 and so on. The reason he did this - he was called Pete Warr and we had the habit of using the first 4 characters of the surname and the first initial as user names so he was warrp (mind you, he was luckier than Kenny Cockburn, he really had problems with his login).

                    Deja View - the feeling that you've seen this post before.

                    My blog | My articles

                    R Offline
                    R Offline
                    Robin Imrie
                    wrote on last edited by
                    #13

                    A couple of sys admin i know have named their server room "the shire" all the *nix server names have a LOTR theme to them and the windows servers are named after the sith. eg Darth Maul.

                    P 1 Reply Last reply
                    0
                    • R Robin Imrie

                      A couple of sys admin i know have named their server room "the shire" all the *nix server names have a LOTR theme to them and the windows servers are named after the sith. eg Darth Maul.

                      P Offline
                      P Offline
                      Paul Conrad
                      wrote on last edited by
                      #14

                      :laugh::laugh::laugh:

                      "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

                      1 Reply Last reply
                      0
                      • C Clive D Pottinger

                        An old favourite of mine was a piece of commercial software code I ran across in college. The programmer had a particular routine which was used to handle error exceptions, close any open files, etc. and terminate. He decided to mark the routine with the label HELL. Why? So that whenever he detected that something had gone wrong he could write GOTO...

                        Clive Pottinger Victoria, BC

                        modified on Tuesday, December 18, 2007 4:48:12 PM

                        P Offline
                        P Offline
                        Paul Conrad
                        wrote on last edited by
                        #15

                        :laugh::laugh::laugh: That is good.

                        "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

                        1 Reply Last reply
                        0
                        • C Clive D Pottinger

                          An old favourite of mine was a piece of commercial software code I ran across in college. The programmer had a particular routine which was used to handle error exceptions, close any open files, etc. and terminate. He decided to mark the routine with the label HELL. Why? So that whenever he detected that something had gone wrong he could write GOTO...

                          Clive Pottinger Victoria, BC

                          modified on Tuesday, December 18, 2007 4:48:12 PM

                          F Offline
                          F Offline
                          fantasy1215
                          wrote on last edited by
                          #16

                          Very cool. :laugh:

                          1 Reply Last reply
                          0
                          • C CurtD

                            I've seen some good ones, but this has to be one of the best

                            MyCrapClassVector something_to_which_to_point;

                            He thought he had to declare this to pass a "dummy" ptr var to a method. Turns out the code was never executed anyway. But he could have just passed NULL.

                            J Offline
                            J Offline
                            Jamie Nordmeyer
                            wrote on last edited by
                            #17

                            My favorite was a guy who used to contract at our company. He liked to write his code using variable names like tt (for Transaction Type), and pt (for Process Type, not Point). I happen to understand what he was writing as I somewhat knew the system he was working on, but what about another developer who was coming in fresh? They're not going to have a clue without asking, or a lot of time analyzing it. Even better, he liked to rewrite other people's code to fit in with his "better" design. There's nothing worse than someone "knows" they know better than you, but clearly doesn't.

                            Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan Portland, Oregon, USA

                            D 1 Reply Last reply
                            0
                            • C CurtD

                              Daniel Ch. Bloch (MCSD, MCAD, MCTS) wrote:

                              Years ago, another developer told me about a special coding horror... he had an developer that falled in love and so he called for the next module all his variables with the name of his beloved... from Susi001 to Susixxx Now, try to read such a program ...

                              :laugh: In the really geeky days, I knew a guy who named all his vars after Star Trek characters. "Spock1", "Kirk42".

                              H Offline
                              H Offline
                              HuntingWabbits
                              wrote on last edited by
                              #18

                              My personal favourite is from some old Foxpro code I saw which had a global variable called: OB1KNOBI (Obi-wan Kenobi...) (Only 8 chars long of course...) Some (very) old support utilities I have seen had swear words as variable names, which caused a couple of problems when an error occurs... A big DOS error box appears showing 'Variable "swear word" not found' !

                              1 Reply Last reply
                              0
                              • C CurtD

                                I've seen some good ones, but this has to be one of the best

                                MyCrapClassVector something_to_which_to_point;

                                He thought he had to declare this to pass a "dummy" ptr var to a method. Turns out the code was never executed anyway. But he could have just passed NULL.

                                M Offline
                                M Offline
                                Mark C Hagers
                                wrote on last edited by
                                #19

                                Some years ago I had to convert a quickbasic program to VB6. The original developer had a variable called drol (for diameter of the roll). However in my (and his) native language, dutch, this also means turd.

                                Mark C Hagers New Media Ventures Amersfoort, the Netherlands

                                1 Reply Last reply
                                0
                                • C Clive D Pottinger

                                  An old favourite of mine was a piece of commercial software code I ran across in college. The programmer had a particular routine which was used to handle error exceptions, close any open files, etc. and terminate. He decided to mark the routine with the label HELL. Why? So that whenever he detected that something had gone wrong he could write GOTO...

                                  Clive Pottinger Victoria, BC

                                  modified on Tuesday, December 18, 2007 4:48:12 PM

                                  R Offline
                                  R Offline
                                  Robodroid
                                  wrote on last edited by
                                  #20

                                  Reminds me of a former co-worker who named all his programs POORLY. (I don't mean he chose bad names, I mean *each* of his programs had the same name ... POORLY.) I asked him why he did so. He replied that he liked it when he saw the computer display "COMPILING POORLY" when he submitted his programs....

                                  ;^)

                                  'droid

                                  1 Reply Last reply
                                  0
                                  • J Jamie Nordmeyer

                                    My favorite was a guy who used to contract at our company. He liked to write his code using variable names like tt (for Transaction Type), and pt (for Process Type, not Point). I happen to understand what he was writing as I somewhat knew the system he was working on, but what about another developer who was coming in fresh? They're not going to have a clue without asking, or a lot of time analyzing it. Even better, he liked to rewrite other people's code to fit in with his "better" design. There's nothing worse than someone "knows" they know better than you, but clearly doesn't.

                                    Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan Portland, Oregon, USA

                                    D Offline
                                    D Offline
                                    Derek Bartram
                                    wrote on last edited by
                                    #21

                                    Sounds like a clever chap to me.... My kind of plan.... Guarenteed employment for life (or the life of the software :) )

                                    1 Reply Last reply
                                    0
                                    Reply
                                    • Reply as topic
                                    Log in to reply
                                    • Oldest to Newest
                                    • Newest to Oldest
                                    • Most Votes


                                    • Login

                                    • Don't have an account? Register

                                    • Login or register to search.
                                    • First post
                                      Last post
                                    0
                                    • Categories
                                    • Recent
                                    • Tags
                                    • Popular
                                    • World
                                    • Users
                                    • Groups