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. How many times have you made an coding horror intentionally?

How many times have you made an coding horror intentionally?

Scheduled Pinned Locked Moved The Lounge
cssperformancetutorialquestioncode-review
17 Posts 11 Posters 19 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.
  • O Offline
    O Offline
    Oshtri Deka
    wrote on last edited by
    #1

    I am in the process of making one and I wonder... It's nested if statements without comments; mostly but not entirely. As we progress as craftsmen we learn how to avoid or how to refactor awkward code, but sometimes from pure laziness or wish for speed or not thinking clearly after 2 a.m. or after getting high with cortisol and caffeine or from all of that combined we write hard to comprehend and/or ugly code. Why? It is easy to detect black or white situation, but most of the time we dwell in gray areas. Where is the line in gray specter which separates bad and good code? Share your worst and if it had bitten you in the behind! Try to be honest! :-D P.S. I think it is ok to write coding horrors (if it doesn't hurt entire project!) to test less experienced or over ambitious colleagues. If they cannot detect it or refactor it, they have much to learn.

    OriginalGriffO B J L G 10 Replies Last reply
    0
    • O Oshtri Deka

      I am in the process of making one and I wonder... It's nested if statements without comments; mostly but not entirely. As we progress as craftsmen we learn how to avoid or how to refactor awkward code, but sometimes from pure laziness or wish for speed or not thinking clearly after 2 a.m. or after getting high with cortisol and caffeine or from all of that combined we write hard to comprehend and/or ugly code. Why? It is easy to detect black or white situation, but most of the time we dwell in gray areas. Where is the line in gray specter which separates bad and good code? Share your worst and if it had bitten you in the behind! Try to be honest! :-D P.S. I think it is ok to write coding horrors (if it doesn't hurt entire project!) to test less experienced or over ambitious colleagues. If they cannot detect it or refactor it, they have much to learn.

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

      We have a whole forum devoted to just that: you will find much, much worse that uncommented nested if statements there... http://www.codeproject.com/Feature/HallOfShame.aspx[^]

      Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

      "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

      1 Reply Last reply
      0
      • O Oshtri Deka

        I am in the process of making one and I wonder... It's nested if statements without comments; mostly but not entirely. As we progress as craftsmen we learn how to avoid or how to refactor awkward code, but sometimes from pure laziness or wish for speed or not thinking clearly after 2 a.m. or after getting high with cortisol and caffeine or from all of that combined we write hard to comprehend and/or ugly code. Why? It is easy to detect black or white situation, but most of the time we dwell in gray areas. Where is the line in gray specter which separates bad and good code? Share your worst and if it had bitten you in the behind! Try to be honest! :-D P.S. I think it is ok to write coding horrors (if it doesn't hurt entire project!) to test less experienced or over ambitious colleagues. If they cannot detect it or refactor it, they have much to learn.

        B Offline
        B Offline
        BobJanova
        wrote on last edited by
        #3

        I've done it through laziness rather than intent, particularly with hobby code, and I've had to fit code into a horribly broken paradigm at work because there wasn't time to fix the whole project, which results in some horrors around the interface. Some of my old code before I learnt why modern code practice is what it is is quite difficult to go back to after several years away, but that wasn't intentional (and actually it's pretty good for an untrained person).

        1 Reply Last reply
        0
        • O Oshtri Deka

          I am in the process of making one and I wonder... It's nested if statements without comments; mostly but not entirely. As we progress as craftsmen we learn how to avoid or how to refactor awkward code, but sometimes from pure laziness or wish for speed or not thinking clearly after 2 a.m. or after getting high with cortisol and caffeine or from all of that combined we write hard to comprehend and/or ugly code. Why? It is easy to detect black or white situation, but most of the time we dwell in gray areas. Where is the line in gray specter which separates bad and good code? Share your worst and if it had bitten you in the behind! Try to be honest! :-D P.S. I think it is ok to write coding horrors (if it doesn't hurt entire project!) to test less experienced or over ambitious colleagues. If they cannot detect it or refactor it, they have much to learn.

          J Offline
          J Offline
          jim lahey
          wrote on last edited by
          #4

          TRWTF is working at 2am. We've all done it at some stage in our careers, but it's the fastest route to hell as far as I'm concerned. If your employer knows you're working at 2am and is fine with it you really need to get another job. Management like that would sell one of your kidneys if left unchecked.

          B 1 Reply Last reply
          0
          • O Oshtri Deka

            I am in the process of making one and I wonder... It's nested if statements without comments; mostly but not entirely. As we progress as craftsmen we learn how to avoid or how to refactor awkward code, but sometimes from pure laziness or wish for speed or not thinking clearly after 2 a.m. or after getting high with cortisol and caffeine or from all of that combined we write hard to comprehend and/or ugly code. Why? It is easy to detect black or white situation, but most of the time we dwell in gray areas. Where is the line in gray specter which separates bad and good code? Share your worst and if it had bitten you in the behind! Try to be honest! :-D P.S. I think it is ok to write coding horrors (if it doesn't hurt entire project!) to test less experienced or over ambitious colleagues. If they cannot detect it or refactor it, they have much to learn.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            What's a coding horror? Sometimes writing beautiful and extremely readable code may please the readers, but the compiler generates something less than optimal. Writing the code in a way to push the compiler into the right direction automatically makes the code less readable or bautiful. So yes, I'm quite capable of deliberately writing 'horrible' code, but then I'm usually nice enough to explain the reasons for that in a comment. The eggheads' rules and rituals are nice and well, but you got to know when to break them.

            At least artificial intelligence already is superior to natural stupidity

            1 Reply Last reply
            0
            • O Oshtri Deka

              I am in the process of making one and I wonder... It's nested if statements without comments; mostly but not entirely. As we progress as craftsmen we learn how to avoid or how to refactor awkward code, but sometimes from pure laziness or wish for speed or not thinking clearly after 2 a.m. or after getting high with cortisol and caffeine or from all of that combined we write hard to comprehend and/or ugly code. Why? It is easy to detect black or white situation, but most of the time we dwell in gray areas. Where is the line in gray specter which separates bad and good code? Share your worst and if it had bitten you in the behind! Try to be honest! :-D P.S. I think it is ok to write coding horrors (if it doesn't hurt entire project!) to test less experienced or over ambitious colleagues. If they cannot detect it or refactor it, they have much to learn.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Today I wanted to write a unit test involving a class which is generated and I can't change. I really needed to inspect the value of one of the classes data members which is private. Fortunately it's the first data member in the class and it's c++ so I just did a bit of casting via a good old void *

              L 1 Reply Last reply
              0
              • L Lost User

                Today I wanted to write a unit test involving a class which is generated and I can't change. I really needed to inspect the value of one of the classes data members which is private. Fortunately it's the first data member in the class and it's c++ so I just did a bit of casting via a good old void *

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Atta boy!Get the job done while the eggheads fight a holy war over what patterns and practices to use to get that value. But don't forget to remove it when you are done :)

                At least artificial intelligence already is superior to natural stupidity

                1 Reply Last reply
                0
                • O Oshtri Deka

                  I am in the process of making one and I wonder... It's nested if statements without comments; mostly but not entirely. As we progress as craftsmen we learn how to avoid or how to refactor awkward code, but sometimes from pure laziness or wish for speed or not thinking clearly after 2 a.m. or after getting high with cortisol and caffeine or from all of that combined we write hard to comprehend and/or ugly code. Why? It is easy to detect black or white situation, but most of the time we dwell in gray areas. Where is the line in gray specter which separates bad and good code? Share your worst and if it had bitten you in the behind! Try to be honest! :-D P.S. I think it is ok to write coding horrors (if it doesn't hurt entire project!) to test less experienced or over ambitious colleagues. If they cannot detect it or refactor it, they have much to learn.

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Everything I write is a coding horror.

                  1 Reply Last reply
                  0
                  • O Oshtri Deka

                    I am in the process of making one and I wonder... It's nested if statements without comments; mostly but not entirely. As we progress as craftsmen we learn how to avoid or how to refactor awkward code, but sometimes from pure laziness or wish for speed or not thinking clearly after 2 a.m. or after getting high with cortisol and caffeine or from all of that combined we write hard to comprehend and/or ugly code. Why? It is easy to detect black or white situation, but most of the time we dwell in gray areas. Where is the line in gray specter which separates bad and good code? Share your worst and if it had bitten you in the behind! Try to be honest! :-D P.S. I think it is ok to write coding horrors (if it doesn't hurt entire project!) to test less experienced or over ambitious colleagues. If they cannot detect it or refactor it, they have much to learn.

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

                    In some of our services (which are all multithreaded), we have the following piece of code in a command handler:

                    volatile int div = 0;
                    volatile int quo = 1 / div;

                    Yes, it's a deliberate division by zero. For this particular debugging case, it's the cleanest way to throw an exception that percolates out and terminates the thread.

                    Software Zen: delete this;

                    B 1 Reply Last reply
                    0
                    • O Oshtri Deka

                      I am in the process of making one and I wonder... It's nested if statements without comments; mostly but not entirely. As we progress as craftsmen we learn how to avoid or how to refactor awkward code, but sometimes from pure laziness or wish for speed or not thinking clearly after 2 a.m. or after getting high with cortisol and caffeine or from all of that combined we write hard to comprehend and/or ugly code. Why? It is easy to detect black or white situation, but most of the time we dwell in gray areas. Where is the line in gray specter which separates bad and good code? Share your worst and if it had bitten you in the behind! Try to be honest! :-D P.S. I think it is ok to write coding horrors (if it doesn't hurt entire project!) to test less experienced or over ambitious colleagues. If they cannot detect it or refactor it, they have much to learn.

                      S Offline
                      S Offline
                      Slacker007
                      wrote on last edited by
                      #10

                      poetic license? A highly skilled and trained writer, chooses to write in a style that reads/sounds less educated.

                      "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
                      "No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011) "It is the celestial scrotum of good luck!" - Nagy Vilmos (2011) "But you probably have the smoothest scrotum of any grown man" - Pete O'Hanlon (2012)

                      1 Reply Last reply
                      0
                      • O Oshtri Deka

                        I am in the process of making one and I wonder... It's nested if statements without comments; mostly but not entirely. As we progress as craftsmen we learn how to avoid or how to refactor awkward code, but sometimes from pure laziness or wish for speed or not thinking clearly after 2 a.m. or after getting high with cortisol and caffeine or from all of that combined we write hard to comprehend and/or ugly code. Why? It is easy to detect black or white situation, but most of the time we dwell in gray areas. Where is the line in gray specter which separates bad and good code? Share your worst and if it had bitten you in the behind! Try to be honest! :-D P.S. I think it is ok to write coding horrors (if it doesn't hurt entire project!) to test less experienced or over ambitious colleagues. If they cannot detect it or refactor it, they have much to learn.

                        H Offline
                        H Offline
                        hairy_hats
                        wrote on last edited by
                        #11

                        Oshtri Deka wrote:

                        most of the time we dwell in gray areas.

                        Like Luton?

                        D 1 Reply Last reply
                        0
                        • H hairy_hats

                          Oshtri Deka wrote:

                          most of the time we dwell in gray areas.

                          Like Luton?

                          D Offline
                          D Offline
                          Dalek Dave
                          wrote on last edited by
                          #12

                          Luton is a GREY area. We own a dictionary and can spell such words.

                          --------------------------------- I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC Link[^] English League Tables - Live

                          H 1 Reply Last reply
                          0
                          • O Oshtri Deka

                            I am in the process of making one and I wonder... It's nested if statements without comments; mostly but not entirely. As we progress as craftsmen we learn how to avoid or how to refactor awkward code, but sometimes from pure laziness or wish for speed or not thinking clearly after 2 a.m. or after getting high with cortisol and caffeine or from all of that combined we write hard to comprehend and/or ugly code. Why? It is easy to detect black or white situation, but most of the time we dwell in gray areas. Where is the line in gray specter which separates bad and good code? Share your worst and if it had bitten you in the behind! Try to be honest! :-D P.S. I think it is ok to write coding horrors (if it doesn't hurt entire project!) to test less experienced or over ambitious colleagues. If they cannot detect it or refactor it, they have much to learn.

                            B Offline
                            B Offline
                            BillWoodruff
                            wrote on last edited by
                            #13

                            Oshtri Deka wrote:

                            Where is the line in gray specter which separates bad and good code?

                            Below the gray specter's waist-line, but above the knees. best, Bill

                            "The greatest mystery is not that we have been flung at random between the profusion of matter and of the stars, but that within this prison we can draw from ourselves images powerful enough to deny our nothingness." Andre Malraux

                            H 1 Reply Last reply
                            0
                            • J jim lahey

                              TRWTF is working at 2am. We've all done it at some stage in our careers, but it's the fastest route to hell as far as I'm concerned. If your employer knows you're working at 2am and is fine with it you really need to get another job. Management like that would sell one of your kidneys if left unchecked.

                              B Offline
                              B Offline
                              BobJanova
                              wrote on last edited by
                              #14

                              He doesn't say it's for work, 2am coding might well be hobby project material. I've done some coding after midnight recently and that was nothing to do with work (though my management would advise against it anyway I'm sure!).

                              1 Reply Last reply
                              0
                              • G Gary Wheeler

                                In some of our services (which are all multithreaded), we have the following piece of code in a command handler:

                                volatile int div = 0;
                                volatile int quo = 1 / div;

                                Yes, it's a deliberate division by zero. For this particular debugging case, it's the cleanest way to throw an exception that percolates out and terminates the thread.

                                Software Zen: delete this;

                                B Offline
                                B Offline
                                BobJanova
                                wrote on last edited by
                                #15

                                Uh, wouldn't 'throw new GetMeTheHellOutOfHereException()' be cleaner?

                                1 Reply Last reply
                                0
                                • D Dalek Dave

                                  Luton is a GREY area. We own a dictionary and can spell such words.

                                  --------------------------------- I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC Link[^] English League Tables - Live

                                  H Offline
                                  H Offline
                                  hairy_hats
                                  wrote on last edited by
                                  #16

                                  But only if it's your turn for the dictionary.

                                  1 Reply Last reply
                                  0
                                  • B BillWoodruff

                                    Oshtri Deka wrote:

                                    Where is the line in gray specter which separates bad and good code?

                                    Below the gray specter's waist-line, but above the knees. best, Bill

                                    "The greatest mystery is not that we have been flung at random between the profusion of matter and of the stars, but that within this prison we can draw from ourselves images powerful enough to deny our nothingness." Andre Malraux

                                    H Offline
                                    H Offline
                                    Henry Minute
                                    wrote on last edited by
                                    #17

                                    I think you'll find that's a codding horror, not a coding horror.

                                    Henry Minute Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” I wouldn't let CG touch my Abacus! When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is. Cogito ergo thumb - Sucking my thumb helps me to think.

                                    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