Click here to Skip to main content
15,914,163 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: What was the most interesting, funny or silly Code you have ever read? Pin
Brisingr Aerowing23-Oct-12 8:56
professionalBrisingr Aerowing23-Oct-12 8:56 
GeneralRe: What was the most interesting, funny or silly Code you have ever read? Pin
Sentenryu23-Oct-12 23:16
Sentenryu23-Oct-12 23:16 
GeneralRe: What was the most interesting, funny or silly Code you have ever read? PinPopular
SeattleC++23-Oct-12 5:33
SeattleC++23-Oct-12 5:33 
GeneralRe: What was the most interesting, funny or silly Code you have ever read? Pin
Yann Bane23-Oct-12 10:42
Yann Bane23-Oct-12 10:42 
GeneralRe: What was the most interesting, funny or silly Code you have ever read? Pin
Fran Porretto23-Oct-12 1:20
Fran Porretto23-Oct-12 1:20 
GeneralRe: What was the most interesting, funny or silly Code you have ever read? PinPopular
JiveCode23-Oct-12 2:21
JiveCode23-Oct-12 2:21 
GeneralRe: What was the most interesting, funny or silly Code you have ever read? PinPopular
Stuart Rubin23-Oct-12 3:04
Stuart Rubin23-Oct-12 3:04 
GeneralRe: What was the most interesting, funny or silly Code you have ever read? Pin
BrainiacV23-Oct-12 3:48
BrainiacV23-Oct-12 3:48 
You mean aside from this[^]?

At one place I worked, we were under deadline and a coworker was going to take some time off. He said his part of the project was done and tested. He gave me a copy to integrate into my code and went on vacation.

I installed it and it promptly fell on its face. Looking through the code, it was a complete mess. I ended up taking a hatchet to it, but one routine caught my eye.

It was supposed to center some text on a line. Instead of taking the length of the line, subtracting the length of the string, then dividing by two to get the number of spaces to print before the string, he instead created a string of spaces for the length of the line, overlaid the string at the beginning, and then iteratively added spaces at the beginning and removed spaces at the end until they were equal or the leading spaces was longer than the trailing spaces.

It was the only routine that worked and I left it in place to illustrate the type of code I had to deal with.

I still tried to cover for him, but since rewriting his code impacted the development of my code, when the manager came by breathing fire because I was falling behind, I had to show his work to her. When he came by after his vacation I showed him my changes, he said, "Yes, that's my code." I snarled internally that this bozo couldn't even recognize his code and how I had changed it (chopped 1/3 or more of it out) and then I advised him to take a tube of KY Jelly with him to his meeting with our supervisor because I knew she was going to ream him out.
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.

GeneralRe: What was the most interesting, funny or silly Code you have ever read? Pin
Patrick Fox23-Oct-12 4:07
Patrick Fox23-Oct-12 4:07 
GeneralRe: What was the most interesting, funny or silly Code you have ever read? Pin
Phil_Murray23-Oct-12 4:39
Phil_Murray23-Oct-12 4:39 
GeneralRe: What was the most interesting, funny or silly Code you have ever read? Pin
Patrick Fox23-Oct-12 4:58
Patrick Fox23-Oct-12 4:58 
GeneralRe: What was the most interesting, funny or silly Code you have ever read? Pin
Mike Marynowski23-Oct-12 8:00
professionalMike Marynowski23-Oct-12 8:00 
GeneralRe: What was the most interesting, funny or silly Code you have ever read? Pin
Member 841460023-Oct-12 6:17
Member 841460023-Oct-12 6:17 
GeneralRe: What was the most interesting, funny or silly Code you have ever read? Pin
Sentenryu23-Oct-12 23:19
Sentenryu23-Oct-12 23:19 
Generalis_even(int value) Pin
ForestHymn23-Oct-12 6:50
ForestHymn23-Oct-12 6:50 
GeneralRe: is_even(int value) Pin
Member 858314523-Oct-12 20:46
Member 858314523-Oct-12 20:46 
JokeRe: is_even(int value) Pin
HaBiX29-Oct-12 21:48
HaBiX29-Oct-12 21:48 
GeneralRe: What was the most interesting, funny or silly Code you have ever read? Pin
sappo23-Oct-12 16:42
sappo23-Oct-12 16:42 
GeneralRe: What was the most interesting, funny or silly Code you have ever read? Pin
dxk24124-Oct-12 3:21
dxk24124-Oct-12 3:21 
GeneralRe: What was the most interesting, funny or silly Code you have ever read? Pin
Brisingr Aerowing24-Oct-12 13:27
professionalBrisingr Aerowing24-Oct-12 13:27 
GeneralRe: What was the most interesting, funny or silly Code you have ever read? Pin
dxk24120-Nov-12 7:39
dxk24120-Nov-12 7:39 
GeneralRe: What was the most interesting, funny or silly Code you have ever read? Pin
Brisingr Aerowing20-Nov-12 11:43
professionalBrisingr Aerowing20-Nov-12 11:43 
GeneralRe: What was the most interesting, funny or silly Code you have ever read? Pin
BlackMilan24-Oct-12 21:23
BlackMilan24-Oct-12 21:23 
GeneralRe: What was the most interesting, funny or silly Code you have ever read? Pin
Chris Quinn24-Oct-12 23:21
Chris Quinn24-Oct-12 23:21 
GeneralBad Websites Pin
Marco Bertschi17-Oct-12 23:50
protectorMarco Bertschi17-Oct-12 23:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.