Click here to Skip to main content
15,887,135 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: How to group by hour properly. Pin
Brady Kelly21-Aug-09 0:53
Brady Kelly21-Aug-09 0:53 
GeneralRe: How to group by hour properly. Pin
ClementsDan21-Aug-09 15:22
ClementsDan21-Aug-09 15:22 
GeneralRe: How to group by hour properly. Pin
MaksimP25-Sep-09 10:07
MaksimP25-Sep-09 10:07 
GeneralHow to handle dates _properly_. [modified] Pin
Brady Kelly20-Aug-09 12:31
Brady Kelly20-Aug-09 12:31 
GeneralRe: How to handle dates _properly_. Pin
Keith Barrow20-Aug-09 23:03
professionalKeith Barrow20-Aug-09 23:03 
GeneralRe: How to handle dates _properly_. Pin
supercat921-Aug-09 10:14
supercat921-Aug-09 10:14 
GeneralRe: How to handle dates _properly_. Pin
Dan Neely21-Aug-09 10:41
Dan Neely21-Aug-09 10:41 
GeneralRe: How to handle dates _properly_. Pin
supercat924-Aug-09 11:05
supercat924-Aug-09 11:05 
I strongly disagree. IF y2k and the last decade have taught us anything it's that crufty old code doesn't die, it just gets wrapped in interface translation layers to feed newer systems.

Code can be around for awhile, certainly, but from a user I/O perspective I don't see much point to using four-digit years for most purposes (from an internal-storage perspective, storing a year as two digits is generally silly with or without century-wrap issues). If an application is only going to deal with dates in the near future or recent past, there's no reason to require users to waste keystrokes typing a leading "20", nor is there any reason to waste space printing or displaying a "20" in front of years on paper or screen. If, seventy years from now, a printed document bears a date of 01-01-76, it will almost certainly be obvious whether the document was produced in the 1970's or 2070's. Even if there were no further improvements in printing technologies, the earliest possible ambiguities for documents printed on quality paper wouldn't occur until 2090 or so; even then, it should be obvious which documents were printed in 1990 and which ones were printed in 2090.
GeneralRe: How to handle dates _properly_. Pin
ClementsDan21-Aug-09 15:38
ClementsDan21-Aug-09 15:38 
GeneralRe: How to handle dates _properly_. [modified] Pin
Vozzie224-Aug-09 16:15
Vozzie224-Aug-09 16:15 
GeneralPractically The Entire Article Pin
Rick York17-Aug-09 6:19
mveRick York17-Aug-09 6:19 
GeneralHow to get today's date Pin
Keith Barrow14-Aug-09 0:26
professionalKeith Barrow14-Aug-09 0:26 
GeneralRe: How to get today's date Pin
Nelson Costa Inácio14-Aug-09 1:49
Nelson Costa Inácio14-Aug-09 1:49 
GeneralRe: How to get today's date Pin
MaksimP25-Sep-09 9:55
MaksimP25-Sep-09 9:55 
GeneralRe: How to get today's date Pin
David Skelly14-Aug-09 2:49
David Skelly14-Aug-09 2:49 
GeneralRe: How to get today's date Pin
Keith Barrow14-Aug-09 3:20
professionalKeith Barrow14-Aug-09 3:20 
GeneralRe: How to get today's date Pin
Luc Pattyn14-Aug-09 3:41
sitebuilderLuc Pattyn14-Aug-09 3:41 
GeneralRe: How to get today's date Pin
David Skelly14-Aug-09 5:24
David Skelly14-Aug-09 5:24 
GeneralRe: How to get today's date Pin
David Skelly14-Aug-09 5:06
David Skelly14-Aug-09 5:06 
GeneralRe: How to get today's date Pin
dojohansen15-Oct-09 2:53
dojohansen15-Oct-09 2:53 
GeneralRe: How to get today's date Pin
Carl B. Johnson16-Aug-09 14:27
Carl B. Johnson16-Aug-09 14:27 
GeneralRe: How to get today's date Pin
David Skelly16-Aug-09 22:34
David Skelly16-Aug-09 22:34 
GeneralRe: How to get today's date Pin
Carl B. Johnson17-Aug-09 0:25
Carl B. Johnson17-Aug-09 0:25 
GeneralRe: How to get today's date Pin
Keith Barrow16-Aug-09 23:05
professionalKeith Barrow16-Aug-09 23:05 
GeneralRe: How to get today's date Pin
Luc Pattyn17-Aug-09 0:53
sitebuilderLuc Pattyn17-Aug-09 0:53 

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.