Click here to Skip to main content
16,005,316 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: Dastardly use of ComboBox Pin
Duncan Edwards Jones3-Mar-07 0:54
professionalDuncan Edwards Jones3-Mar-07 0:54 
GeneralRe: Dastardly use of ComboBox Pin
kryzchek6-Mar-07 12:39
kryzchek6-Mar-07 12:39 
GeneralBit operations in VBScript Pin
Chris Maunder1-Mar-07 13:03
cofounderChris Maunder1-Mar-07 13:03 
GeneralRe: Bit operations in VBScript Pin
Ed.Poore2-Mar-07 9:06
Ed.Poore2-Mar-07 9:06 
GeneralRe: Bit operations in VBScript Pin
Shog92-Mar-07 9:29
sitebuilderShog92-Mar-07 9:29 
GeneralRe: Bit operations in VBScript Pin
David Rush5-Mar-07 9:59
professionalDavid Rush5-Mar-07 9:59 
GeneralRe: Bit operations in VBScript Pin
Lutosław8-Mar-07 11:43
Lutosław8-Mar-07 11:43 
GeneralFirst real one... Pin
Christian Graus1-Mar-07 12:44
protectorChristian Graus1-Mar-07 12:44 
When I was first learning C#, I had an attitude about it. I was hardcore C++ before that. Now, I love C#, but anyhow...

So, I was writing a unit test, and I needed to have every third item do something in a list. I forget what. I knew about Math., and I looked for Math.Mod. Obviously, it's not there, it's the % operator. Which I should have known. But, I was having a bad day, and, cursing C#, I wrote my own mod function.

A year or so later, this code was found by someone and sent to the entire company on our social mailing list. I knew right away what I'd done, and I'm glad it happened ( what I did was atypical at the time, but now I'd all the more remember it and dig deeper for obvious stuff that isn't where I first look for it ), but I sure did feel a goose when I saw it and realised that what I wrote was superfluous.

C# was my first major language change ( I'd done Python and other stuff, but always C++ at the core, C# was my first change of core language ). I suspect I was a case study for how NOT to approach such a major change. Hopefully the next time things change like that, I'll take it better.

I guess the other lesson to be learned out of this is the importance of code reviews, which this particular company does not do, to this day ( I floated it once or twice and got laughed to scorn ).



Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

GeneralRe: First real one... Pin
Colin Angus Mackay1-Mar-07 21:32
Colin Angus Mackay1-Mar-07 21:32 
GeneralRe: First real one... Pin
Scott Dorman2-Mar-07 4:27
professionalScott Dorman2-Mar-07 4:27 
GeneralRe: First real one... Pin
David Crow2-Mar-07 10:20
David Crow2-Mar-07 10:20 
GeneralRe: First real one... Pin
peterchen6-Mar-07 5:57
peterchen6-Mar-07 5:57 
GeneralRe: First real one... Pin
pbraun3-Mar-07 9:07
pbraun3-Mar-07 9:07 
GeneralThird! Pin
Mark Salsbery1-Mar-07 11:29
Mark Salsbery1-Mar-07 11:29 
GeneralRe: Third! Pin
peterchen4-Mar-07 11:00
peterchen4-Mar-07 11:00 
GeneralRe: Third! Pin
Irshad Sulaimani5-Mar-07 23:57
Irshad Sulaimani5-Mar-07 23:57 
GeneralSecond! Pin
peterchen1-Mar-07 10:37
peterchen1-Mar-07 10:37 
GeneralRe: Second! Pin
Irshad Sulaimani5-Mar-07 23:22
Irshad Sulaimani5-Mar-07 23:22 

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.