Click here to Skip to main content
15,888,461 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.

 
AnswerRe: Which code you suggest? Pin
vonb25-Jul-13 22:41
vonb25-Jul-13 22:41 
AnswerRe: Which code you suggest? Pin
Stefan_Lang26-Jul-13 0:09
Stefan_Lang26-Jul-13 0:09 
GeneralRe: Which code you suggest? Pin
Renzo Ciafardone27-Jul-13 17:00
Renzo Ciafardone27-Jul-13 17:00 
GeneralRe: Which code you suggest? Pin
Stefan_Lang28-Jul-13 22:00
Stefan_Lang28-Jul-13 22:00 
GeneralRe: Which code you suggest? Pin
Renzo Ciafardone29-Jul-13 14:25
Renzo Ciafardone29-Jul-13 14:25 
GeneralRe: Which code you suggest? Pin
Stefan_Lang29-Jul-13 21:26
Stefan_Lang29-Jul-13 21:26 
GeneralRe: Which code you suggest? Pin
BobJanova29-Jul-13 0:23
BobJanova29-Jul-13 0:23 
GeneralRe: Which code you suggest? Pin
Stefan_Lang29-Jul-13 2:44
Stefan_Lang29-Jul-13 2:44 
I agree, they shouldn't. But they are. Unfortunately most of these functions are way too complex to safely refactor.

Nevermind, I didn't want to hijack this thread into a discussion of maintaining old codebases - I just wanted to point out that any codebase may eventually develop into one. In that light, you have a point: if in your function you get to a point where you need multiple top level control statements (loops, branches), that may be an indication you should refactor this into multiple functions with less complexity.
AnswerRe: Which code you suggest? Pin
BotReject26-Jul-13 0:47
BotReject26-Jul-13 0:47 
AnswerRe: Which code you suggest? Pin
Kenworth7126-Jul-13 1:04
professionalKenworth7126-Jul-13 1:04 
AnswerRe: Which code you suggest? Pin
nocturns226-Jul-13 3:29
nocturns226-Jul-13 3:29 
AnswerRe: Which code you suggest? Pin
RafagaX26-Jul-13 4:46
professionalRafagaX26-Jul-13 4:46 
AnswerRe: Which code you suggest? Pin
MarkTJohnson26-Jul-13 5:03
professionalMarkTJohnson26-Jul-13 5:03 
GeneralRe: Which code you suggest? Pin
jibalt26-Jul-13 17:28
jibalt26-Jul-13 17:28 
GeneralRe: Which code you suggest? Pin
MarkTJohnson28-Jul-13 14:41
professionalMarkTJohnson28-Jul-13 14:41 
GeneralRe: Which code you suggest? Pin
BobJanova29-Jul-13 0:17
BobJanova29-Jul-13 0:17 
GeneralRe: Which code you suggest? Pin
jibalt19-Aug-13 23:19
jibalt19-Aug-13 23:19 
GeneralRe: Which code you suggest? Pin
MarkTJohnson20-Aug-13 5:05
professionalMarkTJohnson20-Aug-13 5:05 
GeneralMessage Closed Pin
10-Feb-14 13:17
jibalt10-Feb-14 13:17 
GeneralRe: Which code you suggest? Pin
MarkTJohnson11-Feb-14 4:11
professionalMarkTJohnson11-Feb-14 4:11 
GeneralRe: Which code you suggest? Pin
jibalt26-Jul-13 17:30
jibalt26-Jul-13 17:30 
GeneralRe: Which code you suggest? Pin
PIEBALDconsult30-Jul-13 13:43
mvePIEBALDconsult30-Jul-13 13:43 
GeneralRe: Which code you suggest? Pin
jibalt19-Aug-13 23:25
jibalt19-Aug-13 23:25 
AnswerRe: Which code you suggest? Pin
James Lonero26-Jul-13 13:45
James Lonero26-Jul-13 13:45 
AnswerRe: Which code you suggest? Pin
jibalt26-Jul-13 17:24
jibalt26-Jul-13 17:24 

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.