Click here to Skip to main content
15,902,938 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: if else galore Pin
Kevin McFarlane17-Mar-07 1:16
Kevin McFarlane17-Mar-07 1:16 
GeneralRe: if else galore Pin
Haroon Sarwar18-Mar-07 18:39
Haroon Sarwar18-Mar-07 18:39 
GeneralRe: if else galore Pin
Kevin McFarlane19-Mar-07 9:39
Kevin McFarlane19-Mar-07 9:39 
GeneralFor loop Pin
N a v a n e e t h13-Mar-07 1:22
N a v a n e e t h13-Mar-07 1:22 
GeneralRe: For loop Pin
Ed.Poore13-Mar-07 2:09
Ed.Poore13-Mar-07 2:09 
GeneralRe: For loop Pin
PIEBALDconsult13-Mar-07 4:19
mvePIEBALDconsult13-Mar-07 4:19 
GeneralRe: For loop Pin
Ed.Poore13-Mar-07 6:20
Ed.Poore13-Mar-07 6:20 
GeneralRe: For loop Pin
Shog913-Mar-07 7:00
sitebuilderShog913-Mar-07 7:00 
Eh, you can use consts though. Pretty much all they're really useful for in C#...

(I do hate seeing raw numbers like that in code. Even if you put the const variable definition right above the loop, you've still created an opportunity to give the value a descriptive name. You see numDays = 7*2, you think, "ah, two weeks!" rather than wondering what the numbers signify.)



----
...the wind blows over it and it is gone, and its place remembers it no more...

GeneralRe: For loop Pin
Ed.Poore13-Mar-07 7:03
Ed.Poore13-Mar-07 7:03 
GeneralRe: For loop Pin
#12313-Mar-07 7:35
#12313-Mar-07 7:35 
GeneralRe: For loop Pin
#12313-Mar-07 7:33
#12313-Mar-07 7:33 
GeneralRe: For loop Pin
Shog913-Mar-07 7:51
sitebuilderShog913-Mar-07 7:51 
GeneralRe: For loop Pin
#12313-Mar-07 7:59
#12313-Mar-07 7:59 
GeneralRe: For loop Pin
Shog913-Mar-07 8:07
sitebuilderShog913-Mar-07 8:07 
GeneralRe: For loop Pin
#12313-Mar-07 8:31
#12313-Mar-07 8:31 
GeneralRe: For loop Pin
Shog913-Mar-07 8:40
sitebuilderShog913-Mar-07 8:40 
GeneralRe: For loop Pin
#12313-Mar-07 8:49
#12313-Mar-07 8:49 
GeneralRe: For loop Pin
Shog913-Mar-07 9:01
sitebuilderShog913-Mar-07 9:01 
GeneralRe: For loop Pin
#12313-Mar-07 9:05
#12313-Mar-07 9:05 
GeneralRe: For loop Pin
Shog913-Mar-07 9:27
sitebuilderShog913-Mar-07 9:27 
GeneralRe: For loop Pin
#12313-Mar-07 9:33
#12313-Mar-07 9:33 
GeneralRe: For loop Pin
Chris-Kaiser15-Mar-07 12:29
Chris-Kaiser15-Mar-07 12:29 
GeneralRe: For loop Pin
Chris-Kaiser15-Mar-07 12:28
Chris-Kaiser15-Mar-07 12:28 
GeneralRe: For loop Pin
Chris-Kaiser15-Mar-07 12:27
Chris-Kaiser15-Mar-07 12:27 
GeneralRe: For loop Pin
Jörgen Sigvardsson15-Mar-07 13:07
Jörgen Sigvardsson15-Mar-07 13:07 

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.