Click here to Skip to main content
15,887,477 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.

 
GeneralA new way to create a DateTime from the year! Pin
sergiogarcianinja30-Oct-09 7:48
sergiogarcianinja30-Oct-09 7:48 
GeneralRe: A new way to create a DateTime from the year! Pin
Jaime Olivares31-Oct-09 19:12
Jaime Olivares31-Oct-09 19:12 
GeneralRe: A new way to create a DateTime from the year! Pin
sergiogarcianinja5-Nov-09 5:41
sergiogarcianinja5-Nov-09 5:41 
GeneralRe: A new way to create a DateTime from the year! Pin
Chris Maunder5-Nov-09 5:20
cofounderChris Maunder5-Nov-09 5:20 
GeneralRe: A new way to create a DateTime from the year! Pin
dojohansen7-Jan-10 22:51
dojohansen7-Jan-10 22:51 
GeneralRe: A new way to create a DateTime from the year! Pin
David Skelly5-Nov-09 5:34
David Skelly5-Nov-09 5:34 
GeneralRe: A new way to create a DateTime from the year! Pin
sergiogarcianinja5-Nov-09 5:39
sergiogarcianinja5-Nov-09 5:39 
GeneralRe: A new way to create a DateTime from the year! Pin
David Skelly5-Nov-09 23:19
David Skelly5-Nov-09 23:19 
...unless you run the code with a different default Culture, in which case you may get a different DateTime value for the same year input depending on the default calendar in use. The original code will always produce the same result since it specifies which CultureInfo to use. I'm not saying the original code is right, I am merely pointing out that strictly speaking your replacement code is not functionally equivalent to the original. Probably not an issue if your code will never run outside the US but, hey, I'm a geek and pedantry is part of the lifestyle.
GeneralHow to test equality PinPopular
nathan.northcutt@gmail.com28-Oct-09 10:50
nathan.northcutt@gmail.com28-Oct-09 10:50 
GeneralRe: How to test equality Pin
Richard MacCutchan28-Oct-09 11:24
mveRichard MacCutchan28-Oct-09 11:24 
GeneralRe: How to test equality Pin
StM0n28-Oct-09 22:18
StM0n28-Oct-09 22:18 
GeneralRe: How to test equality Pin
Shameel26-Nov-09 20:03
professionalShameel26-Nov-09 20:03 
GeneralRe: How to test equality Pin
Jaime Olivares31-Oct-09 19:20
Jaime Olivares31-Oct-09 19:20 
GeneralRe: How to test equality Pin
dojohansen7-Jan-10 23:16
dojohansen7-Jan-10 23:16 
JokeRe: How to test equality Pin
Jeroen De Dauw28-Oct-09 11:44
Jeroen De Dauw28-Oct-09 11:44 
GeneralRe: How to test equality Pin
Super Lloyd29-Oct-09 14:14
Super Lloyd29-Oct-09 14:14 
GeneralRe: How to test equality Pin
supercat930-Oct-09 9:26
supercat930-Oct-09 9:26 
GeneralRe: How to test equality Pin
Richard MacCutchan31-Oct-09 0:06
mveRichard MacCutchan31-Oct-09 0:06 
GeneralRe: How to test equality Pin
OriginalGriff31-Oct-09 0:51
mveOriginalGriff31-Oct-09 0:51 
GeneralRe: How to test equality Pin
supercat91-Nov-09 13:47
supercat91-Nov-09 13:47 
GeneralRe: How to test equality Pin
PJ Arends1-Nov-09 7:39
professionalPJ Arends1-Nov-09 7:39 
GeneralRe: How to test equality Pin
supercat91-Nov-09 13:27
supercat91-Nov-09 13:27 
GeneralRe: How to test equality Pin
Luc Pattyn1-Nov-09 13:33
sitebuilderLuc Pattyn1-Nov-09 13:33 
GeneralRe: How to test equality Pin
supercat91-Nov-09 14:45
supercat91-Nov-09 14:45 
GeneralRe: How to test equality Pin
Luc Pattyn1-Nov-09 15:00
sitebuilderLuc Pattyn1-Nov-09 15:00 

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.