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

 
General21,662 Pin
AspDotNetDev23-Sep-11 9:02
protectorAspDotNetDev23-Sep-11 9:02 
GeneralRe: 21,662 Pin
StM0n23-Sep-11 11:09
MemberStM0n23-Sep-11 11:09 
JokeRe: 21,662 Pin
Sander Rossel24-Sep-11 10:37
professionalSander Rossel24-Sep-11 10:37 
JokeRe: 21,662 Pin
AspDotNetDev24-Sep-11 11:00
protectorAspDotNetDev24-Sep-11 11:00 
GeneralRe: 21,662 Pin
Sander Rossel24-Sep-11 11:40
professionalSander Rossel24-Sep-11 11:40 
GeneralRe: 21,662 Pin
AspDotNetDev24-Sep-11 12:22
protectorAspDotNetDev24-Sep-11 12:22 
GeneralRe: 21,662 Pin
Sander Rossel24-Sep-11 12:50
professionalSander Rossel24-Sep-11 12:50 
GeneralRe: 21,662 Pin
AspDotNetDev24-Sep-11 14:16
protectorAspDotNetDev24-Sep-11 14:16 
Yeah, constants are nice for refactoring. It is easy enough to search the code for "10" and change it, but you may not want to change every "10" and there may be a bunch of them. Assigning it to a constant allows you to change it in one place.

For some things that are unlikely to ever change (such as "HIGHLANDER"), I might just use a magic variable (i.e., no consant), and I have no problem with code that does that in those cases. Heck, I even use magic variables when I'm just lazy, but will sometimes go back later to convert them to constants or properties or whatever is appropriate. Really they're just one of those "nice to have" things that make others smile when they see your code (or indeed when you see your own code months after you write it), because it's so effortless to maintain. By doing these good practice things as often as possible (even when they are not strictly necessary), I find that they have become instinct and it's not hard at all to do things the right way most of the time. Good practice practice practically makes perfect good practice. Smile | :)
Somebody in an online forum wrote:
INTJs never really joke. They make a point. The joke is just a gift wrapper.

GeneralRe: 21,662 Pin
BobJanova26-Sep-11 4:07
MemberBobJanova26-Sep-11 4:07 
GeneralRe: 21,662 Pin
Sander Rossel26-Sep-11 8:01
professionalSander Rossel26-Sep-11 8:01 
JokeRe: 21,662 Pin
AspDotNetDev26-Sep-11 8:35
protectorAspDotNetDev26-Sep-11 8:35 
GeneralRe: 21,662 Pin
Sander Rossel26-Sep-11 8:38
professionalSander Rossel26-Sep-11 8:38 
GeneralRe: 21,662 Pin
BobJanova26-Sep-11 22:25
MemberBobJanova26-Sep-11 22:25 
GeneralRe: 21,662 Pin
witm553-Oct-11 22:24
Memberwitm553-Oct-11 22:24 
GeneralRe: 21,662 Pin
Sander Rossel4-Oct-11 8:45
professionalSander Rossel4-Oct-11 8:45 
GeneralRe: 21,662 Pin
witm554-Oct-11 10:43
Memberwitm554-Oct-11 10:43 
GeneralRe: 21,662 Pin
Sander Rossel4-Oct-11 10:53
professionalSander Rossel4-Oct-11 10:53 
GeneralRe: 21,662 Pin
TorstenH.26-Sep-11 3:23
MemberTorstenH.26-Sep-11 3:23 
GeneralPower beep Pin
Lutosław22-Sep-11 1:44
MemberLutosław22-Sep-11 1:44 
JokeRe: Power beep Pin
Julien Villers22-Sep-11 22:06
professionalJulien Villers22-Sep-11 22:06 
GeneralRe: Power beep Pin
Lutosław22-Sep-11 22:53
MemberLutosław22-Sep-11 22:53 
GeneralRe: Power beep Pin
Sander Rossel24-Sep-11 3:24
professionalSander Rossel24-Sep-11 3:24 
GeneralRe: Power beep Pin
Pravin Patil, Mumbai25-Sep-11 19:40
MemberPravin Patil, Mumbai25-Sep-11 19:40 
GeneralGuess it does not contains 'Contains' Pin
VallarasuS22-Sep-11 1:37
MemberVallarasuS22-Sep-11 1:37 
GeneralRe: Guess it does not contains 'Contains' Pin
Nagy Vilmos22-Sep-11 1:46
professionalNagy Vilmos22-Sep-11 1:46 

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.