Click here to Skip to main content
15,887,812 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
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 
At the risk of further baiting the troll, man you take this stuff WAY to seriously. "Garbage"? "Harebrained adherence"? "Not being familiar with the state of the art"? "But if you're writing crufty imperative code"? Dude, you need to get out more, seek some kind of relaxation therapy because you are headed for a coronary if you don't find an outlet for your anger.

Did I insult you? Maybe with the "joy to work with" comment, but really, your first statement was "I would never hire anyone . . ." Someone asked a question that related to opinion. I responded with my opinion, which is just as valid as every other opinion that has been posted in response to the original question.

Heaven forbid I assume anything about you but, how much maintenance programming have you done in your career. Real maintenance programming of a system you didn't start but was hired on well after version 1 or even 2 had shipped? In that world, you play with the hand you are dealt, and on more occasions than I care to remember I have had to deal with code that had NOT been tested before being sent to QA because the programmer just threw in multiple return statements because they ASSUMED they knew how the user would interact with the system. Code goes to the field and the user does something different than what the programmer thought the user would do and BOOM goes the code. The else condition was never tested because the programmer only tested with "good" entries.

It is a mistake we ALL make. We make this mistake because we write the code and know what it SHOULD do and get locked into the mindset that "the user will only try to enter the correct information like I have been testing because that what makes the code work and produce the result the users want." Negative testing and single exits can simplify the maintenance of the code long after the original developer has moved on.

You don't have the luxury of rewriting every module you come across to meet your coding standard, you have time to fix the bug and move on to the next one, after of course you thoroughly test your changes and make sure the changes you made didn't break something else. That something else might not even be in the file you are modifying.

So in conclusion, jibalt, you will find over time that life is too short to worry about this stuff and code is just code. Write it so others can see what is going on because in 6 months from now you will have a hard time remembering why you did what you did when you look back at something you thought was so elegant. That is competence AND experience talking.
Mark T Johnson

Old School Programming
K.I.S.S. because you will probably be the S. who has to go back into that file and fix something.

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 
AnswerRe: Which code you suggest? Pin
jibalt26-Jul-13 17:27
jibalt26-Jul-13 17:27 
AnswerRe: Which code you suggest? Pin
BobJanova29-Jul-13 0:50
BobJanova29-Jul-13 0:50 
AnswerRe: Which code you suggest? Pin
irneb29-Jul-13 3:30
irneb29-Jul-13 3:30 
GeneralRe: Which code you suggest? Pin
jibalt19-Aug-13 23:31
jibalt19-Aug-13 23:31 
AnswerRe: Which code you suggest? Pin
Jonathan C Dickinson29-Jul-13 22:07
Jonathan C Dickinson29-Jul-13 22:07 
GeneralRe: Which code you suggest? Pin
jibalt19-Aug-13 23:34
jibalt19-Aug-13 23:34 
AnswerRe: Which code you suggest? Pin
PIEBALDconsult30-Jul-13 5:24
mvePIEBALDconsult30-Jul-13 5:24 
AnswerRe: Which code you suggest? Pin
DarkChuky CR30-Jul-13 6:48
DarkChuky CR30-Jul-13 6:48 
GeneralRe: Which code you suggest? Pin
johannesnestler1-Aug-13 4:27
johannesnestler1-Aug-13 4:27 
GeneralRe: Which code you suggest? Pin
DarkChuky CR1-Aug-13 5:44
DarkChuky CR1-Aug-13 5:44 

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.