Click here to Skip to main content
15,887,746 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: Best Practices turned into Coding Horrors. Pin
Paulo Zemek16-Apr-13 5:29
mvaPaulo Zemek16-Apr-13 5:29 
GeneralRe: Best Practices turned into Coding Horrors. Pin
BobJanova16-Apr-13 23:01
BobJanova16-Apr-13 23:01 
GeneralRe: Best Practices turned into Coding Horrors. Pin
jschell16-Apr-13 10:06
jschell16-Apr-13 10:06 
GeneralRe: Best Practices turned into Coding Horrors. Pin
KP Lee22-Apr-13 10:17
KP Lee22-Apr-13 10:17 
GeneralRe: Best Practices turned into Coding Horrors. Pin
RafagaX16-Apr-13 7:09
professionalRafagaX16-Apr-13 7:09 
GeneralRe: Best Practices turned into Coding Horrors. Pin
Chad3F16-Apr-13 12:25
Chad3F16-Apr-13 12:25 
GeneralRe: Best Practices turned into Coding Horrors. Pin
jschell17-Apr-13 8:22
jschell17-Apr-13 8:22 
RantRe: Best Practices turned into Coding Horrors. Pin
Chad3F17-Apr-13 17:53
Chad3F17-Apr-13 17:53 
Yes, those that sailed too far likely had a greater chance of something going wrong (per voyage).. but statistically over all, I expect out of all ships/lives lost that only a small percentage were from those sailing out too far. Most had no reason to try (unless they were explorers), so most of the risk was while in known waters (so why not have a best practice of never sailing period). This would be like most people not routinely driving more than 1000 miles (or kilometers) from their home (unless it was required of their job).. hence the [paraphrased] expression of "most [driving] accidents occur within X distance of ones home", simply because that is where the are [on the road] most of the time.

In the end, just because something is done for the wrong reasons (i.e. to not fall off the end of the world) and happens to be useful (i.e. less lost lives/cargo), doesn't justify the basis (a variation of "the ends don't justify the means" I suppose). As an example, if a parent tells a young child not to talk to strangers, "just because", but not why explain why (since the child would unlikely be capable of comprehending why anyway), then that may work on the short term.. but, if left at that, in the long term it could be disastrous. Imagine if that child follows that directive to the letter "just because" their parent said so and one day there is a house fire, firefighters come and surround the house with the kid still inside. Now the child sees all these strangers and has to make a choice.. does he go outside, where all these strangers are, and break the rule.. or does he stay inside (or even hide, since several strangers are entering the house for some reason) to avoid them? A slightly contrived scenario (but not impossible) that illustrates how blindly following a "rule" without understanding why can [eventually] lead to a worse outcome than what the rule was indented to avoid. In some cases, like a young child's limited comprehension, you have to try and account for exceptions when stating the rule.. but when comprehension is possible, ignorant, "just because" logic is never an acceptable reason to do something. One should know _why_ something is better to use than another, in which case they shouldn't _need_ to be told to what [specifically] to do for the best, as it is the automatic choice (including _when_ to break the default choice). If I know a wood chipper chops up materials you put in it, and I know one is [potentially] running, then I implicitly choose not to put my hand in it.. I don't need to be told NOT to do that as a best practice. Yes, they still put that warning sign on it.. I guess because some [adult] people are ignorant of how a chipper works (which in itself is inexcusable).

I think the fact that [so-called] "best practices" exists is in some ways related to how people are taught.. far too much rote learning and not enough understanding. Rote is fine for forming a basic foundation before enough knowledge can be amassed to achieve understanding, but becomes a hindrance after that. In other words.. Teach someone 10 facts, without understanding, and that person knows 10 things. Teach that same person 10 concepts, with understanding, and now they know 100's or even 1000's of things (i.e. the meaningful combinations of those 10 concepts).
GeneralRe: Best Practices turned into Coding Horrors. Pin
jschell18-Apr-13 10:10
jschell18-Apr-13 10:10 
GeneralRe: Best Practices turned into Coding Horrors. Pin
KP Lee22-Apr-13 10:41
KP Lee22-Apr-13 10:41 
AnswerRe: Best Practices turned into Coding Horrors. Pin
Chad3F22-Apr-13 11:38
Chad3F22-Apr-13 11:38 
GeneralRe: Best Practices turned into Coding Horrors. Pin
PIEBALDconsult16-Apr-13 15:23
mvePIEBALDconsult16-Apr-13 15:23 
GeneralRe: Best Practices turned into Coding Horrors. Pin
Pete O'Hanlon17-Apr-13 5:10
mvePete O'Hanlon17-Apr-13 5:10 
GeneralRe: Best Practices turned into Coding Horrors. Pin
Paulo Zemek17-Apr-13 5:19
mvaPaulo Zemek17-Apr-13 5:19 
GeneralRe: Best Practices turned into Coding Horrors. Pin
Pete O'Hanlon17-Apr-13 5:58
mvePete O'Hanlon17-Apr-13 5:58 
GeneralRe: Best Practices turned into Coding Horrors. Pin
BobJanova17-Apr-13 5:53
BobJanova17-Apr-13 5:53 
GeneralRe: Best Practices turned into Coding Horrors. Pin
KP Lee22-Apr-13 0:13
KP Lee22-Apr-13 0:13 
GeneralRe: Best Practices turned into Coding Horrors. Pin
KP Lee22-Apr-13 0:04
KP Lee22-Apr-13 0:04 
AnswerRe: Best Practices turned into Coding Horrors. Pin
Clifford Nelson22-Apr-13 9:13
Clifford Nelson22-Apr-13 9:13 
GeneralRe: Best Practices turned into Coding Horrors. Pin
Paulo Zemek22-Apr-13 9:15
mvaPaulo Zemek22-Apr-13 9:15 
GeneralRe: Best Practices turned into Coding Horrors. Pin
Tim Yen22-Apr-13 14:02
Tim Yen22-Apr-13 14:02 
GeneralRe: Best Practices turned into Coding Horrors. Pin
Paulo Zemek22-Apr-13 15:21
mvaPaulo Zemek22-Apr-13 15:21 
GeneralLogical thinking could get very complicated Pin
Tomz_KV12-Apr-13 14:53
Tomz_KV12-Apr-13 14:53 
GeneralRe: Logical thinking could get very complicated Pin
Brisingr Aerowing12-Apr-13 16:10
professionalBrisingr Aerowing12-Apr-13 16:10 
GeneralRe: Logical thinking could get very complicated PinPopular
OriginalGriff12-Apr-13 23:16
mveOriginalGriff12-Apr-13 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.