Click here to Skip to main content
15,889,315 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: Ah, VB ... Pin
Bernhard Hiller27-Sep-11 0:42
Bernhard Hiller27-Sep-11 0:42 
GeneralRe: Ah, VB ... Pin
CDP180227-Sep-11 3:47
CDP180227-Sep-11 3:47 
GeneralRe: Ah, VB ... Pin
AspDotNetDev27-Sep-11 5:00
protectorAspDotNetDev27-Sep-11 5:00 
JokeRe: Ah, VB ... Pin
StM0n27-Sep-11 7:04
StM0n27-Sep-11 7:04 
GeneralRe: Ah, VB ... Pin
Sander Rossel27-Sep-11 7:51
professionalSander Rossel27-Sep-11 7:51 
GeneralRe: Ah, VB ... Pin
jgrogan29-Sep-11 20:52
jgrogan29-Sep-11 20:52 
GeneralRe: Ah, VB ... Pin
zenstain30-Sep-11 3:47
professionalzenstain30-Sep-11 3:47 
General21,662 PinPopular
AspDotNetDev23-Sep-11 9:02
protectorAspDotNetDev23-Sep-11 9:02 
GeneralRe: 21,662 Pin
StM0n23-Sep-11 11:09
StM0n23-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 PinPopular
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
BobJanova26-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
BobJanova26-Sep-11 22:25 
GeneralRe: 21,662 Pin
witm553-Oct-11 22:24
witm553-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
witm554-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
TorstenH.26-Sep-11 3:23 

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.