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. Why name things sensibly, when you could also not?

Why name things sensibly, when you could also not?

Scheduled Pinned Locked Moved The Weird and The Wonderful
csshelpquestion
11 Posts 10 Posters 1 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.
  • R r_hyde

    The application I'm newly tasked with maintaining is a large heap of WTF, but I picked this problem out to share because it demonstrates the supreme barrier to understanding that the prior developer(s) have constructed:

    #define __2__
    // snip
    #if __2__
    // some comment-less code that has nothing ostensibly to do with the number 2
    #else
    // some other comment-less code that appears to have no relationship at all
    // to the prior alternative
    #endif

    :doh: :omg: :wtf: Actually, there are many comments all over the code, but of the sort that tell you absolutely nothing:

    //only check if max > -1
    if (max > -1)
    {
    ...
    }

    Why name that variable maxCsvPosition when a careful analysis of the dozens of lines of surrounding code will tell you that? What are you, lazy? And even dozens of lines is often a luxury—many of the methods in this thing are many hundreds of lines long! The variable names are typically like the following, their scope often spanning many screens' worth of code:

    ed1
    s
    sd
    p
    pd

    Shouting curse words with great frequency has become my new affect here at t'office. I despair :((

    P Offline
    P Offline
    PIEBALDconsult
    wrote on last edited by
    #2

    Variable naming rule 0) You don't have to name the variables you don't create.

    1 Reply Last reply
    0
    • R r_hyde

      The application I'm newly tasked with maintaining is a large heap of WTF, but I picked this problem out to share because it demonstrates the supreme barrier to understanding that the prior developer(s) have constructed:

      #define __2__
      // snip
      #if __2__
      // some comment-less code that has nothing ostensibly to do with the number 2
      #else
      // some other comment-less code that appears to have no relationship at all
      // to the prior alternative
      #endif

      :doh: :omg: :wtf: Actually, there are many comments all over the code, but of the sort that tell you absolutely nothing:

      //only check if max > -1
      if (max > -1)
      {
      ...
      }

      Why name that variable maxCsvPosition when a careful analysis of the dozens of lines of surrounding code will tell you that? What are you, lazy? And even dozens of lines is often a luxury—many of the methods in this thing are many hundreds of lines long! The variable names are typically like the following, their scope often spanning many screens' worth of code:

      ed1
      s
      sd
      p
      pd

      Shouting curse words with great frequency has become my new affect here at t'office. I despair :((

      A Offline
      A Offline
      Amarnath S
      wrote on last edited by
      #3

      My deciphering of four of those variable names is:

      s // represents 'something'
      sd // something different
      p // pointer to s
      pd // pointer to sd

      :-)

      R 1 Reply Last reply
      0
      • R r_hyde

        The application I'm newly tasked with maintaining is a large heap of WTF, but I picked this problem out to share because it demonstrates the supreme barrier to understanding that the prior developer(s) have constructed:

        #define __2__
        // snip
        #if __2__
        // some comment-less code that has nothing ostensibly to do with the number 2
        #else
        // some other comment-less code that appears to have no relationship at all
        // to the prior alternative
        #endif

        :doh: :omg: :wtf: Actually, there are many comments all over the code, but of the sort that tell you absolutely nothing:

        //only check if max > -1
        if (max > -1)
        {
        ...
        }

        Why name that variable maxCsvPosition when a careful analysis of the dozens of lines of surrounding code will tell you that? What are you, lazy? And even dozens of lines is often a luxury—many of the methods in this thing are many hundreds of lines long! The variable names are typically like the following, their scope often spanning many screens' worth of code:

        ed1
        s
        sd
        p
        pd

        Shouting curse words with great frequency has become my new affect here at t'office. I despair :((

        S Offline
        S Offline
        Super Lloyd
        wrote on last edited by
        #4

        This inspired me a little haiku! ;P

        if (nameOfUser)
        name ++;
        for (var word = 0; word < name; lowercase(ref word)) {
        Comments(ref products);
        }

        All in one Menu-Ribbon Bar DirectX for WinRT/C# since 2013! Taking over the world since 1371!

        1 Reply Last reply
        0
        • A Amarnath S

          My deciphering of four of those variable names is:

          s // represents 'something'
          sd // something different
          p // pointer to s
          pd // pointer to sd

          :-)

          R Offline
          R Offline
          r_hyde
          wrote on last edited by
          #5

          :laugh: Your guess is at least as good as mine until I can dig in more deeply. p is not a pointer (at least not in C# parlance) but turns out to hold an instance of something called a FieldDef :confused: This code was clearly written by vandals

          1 Reply Last reply
          0
          • R r_hyde

            The application I'm newly tasked with maintaining is a large heap of WTF, but I picked this problem out to share because it demonstrates the supreme barrier to understanding that the prior developer(s) have constructed:

            #define __2__
            // snip
            #if __2__
            // some comment-less code that has nothing ostensibly to do with the number 2
            #else
            // some other comment-less code that appears to have no relationship at all
            // to the prior alternative
            #endif

            :doh: :omg: :wtf: Actually, there are many comments all over the code, but of the sort that tell you absolutely nothing:

            //only check if max > -1
            if (max > -1)
            {
            ...
            }

            Why name that variable maxCsvPosition when a careful analysis of the dozens of lines of surrounding code will tell you that? What are you, lazy? And even dozens of lines is often a luxury—many of the methods in this thing are many hundreds of lines long! The variable names are typically like the following, their scope often spanning many screens' worth of code:

            ed1
            s
            sd
            p
            pd

            Shouting curse words with great frequency has become my new affect here at t'office. I despair :((

            B Offline
            B Offline
            Bernhard Hiller
            wrote on last edited by
            #6

            Well, with number two ... why not flush down the sh1t?

            1 Reply Last reply
            0
            • R r_hyde

              The application I'm newly tasked with maintaining is a large heap of WTF, but I picked this problem out to share because it demonstrates the supreme barrier to understanding that the prior developer(s) have constructed:

              #define __2__
              // snip
              #if __2__
              // some comment-less code that has nothing ostensibly to do with the number 2
              #else
              // some other comment-less code that appears to have no relationship at all
              // to the prior alternative
              #endif

              :doh: :omg: :wtf: Actually, there are many comments all over the code, but of the sort that tell you absolutely nothing:

              //only check if max > -1
              if (max > -1)
              {
              ...
              }

              Why name that variable maxCsvPosition when a careful analysis of the dozens of lines of surrounding code will tell you that? What are you, lazy? And even dozens of lines is often a luxury—many of the methods in this thing are many hundreds of lines long! The variable names are typically like the following, their scope often spanning many screens' worth of code:

              ed1
              s
              sd
              p
              pd

              Shouting curse words with great frequency has become my new affect here at t'office. I despair :((

              B Offline
              B Offline
              Brisingr Aerowing
              wrote on last edited by
              #7

              WTF? Whoever wrote that code needs to have a frontal lobotomy... As they are obviously antisocial psychopaths!

              What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???

              G Z 2 Replies Last reply
              0
              • R r_hyde

                The application I'm newly tasked with maintaining is a large heap of WTF, but I picked this problem out to share because it demonstrates the supreme barrier to understanding that the prior developer(s) have constructed:

                #define __2__
                // snip
                #if __2__
                // some comment-less code that has nothing ostensibly to do with the number 2
                #else
                // some other comment-less code that appears to have no relationship at all
                // to the prior alternative
                #endif

                :doh: :omg: :wtf: Actually, there are many comments all over the code, but of the sort that tell you absolutely nothing:

                //only check if max > -1
                if (max > -1)
                {
                ...
                }

                Why name that variable maxCsvPosition when a careful analysis of the dozens of lines of surrounding code will tell you that? What are you, lazy? And even dozens of lines is often a luxury—many of the methods in this thing are many hundreds of lines long! The variable names are typically like the following, their scope often spanning many screens' worth of code:

                ed1
                s
                sd
                p
                pd

                Shouting curse words with great frequency has become my new affect here at t'office. I despair :((

                B Offline
                B Offline
                BillW33
                wrote on last edited by
                #8

                Those variable names look just like ones that were used at a place I used to work. There is a reason I don't work there any more. ;)

                Just because the code works, it doesn't mean that it is good code.

                1 Reply Last reply
                0
                • R r_hyde

                  The application I'm newly tasked with maintaining is a large heap of WTF, but I picked this problem out to share because it demonstrates the supreme barrier to understanding that the prior developer(s) have constructed:

                  #define __2__
                  // snip
                  #if __2__
                  // some comment-less code that has nothing ostensibly to do with the number 2
                  #else
                  // some other comment-less code that appears to have no relationship at all
                  // to the prior alternative
                  #endif

                  :doh: :omg: :wtf: Actually, there are many comments all over the code, but of the sort that tell you absolutely nothing:

                  //only check if max > -1
                  if (max > -1)
                  {
                  ...
                  }

                  Why name that variable maxCsvPosition when a careful analysis of the dozens of lines of surrounding code will tell you that? What are you, lazy? And even dozens of lines is often a luxury—many of the methods in this thing are many hundreds of lines long! The variable names are typically like the following, their scope often spanning many screens' worth of code:

                  ed1
                  s
                  sd
                  p
                  pd

                  Shouting curse words with great frequency has become my new affect here at t'office. I despair :((

                  S Offline
                  S Offline
                  Sinisa Hajnal
                  wrote on last edited by
                  #9

                  Maybe someone else wrote perfectly sensible application with full names and such...and deployed it obfuscated...finally, someone (obviously not the same someone :-\ ) reflected it back to code and sold it as his own :)

                  1 Reply Last reply
                  0
                  • B Brisingr Aerowing

                    WTF? Whoever wrote that code needs to have a frontal lobotomy... As they are obviously antisocial psychopaths!

                    What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???

                    G Offline
                    G Offline
                    Gary R Wheeler
                    wrote on last edited by
                    #10

                    Given that they wrote the code to begin with, I think the lobotomy is already accomplished.

                    Software Zen: delete this;

                    1 Reply Last reply
                    0
                    • B Brisingr Aerowing

                      WTF? Whoever wrote that code needs to have a frontal lobotomy... As they are obviously antisocial psychopaths!

                      What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???

                      Z Offline
                      Z Offline
                      zandam
                      wrote on last edited by
                      #11

                      What if he already had one? :laugh:

                      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