Click here to Skip to main content
16,004,974 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.

 
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 
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 
Shog9 wrote:
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.


Or, in a less primitive tongue:

A week is 7 days.
A fortnight is 2 weeks.
A day is 24 hours.
A second is 1000 milliseconds.
An hour is 60 minutes.
A minute is 60 seconds.

Conversions are handled automatically, as you would expect, and the plural terms are derived from the singulars. The definitions, of course, may appear in any order.

It always surprises me how people say they want their code to be transparent but nevertheless insist on using languages that require the most obtuse and unnatural syntax (as in "numDays = 7*2").
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 
GeneralRe: For loop Pin
Ed.Poore13-Mar-07 8:00
Ed.Poore13-Mar-07 8:00 
GeneralRe: For loop Pin
#12313-Mar-07 8:25
#12313-Mar-07 8:25 
GeneralRe: For loop Pin
Ed.Poore13-Mar-07 9:10
Ed.Poore13-Mar-07 9:10 

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.