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. The Lounge
  3. Never knew I was so OCD about code

Never knew I was so OCD about code

Scheduled Pinned Locked Moved The Lounge
question
7 Posts 7 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.
  • F Offline
    F Offline
    F ES Sitecore
    wrote on last edited by
    #1

    Write some code

    public void SomeMethod()
    {
    // do some things
    Method1();
    bool valid = Method2();

    if (valid)
    {
        Method3();
        Method4();
    
        // valid responses require us to do this
        Method5();
        Method6();
    }
    else
    {
        // response was not valid so do these things
        Method7();
        List<string> values = Method8();
    
        foreach(string value in values)
        {
            Method8(value);
        }
    }
    

    }

    It's been a good day :) Derp: Hey, I need to add logic to your code, can I do some refactoring? Me: Sure Derp, just check it in when you're done Derp: *taps away* *checks in*

    public void SomeMethod()
    {

                  // do some things
    
    Method1();
    bool valid = Method2();
    if (valid)
    {
        Method3();
        Method4();
        // valid responses require us to do this
                  Method5();
        Method6();
    }
    
    else
    {
    
    
        // response was not valid so do these things
    
    
    Method7();
        List<string> values = Method8();
    foreach (string value in values)
    {
        Method8(value);
        if(something) Method9();
    }
    }
    

    }

    Me: :| :omg: :mad::mad::mad::mad:

    H OriginalGriffO Sander RosselS J 4 Replies Last reply
    0
    • F F ES Sitecore

      Write some code

      public void SomeMethod()
      {
      // do some things
      Method1();
      bool valid = Method2();

      if (valid)
      {
          Method3();
          Method4();
      
          // valid responses require us to do this
          Method5();
          Method6();
      }
      else
      {
          // response was not valid so do these things
          Method7();
          List<string> values = Method8();
      
          foreach(string value in values)
          {
              Method8(value);
          }
      }
      

      }

      It's been a good day :) Derp: Hey, I need to add logic to your code, can I do some refactoring? Me: Sure Derp, just check it in when you're done Derp: *taps away* *checks in*

      public void SomeMethod()
      {

                    // do some things
      
      Method1();
      bool valid = Method2();
      if (valid)
      {
          Method3();
          Method4();
          // valid responses require us to do this
                    Method5();
          Method6();
      }
      
      else
      {
      
      
          // response was not valid so do these things
      
      
      Method7();
          List<string> values = Method8();
      foreach (string value in values)
      {
          Method8(value);
          if(something) Method9();
      }
      }
      

      }

      Me: :| :omg: :mad::mad::mad::mad:

      H Offline
      H Offline
      HobbyProggy
      wrote on last edited by
      #2

      Could be my boss, but wait no... there are some thousands returns missing for that

      Rules for the FOSW ![^]

      if(this.signature != "")
      {
      MessageBox.Show("This is my signature: " + Environment.NewLine + signature);
      }
      else
      {
      MessageBox.Show("404-Signature not found");
      }

      1 Reply Last reply
      0
      • F F ES Sitecore

        Write some code

        public void SomeMethod()
        {
        // do some things
        Method1();
        bool valid = Method2();

        if (valid)
        {
            Method3();
            Method4();
        
            // valid responses require us to do this
            Method5();
            Method6();
        }
        else
        {
            // response was not valid so do these things
            Method7();
            List<string> values = Method8();
        
            foreach(string value in values)
            {
                Method8(value);
            }
        }
        

        }

        It's been a good day :) Derp: Hey, I need to add logic to your code, can I do some refactoring? Me: Sure Derp, just check it in when you're done Derp: *taps away* *checks in*

        public void SomeMethod()
        {

                      // do some things
        
        Method1();
        bool valid = Method2();
        if (valid)
        {
            Method3();
            Method4();
            // valid responses require us to do this
                      Method5();
            Method6();
        }
        
        else
        {
        
        
            // response was not valid so do these things
        
        
        Method7();
            List<string> values = Method8();
        foreach (string value in values)
        {
            Method8(value);
            if(something) Method9();
        }
        }
        

        }

        Me: :| :omg: :mad::mad::mad::mad:

        OriginalGriffO Offline
        OriginalGriffO Offline
        OriginalGriff
        wrote on last edited by
        #3

        CTRL+K, CTRL+D, PUNCH+FACE

        Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

        I M 2 Replies Last reply
        0
        • F F ES Sitecore

          Write some code

          public void SomeMethod()
          {
          // do some things
          Method1();
          bool valid = Method2();

          if (valid)
          {
              Method3();
              Method4();
          
              // valid responses require us to do this
              Method5();
              Method6();
          }
          else
          {
              // response was not valid so do these things
              Method7();
              List<string> values = Method8();
          
              foreach(string value in values)
              {
                  Method8(value);
              }
          }
          

          }

          It's been a good day :) Derp: Hey, I need to add logic to your code, can I do some refactoring? Me: Sure Derp, just check it in when you're done Derp: *taps away* *checks in*

          public void SomeMethod()
          {

                        // do some things
          
          Method1();
          bool valid = Method2();
          if (valid)
          {
              Method3();
              Method4();
              // valid responses require us to do this
                        Method5();
              Method6();
          }
          
          else
          {
          
          
              // response was not valid so do these things
          
          
          Method7();
              List<string> values = Method8();
          foreach (string value in values)
          {
              Method8(value);
              if(something) Method9();
          }
          }
          

          }

          Me: :| :omg: :mad::mad::mad::mad:

          Sander RosselS Offline
          Sander RosselS Offline
          Sander Rossel
          wrote on last edited by
          #4

          "Refactoring", you keep using that word. I don't think it means what you think it means... X|

          Visit my blog at Sander's bits - Writing the code you need. Or read my articles at my CodeProject profile.

          Simplicity is prerequisite for reliability. — Edsger W. Dijkstra

          Regards, Sander

          1 Reply Last reply
          0
          • F F ES Sitecore

            Write some code

            public void SomeMethod()
            {
            // do some things
            Method1();
            bool valid = Method2();

            if (valid)
            {
                Method3();
                Method4();
            
                // valid responses require us to do this
                Method5();
                Method6();
            }
            else
            {
                // response was not valid so do these things
                Method7();
                List<string> values = Method8();
            
                foreach(string value in values)
                {
                    Method8(value);
                }
            }
            

            }

            It's been a good day :) Derp: Hey, I need to add logic to your code, can I do some refactoring? Me: Sure Derp, just check it in when you're done Derp: *taps away* *checks in*

            public void SomeMethod()
            {

                          // do some things
            
            Method1();
            bool valid = Method2();
            if (valid)
            {
                Method3();
                Method4();
                // valid responses require us to do this
                          Method5();
                Method6();
            }
            
            else
            {
            
            
                // response was not valid so do these things
            
            
            Method7();
                List<string> values = Method8();
            foreach (string value in values)
            {
                Method8(value);
                if(something) Method9();
            }
            }
            

            }

            Me: :| :omg: :mad::mad::mad::mad:

            J Offline
            J Offline
            Johnny J
            wrote on last edited by
            #5

            Most om my collegues would have done:

            public void SomeMethod()
            {
            // do some things
            Method1();
            bool valid=Method2();
            if (valid)
            {
            Method3();
            Method4();
            // valid responses require us to do this
            Method5();
            Method6();
            }
            else
            {
            // response was not valid so do these things
            Method7();
            List values=Method8();
            foreach(string value in values)
            Method8(value);
            }
            }
            public void SomeMethod2()
            {
            // do some things
            Method1();
            bool valid=Method2();
            if (valid)
            {
            Method3();
            Method4();
            // valid responses require us to do this
            Method5();
            Method6();
            }
            else
            {
            // response was not valid so do these things
            Method7();
            List values=Method8();
            foreach(string value in values)
            Method8(value);
            }
            }

            They don't care sh*t about organizing the code in logical readable blocks (the missing line feed between method bodies irritates me the most!), and how they manage to NOT have the code formatted with spaces, I can't begin to imagine, because my VS editor fixes that automatically when you terminate the statement with ";" Like: MyMethod(0,1,2,3,4,5,6); instead of MyMethod(0, 1, 2, 3, 4, 5, 6); I hate having to reformat other peoples code because they are too lazy, but my OCD requires it! :sigh:

            Anything that is unrelated to elephants is irrelephant
            Anonymous
            -----
            The problem with quotes on the internet is that you can never tell if they're genuine
            Winston Churchill, 1944
            -----
            I'd just like a chance to prove that money can't make me happy.
            Me, all the time

            1 Reply Last reply
            0
            • OriginalGriffO OriginalGriff

              CTRL+K, CTRL+D, PUNCH+FACE

              Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

              I Offline
              I Offline
              Ian Shlasko
              wrote on last edited by
              #6

              One of the best features in VS... The K-D thing, not the face-punching... Though that would be a nice upgrade... Hmm.....

              Proud to have finally moved to the A-Ark. Which one are you in?
              Author of the Guardians Saga (Sci-Fi/Fantasy novels)

              1 Reply Last reply
              0
              • OriginalGriffO OriginalGriff

                CTRL+K, CTRL+D, PUNCH+FACE

                Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

                M Offline
                M Offline
                Mycroft Holmes
                wrote on last edited by
                #7

                I use CTRL E+D, the K is too far away!

                Never underestimate the power of human stupidity RAH

                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