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. Maybe you guys can laugh at this... I still cannot.

Maybe you guys can laugh at this... I still cannot.

Scheduled Pinned Locked Moved The Lounge
helpdatabase
31 Posts 24 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.
  • S sir_download_alot

    At least you were remembered by the comment :-)

    H Offline
    H Offline
    Herbie Mountjoy
    wrote on last edited by
    #11

    It wasn't me. Signed The Murderer.

    I may not last forever but the mess I leave behind certainly will.

    1 Reply Last reply
    0
    • M mgoad99

      So, I had a problem with a stored procedure I wrote a long time ago. I went to fix it and found this comment that I apparently wrote: --This is an ugly hack. To whomever has to deal with this in the future. i am sorry. Yes, I am sorry…  :sigh:

      G Offline
      G Offline
      glennPattonWork3
      wrote on last edited by
      #12

      I have done the same thing (many times...) my worst was sending out an exe to a client (that was built on a test version I wrote) that displayed a message box with an red X on it and the message "Destroy All Humans"... phone call later in the day to my line "Hi Glenn, software works great that new fix you came up with, great. Get rid of the message box and it can go", "What message box..." and on! :-O

      1 Reply Last reply
      0
      • L Lost User

        The Operative: You know, in certain...older...civilizations, men who had failed as entirely as you have would throw themselves on their swords. Doctor: Well, I forgot to bring a sword. The Operative: (draws his sword) The Operative: Would you be killed in your sleep, like an ailing pet? The Operative: This is a good death. There is no shame in this, a man's death. A man who has done fine works. ... :)

        G Offline
        G Offline
        Gary Wheeler
        wrote on last edited by
        #13

        Excellent riposte, as it were.

        Software Zen: delete this;

        1 Reply Last reply
        0
        • M mgoad99

          So, I had a problem with a stored procedure I wrote a long time ago. I went to fix it and found this comment that I apparently wrote: --This is an ugly hack. To whomever has to deal with this in the future. i am sorry. Yes, I am sorry…  :sigh:

          G Offline
          G Offline
          grralph1
          wrote on last edited by
          #14

          Of course it is funny as it has come to bite you back. Sometimes an ugly hack is necessary. Given time restraints etc. We may laugh when an ugly hack is accomplished and it appears to work, but we never laugh when we have to revisit and fix or tidy it.... but then we laugh again when it is fixed. We all do it. If some poor other coder got the job you wouldn't have even known about it. What if someone posted a rant about it on CP and you realised that it was your comment in your code. I wouldn't laugh then either but at least the comment was honest and apologetic and I would have understood, but I wouldn't laugh. I tell a lie, I would laugh. Just a quick little laugh and then I would be indignant and self righteous about it.

          "Rock journalism is people who can't write interviewing people who can't talk for people who can't read." Frank Zappa 1980

          1 Reply Last reply
          0
          • M mgoad99

            So, I had a problem with a stored procedure I wrote a long time ago. I went to fix it and found this comment that I apparently wrote: --This is an ugly hack. To whomever has to deal with this in the future. i am sorry. Yes, I am sorry…  :sigh:

            D Offline
            D Offline
            Dan Neely
            wrote on last edited by
            #15

            Sometimes I laugh to hold away the tears.

            Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies. -- Sarah Hoyt

            1 Reply Last reply
            0
            • J Joe Woodbury

              Reminds me of when I ran across some crappy image processing code. There was a long comment block with dates above it saying "this code sucks, it needs to be rewritten." I called the last person on that list, who still worked for the company, and she just laughed and agreed that the comment was an understatement. I added my own comment and moved on (it would have taken several weeks to rewrite the code since the effects of changing that relatively small section of code would have rippled far.) (Then there's the time I started rewriting a confusing class of mine only to hit a blocking problem three days in and only then remembering I'd been there before. I rolled back my changes and put in a comment warning me to stop trying to rewrite the class.)

              D Offline
              D Offline
              Dan Neely
              wrote on last edited by
              #16

              Yup. I've got hate lists for all my long running projects with bits of ugly/confusing/unmodifiable/badly designed code that needs rewritten at some point. Occasionally I even have a week to scratch an item off the list.

              Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies. -- Sarah Hoyt

              1 Reply Last reply
              0
              • M mgoad99

                So, I had a problem with a stored procedure I wrote a long time ago. I went to fix it and found this comment that I apparently wrote: --This is an ugly hack. To whomever has to deal with this in the future. i am sorry. Yes, I am sorry…  :sigh:

                A Offline
                A Offline
                Alexander DiMauro
                wrote on last edited by
                #17

                This is why you should change jobs every few years...to avoid having to fix any of your old code! :-D Have a :beer: and laugh it off! :laugh:

                I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone - Bjarne Stroustrup The world is going to laugh at you anyway, might as well crack the 1st joke! My code has no bugs, it runs exactly as it was written.

                1 Reply Last reply
                0
                • M mgoad99

                  So, I had a problem with a stored procedure I wrote a long time ago. I went to fix it and found this comment that I apparently wrote: --This is an ugly hack. To whomever has to deal with this in the future. i am sorry. Yes, I am sorry…  :sigh:

                  S Offline
                  S Offline
                  Sharon Freas
                  wrote on last edited by
                  #18

                  Judgment comes from experience. Experience comes from bad judgment. :) You did the best you could at the time. Now you have better ideas. It's a sign of growth. :-D

                  1 Reply Last reply
                  0
                  • M mgoad99

                    So, I had a problem with a stored procedure I wrote a long time ago. I went to fix it and found this comment that I apparently wrote: --This is an ugly hack. To whomever has to deal with this in the future. i am sorry. Yes, I am sorry…  :sigh:

                    E Offline
                    E Offline
                    etkid84
                    wrote on last edited by
                    #19

                    from an apparently honest guy :thumbsup:

                    David

                    M 1 Reply Last reply
                    0
                    • E etkid84

                      from an apparently honest guy :thumbsup:

                      David

                      M Offline
                      M Offline
                      mgoad99
                      wrote on last edited by
                      #20

                      Actually, an honest gal. Well, maybe or maybe not honest... but definetly a gal. :)

                      E 1 Reply Last reply
                      0
                      • M mgoad99

                        Actually, an honest gal. Well, maybe or maybe not honest... but definetly a gal. :)

                        E Offline
                        E Offline
                        etkid84
                        wrote on last edited by
                        #21

                        oops, my bad :doh:

                        David

                        1 Reply Last reply
                        0
                        • M mgoad99

                          So, I had a problem with a stored procedure I wrote a long time ago. I went to fix it and found this comment that I apparently wrote: --This is an ugly hack. To whomever has to deal with this in the future. i am sorry. Yes, I am sorry…  :sigh:

                          R Offline
                          R Offline
                          RafagaX
                          wrote on last edited by
                          #22

                          Well, the future wasn't as far you thought, wasn't it? :laugh: ;P

                          CEO at: - Rafaga Systems - Para Facturas - Modern Components for the moment...

                          1 Reply Last reply
                          0
                          • M mgoad99

                            So, I had a problem with a stored procedure I wrote a long time ago. I went to fix it and found this comment that I apparently wrote: --This is an ugly hack. To whomever has to deal with this in the future. i am sorry. Yes, I am sorry…  :sigh:

                            B Offline
                            B Offline
                            bkebamc
                            wrote on last edited by
                            #23

                            This is the voice of GOD speaking: Have you grep'd your code for "ugly hack"?

                            1 Reply Last reply
                            0
                            • M mgoad99

                              So, I had a problem with a stored procedure I wrote a long time ago. I went to fix it and found this comment that I apparently wrote: --This is an ugly hack. To whomever has to deal with this in the future. i am sorry. Yes, I am sorry…  :sigh:

                              R Offline
                              R Offline
                              rjmoses
                              wrote on last edited by
                              #24

                              I once took over maintenance of a 40,000 line, assembly language program which had only one comment: "Be prepared with bottle in hand when working on this program." Bottle didn't help, but I didn't care either.

                              1 Reply Last reply
                              0
                              • J Joe Woodbury

                                Reminds me of when I ran across some crappy image processing code. There was a long comment block with dates above it saying "this code sucks, it needs to be rewritten." I called the last person on that list, who still worked for the company, and she just laughed and agreed that the comment was an understatement. I added my own comment and moved on (it would have taken several weeks to rewrite the code since the effects of changing that relatively small section of code would have rippled far.) (Then there's the time I started rewriting a confusing class of mine only to hit a blocking problem three days in and only then remembering I'd been there before. I rolled back my changes and put in a comment warning me to stop trying to rewrite the class.)

                                B Offline
                                B Offline
                                BrainiacV
                                wrote on last edited by
                                #25

                                Joe Woodbury wrote:

                                (Then there's the time I started rewriting a confusing class of mine only to hit a blocking problem three days in and only then remembering I'd been there before. I rolled back my changes and put in a comment warning me to stop trying to rewrite the class.)

                                Reminds me of the time I wrote this routine to search some structure. As I got into it, I realized the intuitive manner I was writing it was going to lead to a dead end and I rewrote it in a counter-intuitive manner that worked. I was in a time crunch and another programmer offered to help and so I said I needed a copy of the routine, but addressing another structure, so could he just make the reference changes (Yes, I should have written it in a more flexible form, but that would have taken longer and I believe at the time I thought I only needed it once). At end of day he gave me the code and then split, I looked at the source and saw that he had not done what I had asked, but had tried to write it in the intuitive manner that I knew looked good, but was not going to work. (sigh) So I pulled an all-nighter to re-do it correctly since I was on a plane flight the next day to install it.

                                Psychosis at 10 Film at 11 Those who do not remember the past, are doomed to repeat it. Those who do not remember the past, cannot build upon it.

                                K 1 Reply Last reply
                                0
                                • B BrainiacV

                                  Joe Woodbury wrote:

                                  (Then there's the time I started rewriting a confusing class of mine only to hit a blocking problem three days in and only then remembering I'd been there before. I rolled back my changes and put in a comment warning me to stop trying to rewrite the class.)

                                  Reminds me of the time I wrote this routine to search some structure. As I got into it, I realized the intuitive manner I was writing it was going to lead to a dead end and I rewrote it in a counter-intuitive manner that worked. I was in a time crunch and another programmer offered to help and so I said I needed a copy of the routine, but addressing another structure, so could he just make the reference changes (Yes, I should have written it in a more flexible form, but that would have taken longer and I believe at the time I thought I only needed it once). At end of day he gave me the code and then split, I looked at the source and saw that he had not done what I had asked, but had tried to write it in the intuitive manner that I knew looked good, but was not going to work. (sigh) So I pulled an all-nighter to re-do it correctly since I was on a plane flight the next day to install it.

                                  Psychosis at 10 Film at 11 Those who do not remember the past, are doomed to repeat it. Those who do not remember the past, cannot build upon it.

                                  K Offline
                                  K Offline
                                  KP Lee
                                  wrote on last edited by
                                  #26

                                  BrainiacV wrote:

                                  he had not done what I had asked, but had tried to write it in the intuitive manner that I knew looked good, but was not going to work.

                                  I blame this on SDETS, if they didn't exist, the programmer would have to test his own code. Hopefully without the blind spot that bypasses the path that will fail. (I at times am an SDET and just have to shake my head at some of the garbage that gets sent for testing. So this is my fault for agreeing to this work.) Reminds me of a bug where I wrote something like "It makes absolutely no sense to allow this field to be nullable, but since it is, fix your code to fail gracefully when it is null." Ah, the joys of writing new code to integrate with legacy code.

                                  B 1 Reply Last reply
                                  0
                                  • K KP Lee

                                    BrainiacV wrote:

                                    he had not done what I had asked, but had tried to write it in the intuitive manner that I knew looked good, but was not going to work.

                                    I blame this on SDETS, if they didn't exist, the programmer would have to test his own code. Hopefully without the blind spot that bypasses the path that will fail. (I at times am an SDET and just have to shake my head at some of the garbage that gets sent for testing. So this is my fault for agreeing to this work.) Reminds me of a bug where I wrote something like "It makes absolutely no sense to allow this field to be nullable, but since it is, fix your code to fail gracefully when it is null." Ah, the joys of writing new code to integrate with legacy code.

                                    B Offline
                                    B Offline
                                    BrainiacV
                                    wrote on last edited by
                                    #27

                                    KP Lee wrote:

                                    the programmer would have to test his own code

                                    That reminds me of another horror story. The team I was with worked under my Former Bitch Supervisor from Helltm and we were under deadline. A coworker announced he is going to take some vacation time and my module was dependent on code he was working on. He gave me a copy late in the day, says he had tested it, and disappears for two weeks. The next day I drop it into my code and it GPFs immediately. I start looking into the code and find the most crapped up mess I had ever seen outside of the POS we were working on to clean up. (He could have been on the original team for all the similarity) I took a machete to it and reduced it to 1/3rd of the original size. It was obvious he had gotten lost in all his redundancies. It was also obvious I was not going to make the schedule because I not only had to work on my code, but I had to rewrite his. I normally would have tried to cover for him, but the FBSfH was having none of it. In the end, I left only one subroutine intact. A) because it was the only one that worked and B) I wanted something to point to to indicate his normal coding style. What did the subroutine do? It centered a string to be displayed on an 80 column screen. How did he do that? Instead of subtracting the length of the string from 80 and then dividing the remainder by 2 to determine the number of leading spaces to print before the string, he instead created a buffer of 80 characters that he filled with spaces. And then at the beginning of the buffer, he inserted the string. He then counted the spaces from the beginning of the line and then counted the spaces from the end of the line and compared the counts. If the count in front was less than the count in back, he'd move the entire buffer one space over and add a space to the front....and start counting again. Such methodology had to be preserved, damn the lost cycles. :doh: So when he came back from vacation, I brought him into my cube and showed him what I had done to his code. When I displayed the code, he said, "Yeah, that's my code." I couldn't believe he didn't see the differences. So I explained how our peerless leader was pissed and when he saw her later that day that he had better take a tube of KY jelly with him because she was going to ream him royally.

                                    Psychosis at 10 Film at 11 Those who do not remember the past, are doomed to repeat it. Those w

                                    K 1 Reply Last reply
                                    0
                                    • B BrainiacV

                                      KP Lee wrote:

                                      the programmer would have to test his own code

                                      That reminds me of another horror story. The team I was with worked under my Former Bitch Supervisor from Helltm and we were under deadline. A coworker announced he is going to take some vacation time and my module was dependent on code he was working on. He gave me a copy late in the day, says he had tested it, and disappears for two weeks. The next day I drop it into my code and it GPFs immediately. I start looking into the code and find the most crapped up mess I had ever seen outside of the POS we were working on to clean up. (He could have been on the original team for all the similarity) I took a machete to it and reduced it to 1/3rd of the original size. It was obvious he had gotten lost in all his redundancies. It was also obvious I was not going to make the schedule because I not only had to work on my code, but I had to rewrite his. I normally would have tried to cover for him, but the FBSfH was having none of it. In the end, I left only one subroutine intact. A) because it was the only one that worked and B) I wanted something to point to to indicate his normal coding style. What did the subroutine do? It centered a string to be displayed on an 80 column screen. How did he do that? Instead of subtracting the length of the string from 80 and then dividing the remainder by 2 to determine the number of leading spaces to print before the string, he instead created a buffer of 80 characters that he filled with spaces. And then at the beginning of the buffer, he inserted the string. He then counted the spaces from the beginning of the line and then counted the spaces from the end of the line and compared the counts. If the count in front was less than the count in back, he'd move the entire buffer one space over and add a space to the front....and start counting again. Such methodology had to be preserved, damn the lost cycles. :doh: So when he came back from vacation, I brought him into my cube and showed him what I had done to his code. When I displayed the code, he said, "Yeah, that's my code." I couldn't believe he didn't see the differences. So I explained how our peerless leader was pissed and when he saw her later that day that he had better take a tube of KY jelly with him because she was going to ream him royally.

                                      Psychosis at 10 Film at 11 Those who do not remember the past, are doomed to repeat it. Those w

                                      K Offline
                                      K Offline
                                      KP Lee
                                      wrote on last edited by
                                      #28

                                      LMAF So, how did he fit a 132 character string on the 80 character screen? What if the string had leading or trailing blanks? Reminds me of a challenge to print 9 lines. Wrote a routine to write up to 197 lines:

                                          /// /// Goes from 1 to 99, lists on Console the number incremented forward and backwards
                                          /// Right adjusting the values. All values except the last number are repeated in reverse order
                                          /// IE if 5 is passed "123454321" is fifth line, 9 lines total listed
                                          /// 
                                          /// The largest middle number
                                          static void stringlist(int num)
                                          {
                                              if (num < 0) num = -num;
                                              if (num < 2)
                                              {
                                                  Console.WriteLine("1");
                                                  return;
                                              }
                                              if (num > 99)
                                              {
                                                  Console.WriteLine("Passed number ({0}) exceeds 99, setting to 99", num);
                                                  num = 99;
                                              }
                                              List forward = new List();
                                              StringBuilder left = new StringBuilder(), right = new StringBuilder(), pad = new StringBuilder();
                                              int len = 0;
                                              for (int i = 1; i <= num; i++)
                                              {
                                                  pad.Append("    ");
                                                  left.Append(i);
                                                  string x = left.ToString() + right.ToString();
                                                  forward.Add(x);
                                                  len = x.Length;
                                                  right.Insert(0, i);
                                              }
                                              foreach (string x in forward)
                                                  if (x.Length == len) Console.WriteLine(x);
                                                  else Console.WriteLine("{0}{1}", pad.ToString(0, len - x.Length), x);
                                              for (int i = forward.Count - 2; i > -1; i--)//-2 points to the next to last number
                                                  Console.WriteLine("{0}{1}", pad.ToString(0, len - forward\[i\].Length), forward\[i\]);
                                          }
                                      

                                      So, how would you grade my coding? OK, OK, so I put one ineffiecient line in that I decided to keep in. Anything else you would complain about it?

                                      B 1 Reply Last reply
                                      0
                                      • M mgoad99

                                        So, I had a problem with a stored procedure I wrote a long time ago. I went to fix it and found this comment that I apparently wrote: --This is an ugly hack. To whomever has to deal with this in the future. i am sorry. Yes, I am sorry…  :sigh:

                                        J Offline
                                        J Offline
                                        jhfw58
                                        wrote on last edited by
                                        #29

                                        Thanks for sharing this one, I had a really good laugh and he who has never used an ugly hack shall throw the first stone...;-) By the way it reminds me of the old programmer's joke where someone sifts through innumerable lines of very old, very badly written code and the only comment line he ever finds reads:"This is where the tricky part begins"

                                        1 Reply Last reply
                                        0
                                        • K KP Lee

                                          LMAF So, how did he fit a 132 character string on the 80 character screen? What if the string had leading or trailing blanks? Reminds me of a challenge to print 9 lines. Wrote a routine to write up to 197 lines:

                                              /// /// Goes from 1 to 99, lists on Console the number incremented forward and backwards
                                              /// Right adjusting the values. All values except the last number are repeated in reverse order
                                              /// IE if 5 is passed "123454321" is fifth line, 9 lines total listed
                                              /// 
                                              /// The largest middle number
                                              static void stringlist(int num)
                                              {
                                                  if (num < 0) num = -num;
                                                  if (num < 2)
                                                  {
                                                      Console.WriteLine("1");
                                                      return;
                                                  }
                                                  if (num > 99)
                                                  {
                                                      Console.WriteLine("Passed number ({0}) exceeds 99, setting to 99", num);
                                                      num = 99;
                                                  }
                                                  List forward = new List();
                                                  StringBuilder left = new StringBuilder(), right = new StringBuilder(), pad = new StringBuilder();
                                                  int len = 0;
                                                  for (int i = 1; i <= num; i++)
                                                  {
                                                      pad.Append("    ");
                                                      left.Append(i);
                                                      string x = left.ToString() + right.ToString();
                                                      forward.Add(x);
                                                      len = x.Length;
                                                      right.Insert(0, i);
                                                  }
                                                  foreach (string x in forward)
                                                      if (x.Length == len) Console.WriteLine(x);
                                                      else Console.WriteLine("{0}{1}", pad.ToString(0, len - x.Length), x);
                                                  for (int i = forward.Count - 2; i > -1; i--)//-2 points to the next to last number
                                                      Console.WriteLine("{0}{1}", pad.ToString(0, len - forward\[i\].Length), forward\[i\]);
                                              }
                                          

                                          So, how would you grade my coding? OK, OK, so I put one ineffiecient line in that I decided to keep in. Anything else you would complain about it?

                                          B Offline
                                          B Offline
                                          BrainiacV
                                          wrote on last edited by
                                          #30

                                          KP Lee wrote:

                                          So, how would you grade my coding?

                                          My number 1 rule for grading code is..."Does it work?" After that, I normally don't care how many clock cycles you are chewing up unless it makes the code unusable. Readability only becomes an issue when you have to go into the code to fix it or make changes. But let me relate another story where I had instructed one of my minions to make a minor change to a program and he complained that it would require duplicating this entire screen of code to insert a space in the output. "Unless you know a better way." which is what he used to say to his previous manager. Unfortunately, I did. It took a few minutes of playing in immediate mode, but I wrote an equivalent subroutine in only three lines of code. (which ended up being more robust than his POS) He came around and while he'd still try using that line on me, this time around he was asking for help instead of trying to avoid work. But a classic case of code collapsing (as I call it) was when I was taking a class in PL/1 and the assignment was to detect the number of words on an 80 column line of text. Having just come from a life of GOTO programming. I wanted to embrace structured code and had elaborate code to deal with the special cases of words beginning the line and words at the end of the line. All the rest would be bounded by spaces. As I rolled the listing into a wide carriage typewriter to add comments to the code (otherwise I'd have to repunch the deck of cards and submit the deck to operations and wait whatever was the prevailing turnaround time) I reexamined my logic to explain what the code was doing and in doing so realized that I could have made the code vastly simpler if I had moved the supplied 80 column card image into a buffer with 82 characters with a space in the front and a space in the back. I added comments at the end of the listing stating that and I believe as a consquence I got a very good grade for my solution.

                                          Psychosis at 10 Film at 11 Those who do not remember the past, are doomed to repeat it. Those who do not remember the past, cannot build upon it.

                                          K 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