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

 
GeneralFrom this week's mobile newsletter Pin
Richard MacCutchan21-Jan-16 5:09
mveRichard MacCutchan21-Jan-16 5:09 
GeneralRe: From this week's mobile newsletter Pin
F-ES Sitecore8-Feb-16 23:56
mveF-ES Sitecore8-Feb-16 23:56 
Generaltricky C# literals Pin
Tomas Takac20-Jan-16 3:00
MemberTomas Takac20-Jan-16 3:00 
GeneralRe: tricky C# literals Pin
PIEBALDconsult20-Jan-16 3:09
professionalPIEBALDconsult20-Jan-16 3:09 
GeneralRe: tricky C# literals Pin
Tomas Takac20-Jan-16 3:46
MemberTomas Takac20-Jan-16 3:46 
AnswerRe: tricky C# literals Pin
John Torjo20-Jan-16 3:43
professionalJohn Torjo20-Jan-16 3:43 
GeneralRe: tricky C# literals Pin
Tomas Takac20-Jan-16 3:50
MemberTomas Takac20-Jan-16 3:50 
GeneralRe: tricky C# literals Pin
den2k8820-Jan-16 4:00
professionalden2k8820-Jan-16 4:00 
My 2 cents: do not use that magic number, declare it as a constant and comment it with the meaning. Believe me, this is one of the very few good practices that is ALWAYS a good practice.

Magic numbers are tempting because they are fast to code in... and a hell to figure out.
GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- ++>+++ y+++*      Weapons extension: ma- k++ F+2 X

If you think 'goto' is evil, try writing an Assembly program without JMP. -- TNCaver

"When you have eliminated the JavaScript, whatever remains must be an empty page." -- Mike Hankey

"just eat it, eat it"."They're out to mold, better eat while you can" -- HobbyProggy

GeneralRe: tricky C# literals Pin
TheGreatAndPowerfulOz20-Jan-16 4:17
MemberTheGreatAndPowerfulOz20-Jan-16 4:17 
GeneralRe: tricky C# literals Pin
den2k8820-Jan-16 4:34
professionalden2k8820-Jan-16 4:34 
GeneralRe: tricky C# literals Pin
Tomas Takac20-Jan-16 4:29
MemberTomas Takac20-Jan-16 4:29 
GeneralRe: tricky C# literals Pin
den2k8820-Jan-16 4:36
professionalden2k8820-Jan-16 4:36 
GeneralRe: tricky C# literals Pin
John Torjo20-Jan-16 9:10
professionalJohn Torjo20-Jan-16 9:10 
GeneralRe: tricky C# literals Pin
den2k8820-Jan-16 20:50
professionalden2k8820-Jan-16 20:50 
GeneralRe: tricky C# literals Pin
KarstenK20-Jan-16 6:23
mveKarstenK20-Jan-16 6:23 
GeneralOne of my own.... Pin
Duncan Edwards Jones14-Jan-16 0:11
professionalDuncan Edwards Jones14-Jan-16 0:11 
GeneralRe: One of my own.... Pin
PIEBALDconsult14-Jan-16 12:23
professionalPIEBALDconsult14-Jan-16 12:23 
GeneralRe: One of my own.... Pin
Duncan Edwards Jones14-Jan-16 20:37
professionalDuncan Edwards Jones14-Jan-16 20:37 
GeneralRe: One of my own.... Pin
Stefan Küsters14-Jan-16 21:15
MemberStefan Küsters14-Jan-16 21:15 
GeneralRe: One of my own.... Pin
RugbyLeague14-Jan-16 21:47
MemberRugbyLeague14-Jan-16 21:47 
GeneralRe: One of my own.... Pin
Kornfeld Eliyahu Peter17-Jan-16 23:21
professionalKornfeld Eliyahu Peter17-Jan-16 23:21 
GeneralRe: One of my own.... Pin
Nicholas Marty20-Jan-16 4:12
professionalNicholas Marty20-Jan-16 4:12 
GeneralRe: One of my own.... Pin
Richard Deeming20-Jan-16 5:08
mveRichard Deeming20-Jan-16 5:08 
GeneralRe: One of my own.... Pin
Marc Clifton20-Jan-16 4:33
mvaMarc Clifton20-Jan-16 4:33 
GeneralRe: One of my own.... Pin
Duncan Edwards Jones20-Jan-16 5:13
professionalDuncan Edwards Jones20-Jan-16 5:13 

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.