Click here to Skip to main content
15,903,523 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: 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 
GeneralRe: For loop Pin
#12313-Mar-07 9:19
#12313-Mar-07 9:19 
GeneralRe: For loop Pin
Ed.Poore13-Mar-07 9:25
Ed.Poore13-Mar-07 9:25 
GeneralRe: For loop Pin
#12313-Mar-07 9:29
#12313-Mar-07 9:29 
GeneralRe: For loop Pin
Patrick Etc.13-Mar-07 14:47
Patrick Etc.13-Mar-07 14:47 
GeneralRe: For loop Pin
#12313-Mar-07 15:06
#12313-Mar-07 15:06 
Patrick Sears wrote:
So what, exactly, is your point? ... "numDays = 7 * 2;" is sufficiently meaningful to be useful...


My point is this. If "numDays = 7*2" is better than the original because it is more clear and natural, then a series of definitions including:

A week is 7 days.
A day is 24 hours.


should be considered even better for the same reasons. "Sufficiently meaningful to be useful" and "ideal" are not the same thing.

Patrick Sears wrote:
"The number of days in two weeks is 7 times 2 which equals 14"


It's interesting how, when talking natural language programming, people dream up the most obnoxiously wordy expressions they can muster (as you have above). That kind of expression is wholly unnecessary and would rarely (if ever) be used in everyday conversation. Our compiler, having been given definitions like those above (in any order), will automatically handle other expressions such as "2 weeks" (including the implicitly defined plural of "week").

So back to the point. This is the 21st century. It's time we said goodbye to the primitive programming languages of the past. We have done better already, we can do better still, and we should not give up until we're speaking to our machines as if they were men.

This is the "Hall of Shame" forum. We, as programmers, should be ashamed of the state of the industry after all these years.
GeneralRe: For loop Pin
Chris-Kaiser15-Mar-07 12:34
Chris-Kaiser15-Mar-07 12:34 
GeneralRe: For loop Pin
Jörgen Sigvardsson15-Mar-07 13:10
Jörgen Sigvardsson15-Mar-07 13:10 
GeneralRe: For loop Pin
Chris-Kaiser13-Apr-07 10:29
Chris-Kaiser13-Apr-07 10:29 
GeneralRe: For loop Pin
Jörgen Sigvardsson13-Apr-07 10:34
Jörgen Sigvardsson13-Apr-07 10:34 
GeneralRe: For loop Pin
Chris-Kaiser15-Mar-07 12:31
Chris-Kaiser15-Mar-07 12:31 
GeneralRe: For loop Pin
DavidNohejl13-Mar-07 7:33
DavidNohejl13-Mar-07 7:33 
JokeRe: For loop Pin
ChandraRam14-Mar-07 0:54
ChandraRam14-Mar-07 0:54 
GeneralRe: For loop Pin
#12313-Mar-07 7:38
#12313-Mar-07 7:38 
GeneralRe: For loop Pin
Jörgen Sigvardsson15-Mar-07 13:11
Jörgen Sigvardsson15-Mar-07 13:11 
GeneralRe: For loop Pin
DavidNohejl13-Mar-07 22:43
DavidNohejl13-Mar-07 22:43 
GeneralRe: For loop Pin
#12313-Mar-07 22:46
#12313-Mar-07 22:46 
GeneralRe: For loop Pin
DavidNohejl13-Mar-07 22:56
DavidNohejl13-Mar-07 22:56 
GeneralRe: For loop Pin
#12313-Mar-07 23:05
#12313-Mar-07 23:05 
GeneralRe: For loop Pin
DavidNohejl13-Mar-07 23:13
DavidNohejl13-Mar-07 23:13 
GeneralRe: For loop Pin
#12313-Mar-07 23:31
#12313-Mar-07 23:31 
GeneralRe: For loop Pin
DavidNohejl13-Mar-07 23:48
DavidNohejl13-Mar-07 23:48 
GeneralRe: For loop Pin
#12314-Mar-07 5:21
#12314-Mar-07 5:21 

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.