Click here to Skip to main content
15,886,919 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: How to Train Your Programmer Pin
bosedk3-Jan-12 2:50
bosedk3-Jan-12 2:50 
GeneralRe: How to Train Your Programmer Pin
0bx3-Jan-12 4:18
0bx3-Jan-12 4:18 
GeneralRe: How to Train Your Programmer Pin
Lutosław3-Jan-12 10:38
Lutosław3-Jan-12 10:38 
GeneralRe: How to Train Your Programmer Pin
RobCroll3-Jan-12 14:36
RobCroll3-Jan-12 14:36 
GeneralRe: How to Train Your Programmer Pin
Nagy Vilmos3-Jan-12 22:57
professionalNagy Vilmos3-Jan-12 22:57 
GeneralRe: How to Train Your Programmer Pin
Bernhard Hiller3-Jan-12 23:19
Bernhard Hiller3-Jan-12 23:19 
GeneralRe: How to Train Your Programmer Pin
Jeroen De Dauw4-Jan-12 0:34
Jeroen De Dauw4-Jan-12 0:34 
GeneralRe: How to Train Your Programmer Pin
johannesnestler11-Jan-12 3:37
johannesnestler11-Jan-12 3:37 
I have done things like this in the past, when I wanted to give me or other developers a hint for a possible later change. E.g. The "Name" to "2nd Parameter" correspondence could be just by chance or a quick first implementation. What I mean is: maybe "2nd Parameter" has to be localized or mapped later. If you would shorten the code with a direct assignment, I'd assume as a maintenance developer that "Name" always holds a valid "2nd Parameter to IngGenInvPs constructor. And this is maybe not true.
This code is not good for other reasons (use switch, use enum, others mentioned it), but not necessarily for the obvious redundance.
GeneralGem code Pin
zenwalker198528-Dec-11 3:00
zenwalker198528-Dec-11 3:00 
GeneralRe: Gem code Pin
Paladin200028-Dec-11 4:09
Paladin200028-Dec-11 4:09 
GeneralRe: Gem code Pin
zenwalker198528-Dec-11 15:02
zenwalker198528-Dec-11 15:02 
GeneralRe: Gem code Pin
ekolis29-Dec-11 11:52
ekolis29-Dec-11 11:52 
GeneralRe: Gem code Pin
zenwalker198529-Dec-11 18:37
zenwalker198529-Dec-11 18:37 
GeneralRe: Gem code Pin
krumia14-Feb-12 19:20
krumia14-Feb-12 19:20 
GeneralCool bitwise trick page PinPopular
Lutosław28-Dec-11 0:46
Lutosław28-Dec-11 0:46 
GeneralRe: Cool bitwise trick page Pin
harold aptroot28-Dec-11 1:35
harold aptroot28-Dec-11 1:35 
GeneralRe: Cool bitwise trick page Pin
Rajesh Anuhya30-Dec-11 2:10
professionalRajesh Anuhya30-Dec-11 2:10 
GeneralTest-driven voodoo magic Pin
jesarg27-Dec-11 7:09
jesarg27-Dec-11 7:09 
JokeRe: Test-driven voodoo magic Pin
Paladin200027-Dec-11 7:55
Paladin200027-Dec-11 7:55 
GeneralRe: Test-driven voodoo magic Pin
Slacker00727-Dec-11 8:02
professionalSlacker00727-Dec-11 8:02 
GeneralRe: Test-driven voodoo magic PinPopular
OriginalGriff27-Dec-11 8:28
mveOriginalGriff27-Dec-11 8:28 
GeneralRe: Test-driven voodoo magic Pin
Gary R. Wheeler27-Dec-11 9:44
Gary R. Wheeler27-Dec-11 9:44 
GeneralRe: Test-driven voodoo magic Pin
CDP180228-Dec-11 11:57
CDP180228-Dec-11 11:57 
GeneralRe: Test-driven voodoo magic Pin
Bernhard Hiller28-Dec-11 20:20
Bernhard Hiller28-Dec-11 20:20 
JokeRe: Test-driven voodoo magic Pin
ii_noname_ii28-Dec-11 23:16
ii_noname_ii28-Dec-11 23:16 

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.