Click here to Skip to main content
15,886,873 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: Gem... As time goes by.. Pin
GenJerDan11-Jan-12 3:55
GenJerDan11-Jan-12 3:55 
GeneralRe: Gem... As time goes by.. Pin
James Lonero11-Jan-12 18:10
James Lonero11-Jan-12 18:10 
GeneralRe: Gem... As time goes by.. Pin
GenJerDan12-Jan-12 3:05
GenJerDan12-Jan-12 3:05 
GeneralRe: Gem... As time goes by.. Pin
Steve Burchett12-Jan-12 10:13
Steve Burchett12-Jan-12 10:13 
GeneralRe: Gem... As time goes by.. Pin
krumia14-Feb-12 19:10
krumia14-Feb-12 19:10 
GeneralRe: Gem... As time goes by.. PinPopular
Robert Rohde8-Jan-12 23:54
Robert Rohde8-Jan-12 23:54 
GeneralRe: Gem... As time goes by.. Pin
virang_219-Jan-12 0:07
virang_219-Jan-12 0:07 
GeneralRe: Gem... As time goes by.. Pin
BobJanova9-Jan-12 0:54
BobJanova9-Jan-12 0:54 
That is quite spectacularly bad.

- Unused parameter
- Misnamed function (it is getting the hour part suffix, not Time)
- Using strings to manage date/time info, and relying on the exact string (i.e. 2 != 02)
- Incorrect coding or non-standard representation (01-24 instead of 00-23)
- Duplicating framework functionality (myDateTime.ToString("hh tt"))
- Repeat code in case blocks instead of a single test for all included conditions

Anyone spot any more?
GeneralRe: Gem... As time goes by.. Pin
ii_noname_ii9-Jan-12 1:36
ii_noname_ii9-Jan-12 1:36 
GeneralRe: Gem... As time goes by.. Pin
Stefan_Lang10-Jan-12 5:36
Stefan_Lang10-Jan-12 5:36 
GeneralRe: Gem... As time goes by.. Pin
Lilith.C10-Jan-12 9:03
Lilith.C10-Jan-12 9:03 
GeneralRe: Gem... As time goes by.. Pin
BobJanova12-Jan-12 23:43
BobJanova12-Jan-12 23:43 
GeneralRe: Gem... As time goes by.. Pin
Lilith.C13-Jan-12 5:04
Lilith.C13-Jan-12 5:04 
GeneralRe: Gem... As time goes by.. Pin
0bx9-Jan-12 22:45
0bx9-Jan-12 22:45 
GeneralRe: Gem... As time goes by.. Pin
edmurphy9910-Jan-12 3:57
edmurphy9910-Jan-12 3:57 
GeneralRe: Gem... As time goes by.. Pin
Fabio Franco10-Jan-12 6:09
professionalFabio Franco10-Jan-12 6:09 
GeneralRe: Gem... As time goes by.. Pin
Eddy Vluggen10-Jan-12 6:55
professionalEddy Vluggen10-Jan-12 6:55 
GeneralRe: Gem... As time goes by.. Pin
Albert Holguin10-Jan-12 7:29
professionalAlbert Holguin10-Jan-12 7:29 
GeneralRe: Gem... As time goes by.. Pin
Spectre_00110-Jan-12 9:37
Spectre_00110-Jan-12 9:37 
GeneralRe: Gem... As time goes by.. Pin
Eugene Lepekhin10-Jan-12 10:23
Eugene Lepekhin10-Jan-12 10:23 
GeneralRe: Gem... As time goes by.. Pin
virang_2110-Jan-12 11:07
virang_2110-Jan-12 11:07 
GeneralRe: Gem... As time goes by.. Pin
Mark_Wallace10-Jan-12 22:39
Mark_Wallace10-Jan-12 22:39 
GeneralThe mystery function Pin
Pascal Ganaye8-Jan-12 21:49
Pascal Ganaye8-Jan-12 21:49 
GeneralRe: The mystery function PinPopular
Nagy Vilmos8-Jan-12 22:53
professionalNagy Vilmos8-Jan-12 22:53 
GeneralRe: The mystery function Pin
Sentenryu8-Jan-12 23:11
Sentenryu8-Jan-12 23:11 

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.