Click here to Skip to main content
15,897,518 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: Classic Pin
Chris Losinger24-Jul-07 7:04
professionalChris Losinger24-Jul-07 7:04 
GeneralRe: Classic == false Pin
Andy Brummer24-Jul-07 7:41
sitebuilderAndy Brummer24-Jul-07 7:41 
GeneralRe: Classic == false Pin
dojohansen20-Aug-07 2:33
dojohansen20-Aug-07 2:33 
GeneralRe: Classic Pin
Pete O'Hanlon24-Jul-07 22:49
mvePete O'Hanlon24-Jul-07 22:49 
GeneralRe: Classic Pin
Luis Alonso Ramos25-Jul-07 19:07
Luis Alonso Ramos25-Jul-07 19:07 
GeneralRe: Classic Pin
Vasudevan Deepak Kumar26-Jul-07 22:53
Vasudevan Deepak Kumar26-Jul-07 22:53 
GeneralRe: Classic Pin
Luis Alonso Ramos27-Jul-07 5:28
Luis Alonso Ramos27-Jul-07 5:28 
GeneralRe: Classic Pin
dean.wilde9-Aug-07 12:40
dean.wilde9-Aug-07 12:40 
I dont think theres anything wrong with that, the compiler is going to optimize it anyways, the reason I like it is because is simpler to read than the alternative and simpler is always better in code. The only argument you could make that one shouldnt do that is if you mistype and put if(someBoolValue=true) and do an assignment instead of a comparision. The workaround to that is to either put constants on the left hand side if(true==someBoolValue), which you should already be doing so the compiler catches other similar mistakes (like null checks), or set the compiler warning level to 4, which I would also recommend you do to let the compiler detect other bugs.
Generaltypeof(string)? Meh. Pin
DavidNohejl23-Jul-07 5:59
DavidNohejl23-Jul-07 5:59 
GeneralRe: typeof(string)? Meh. Pin
PIEBALDconsult23-Jul-07 8:27
mvePIEBALDconsult23-Jul-07 8:27 
GeneralRe: typeof(string)? Meh. Pin
DavidNohejl23-Jul-07 8:32
DavidNohejl23-Jul-07 8:32 
GeneralRe: typeof(string)? Meh. Pin
PIEBALDconsult23-Jul-07 8:37
mvePIEBALDconsult23-Jul-07 8:37 
GeneralRe: typeof(string)? Meh. Pin
Paul Conrad23-Jul-07 12:11
professionalPaul Conrad23-Jul-07 12:11 
GeneralRe: typeof(string)? Meh. Pin
Andy Brummer23-Jul-07 8:46
sitebuilderAndy Brummer23-Jul-07 8:46 
GeneralRe: typeof(string)? Meh. Pin
dojohansen20-Aug-07 2:51
dojohansen20-Aug-07 2:51 
GeneralRe: typeof(string)? Meh. Pin
PaulPrice23-Jul-07 9:59
PaulPrice23-Jul-07 9:59 
GeneralRe: typeof(string)? Meh. Pin
DavidNohejl23-Jul-07 12:09
DavidNohejl23-Jul-07 12:09 
GeneralRe: typeof(string)? Meh. Pin
PaulPrice23-Jul-07 12:55
PaulPrice23-Jul-07 12:55 
GeneralRe: typeof(string)? Meh. Pin
Vasudevan Deepak Kumar28-Jul-07 22:15
Vasudevan Deepak Kumar28-Jul-07 22:15 
GeneralRe: typeof(string)? Meh. Pin
Paul Conrad23-Jul-07 12:12
professionalPaul Conrad23-Jul-07 12:12 
GeneralRe: typeof(string)? Meh. Pin
leppie25-Jul-07 2:52
leppie25-Jul-07 2:52 
GeneralRe: typeof(string)? Meh. Pin
Vasudevan Deepak Kumar28-Jul-07 22:14
Vasudevan Deepak Kumar28-Jul-07 22:14 
GeneralRe: typeof(string)? Meh. Pin
DavidNohejl29-Jul-07 3:12
DavidNohejl29-Jul-07 3:12 
GeneralLinks show open-save dialog box Pin
matjame18-Jul-07 0:33
matjame18-Jul-07 0:33 
GeneralRe: Links show open-save dialog box Pin
Paddy Boyd18-Jul-07 0:41
Paddy Boyd18-Jul-07 0:41 

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.