How many times have you made an coding horror intentionally?
-
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.
-
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.
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;
-
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.
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) -
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.
Oshtri Deka wrote:
most of the time we dwell in gray areas.
Like Luton?
-
Oshtri Deka wrote:
most of the time we dwell in gray areas.
Like Luton?
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
-
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.
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
-
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.
-
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;
-
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
But only if it's your turn for the dictionary.
-
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
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.