Click here to Skip to main content
15,890,527 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: The beauty that is the default conversion... Pin
PIEBALDconsult31-Jan-12 2:26
mvePIEBALDconsult31-Jan-12 2:26 
GeneralRe: The beauty that is the default conversion... Pin
CDP180231-Jan-12 2:44
CDP180231-Jan-12 2:44 
GeneralRe: The beauty that is the default conversion... Pin
tgrt1-Feb-12 2:56
tgrt1-Feb-12 2:56 
GeneralRe: The beauty that is the default conversion... Pin
Gary Wheeler2-Feb-12 0:13
Gary Wheeler2-Feb-12 0:13 
GeneralRe: The beauty that is the default conversion... Pin
RobCroll31-Jan-12 11:11
RobCroll31-Jan-12 11:11 
RantEnabling backwards compatibility PinPopular
Chanoch Wiggers30-Jan-12 2:30
Chanoch Wiggers30-Jan-12 2:30 
GeneralRe: Enabling backwards compatibility PinPopular
CDP180230-Jan-12 3:17
CDP180230-Jan-12 3:17 
GeneralRe: Enabling backwards compatibility Pin
englebart1-Feb-12 2:42
professionalenglebart1-Feb-12 2:42 
I have become convinced that programming languages that offer String types should declare them as abstract and/or force you to typedef them before you can use them.

"String userid" would not be allowed.

Something like
"typedef String Userid" would be required first.

Declaration then becomes:

Userid userid;

All of the APIs would them end up with compile time checking for Userid and any mismatches would be compile errors.

A lot of this thinking comes from a security angle.

In a web app:

String userInputWithPossibleInjectionAttacks;

is the same type as

String afterApplyingSanitationRules;

Which String are you storing in your user comment database?

Eventually in programs, each variable's "content" will have history/ACLs associated with it like we have for files on file systems.

They just have not invented this programming language yet... but anyone who deals with user supplied data from outside (or even inside) their organization needs stuff like this.
JokeRe: Enabling backwards compatibility Pin
Moshe Katz1-Feb-12 11:00
Moshe Katz1-Feb-12 11:00 
GeneralRe: Enabling backwards compatibility Pin
jsc4230-Jan-12 3:43
professionaljsc4230-Jan-12 3:43 
GeneralRe: Enabling backwards compatibility Pin
Chanoch Wiggers30-Jan-12 4:06
Chanoch Wiggers30-Jan-12 4:06 
GeneralRe: Enabling backwards compatibility Pin
Firo Atrum Ventus30-Jan-12 11:15
Firo Atrum Ventus30-Jan-12 11:15 
GeneralRe: Enabling backwards compatibility Pin
PIEBALDconsult31-Jan-12 2:24
mvePIEBALDconsult31-Jan-12 2:24 
GeneralRe: Enabling backwards compatibility Pin
User 48220331-Feb-12 0:27
User 48220331-Feb-12 0:27 
GeneralRe: Enabling backwards compatibility Pin
Gary Huck1-Feb-12 7:56
Gary Huck1-Feb-12 7:56 
GeneralRe: Enabling backwards compatibility Pin
User 48220331-Feb-12 8:10
User 48220331-Feb-12 8:10 
GeneralRe: Enabling backwards compatibility Pin
Stefan_Lang1-Feb-12 1:42
Stefan_Lang1-Feb-12 1:42 
GeneralRe: Enabling backwards compatibility Pin
Garry Lowther1-Feb-12 1:42
Garry Lowther1-Feb-12 1:42 
GeneralRe: Enabling backwards compatibility Pin
charlieg1-Feb-12 5:52
charlieg1-Feb-12 5:52 
GeneralRe: Enabling backwards compatibility Pin
Jeremy David Thomson1-Feb-12 10:37
Jeremy David Thomson1-Feb-12 10:37 
GeneralStrictly Short Circuit PinPopular
AspDotNetDev26-Jan-12 15:02
protectorAspDotNetDev26-Jan-12 15:02 
GeneralRe: Strictly Short Circuit Pin
ZurdoDev27-Jan-12 5:25
professionalZurdoDev27-Jan-12 5:25 
GeneralRe: Strictly Short Circuit Pin
cpkilekofp27-Jan-12 6:40
cpkilekofp27-Jan-12 6:40 
GeneralRe: Strictly Short Circuit Pin
AspDotNetDev27-Jan-12 7:03
protectorAspDotNetDev27-Jan-12 7:03 
GeneralRe: Strictly Short Circuit Pin
ZurdoDev27-Jan-12 8:15
professionalZurdoDev27-Jan-12 8:15 

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.