Click here to Skip to main content
16,008,469 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: Bet this algorithm never occured to anyone... Pin
Pete O'Hanlon11-Apr-07 1:56
mvePete O'Hanlon11-Apr-07 1:56 
GeneralRe: Bet this algorithm never occured to anyone... Pin
to_be_defined11-Apr-07 3:14
to_be_defined11-Apr-07 3:14 
GeneralRe: Bet this algorithm never occured to anyone... Pin
NormDroid11-Apr-07 3:28
professionalNormDroid11-Apr-07 3:28 
GeneralRe: Bet this algorithm never occured to anyone... Pin
Anton Afanasyev11-Apr-07 8:01
Anton Afanasyev11-Apr-07 8:01 
GeneralRe: Bet this algorithm never occured to anyone... Pin
Dave Kreskowiak11-Apr-07 8:14
mveDave Kreskowiak11-Apr-07 8:14 
GeneralRe: Bet this algorithm never occured to anyone... Pin
Ret Orrick12-Apr-07 6:47
Ret Orrick12-Apr-07 6:47 
GeneralRe: Bet this algorithm never occured to anyone... Pin
Collin Parker12-Apr-07 14:36
Collin Parker12-Apr-07 14:36 
GeneralRe: Bet this algorithm never occured to anyone... [modified] Pin
Ret Orrick13-Apr-07 2:59
Ret Orrick13-Apr-07 2:59 
If it was my code, my responsibility etc, so would I. I have worked as a contractor for 25 years, and I can assure you it would NOT be changed at many places where I have worked without an RFC (request for change), cost benefit analysis, documentation, code review, test plan, version control, comment out old code and insert new, etc etc.

However, if you are changing a part of the system which incorporates that particular bit of code then kill it, cus you have to do all of the above anyway.

However, sometimes code you think does nothing, may do something. A slight change to the above algorithm, say that it becomes possible to drop through the code and exit without returning a return value. This throws an exception that is caught elsewhere. (That, for example, would happen with Powerbuilder 8+).

Also, there may be a difference in behaviour between just returning true and looking at a passed invalid parameter (say a null pointer).

For these sort of reasons, many sites will use an "if it ain't broke then don't fix it" approach. Chaning code withour permission is loose-cannon behaviour. I am not trying to support this position, all the fibres of my soul want to change code when I see it is badly written, designed or implemented. You just have to learn to sit on your coding hands.



Paul

GeneralRe: Bet this algorithm never occured to anyone... Pin
Abn0rm4l19-Apr-07 5:56
Abn0rm4l19-Apr-07 5:56 
GeneralRe: Bet this algorithm never occured to anyone... Pin
WhiteSpy25-Apr-07 3:39
WhiteSpy25-Apr-07 3:39 
GeneralRe: Bet this algorithm never occured to anyone... Pin
Anton Afanasyev12-Apr-07 17:43
Anton Afanasyev12-Apr-07 17:43 
GeneralRe: Bet this algorithm never occured to anyone... Pin
clawlor19-Apr-07 7:54
clawlor19-Apr-07 7:54 
GeneralRe: Bet this algorithm never occured to anyone... Pin
Jasmine250111-Apr-07 12:56
Jasmine250111-Apr-07 12:56 
GeneralRe: Bet this algorithm never occured to anyone... Pin
John R. Shaw12-Apr-07 4:36
John R. Shaw12-Apr-07 4:36 
GeneralRe: Bet this algorithm never occured to anyone... Pin
Ret Orrick13-Apr-07 3:04
Ret Orrick13-Apr-07 3:04 
GeneralRe: Bet this algorithm never occured to anyone... Pin
Jasmine250113-Apr-07 5:57
Jasmine250113-Apr-07 5:57 
GeneralRe: Bet this algorithm never occured to anyone... Pin
jhwurmbach15-Apr-07 22:33
jhwurmbach15-Apr-07 22:33 
GeneralRe: Bet this algorithm never occured to anyone... Pin
Jasmine250116-Apr-07 5:37
Jasmine250116-Apr-07 5:37 
GeneralRe: Bet this algorithm never occured to anyone... Pin
jasallen20-Apr-07 10:16
jasallen20-Apr-07 10:16 
GeneralRe: Bet this algorithm never occured to anyone... Pin
Andrea7512-Apr-07 21:58
Andrea7512-Apr-07 21:58 
GeneralRe: Bet this algorithm never occured to anyone... Pin
Trollslayer16-Apr-07 2:47
mentorTrollslayer16-Apr-07 2:47 
JokeRe: Bet this algorithm never occured to anyone... Pin
El Corazon20-Apr-07 10:34
El Corazon20-Apr-07 10:34 
GeneralRe: Bet this algorithm never occured to anyone... Pin
Brent Lamborn5-Jun-07 11:16
Brent Lamborn5-Jun-07 11:16 
GeneralA fond memory of assembly language Pin
Ret Orrick8-Apr-07 9:38
Ret Orrick8-Apr-07 9:38 
GeneralRe: A fond memory of assembly language Pin
peterchen8-Apr-07 10:09
peterchen8-Apr-07 10:09 

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.