Click here to Skip to main content
15,895,557 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: What "for" ? Pin
Dan Neely7-Mar-08 3:58
Dan Neely7-Mar-08 3:58 
GeneralRe: What "for" ? Pin
Paul Conrad7-Mar-08 11:04
professionalPaul Conrad7-Mar-08 11:04 
GeneralRe: What "for" ? Pin
QuiJohn7-Mar-08 3:17
QuiJohn7-Mar-08 3:17 
GeneralRe: What "for" ? Pin
leppie7-Mar-08 3:21
leppie7-Mar-08 3:21 
GeneralRe: What "for" ? Pin
Rage7-Mar-08 4:30
professionalRage7-Mar-08 4:30 
GeneralRe: What "for" ? Pin
Nemanja Trifunovic7-Mar-08 4:40
Nemanja Trifunovic7-Mar-08 4:40 
GeneralRe: What "for" ? Pin
Nemanja Trifunovic7-Mar-08 4:38
Nemanja Trifunovic7-Mar-08 4:38 
GeneralRe: What "for" ? Pin
Aamir Butt18-Mar-08 1:09
Aamir Butt18-Mar-08 1:09 
interesting and enlightening... but then just for the sake of a little simplicity, it could have been written like

#define for if(true)for;

and yes, this thing should have been documented.

I saw a similar thing somewhere else where there was code like..

do
{
  //code
}
while(0);


This was just to define a scope for the variable declared with in the block. MS VC compilers do allow braces without any keyword behind them but in some flavors of C/C++, you just can't put braces in your code without a construct.


GeneralRe: What "for" ? Pin
fat_boy15-Apr-08 4:42
fat_boy15-Apr-08 4:42 
GeneralRe: What "for" ? Pin
Rob Grainger14-May-08 10:28
Rob Grainger14-May-08 10:28 
GeneralRe: What "for" ? Pin
leppie7-Mar-08 3:20
leppie7-Mar-08 3:20 
GeneralRe: What "for" ? Pin
Paul Conrad7-Mar-08 11:03
professionalPaul Conrad7-Mar-08 11:03 
GeneralHorror, or not? Pin
Philip Laureano26-Feb-08 22:10
Philip Laureano26-Feb-08 22:10 
GeneralRe: Horror, or not? Pin
darkelv26-Feb-08 22:48
darkelv26-Feb-08 22:48 
GeneralRe: Horror, or not? Pin
Vasudevan Deepak Kumar27-Feb-08 1:13
Vasudevan Deepak Kumar27-Feb-08 1:13 
GeneralRe: Horror, or not? Pin
Paul Conrad27-Feb-08 6:41
professionalPaul Conrad27-Feb-08 6:41 
GeneralRe: Horror, or not? Pin
Philip Laureano27-Feb-08 21:52
Philip Laureano27-Feb-08 21:52 
GeneralRe: Horror, or not? Pin
VentsyV10-Mar-08 12:23
VentsyV10-Mar-08 12:23 
GeneralRe: Horror, or not? Pin
Philip Laureano10-Mar-08 18:50
Philip Laureano10-Mar-08 18:50 
GeneralRe: Horror, or not? Pin
Megidolaon18-Jun-08 4:28
Megidolaon18-Jun-08 4:28 
GeneralRe: Horror, or not? Pin
Pete O'Hanlon27-Feb-08 0:39
mvePete O'Hanlon27-Feb-08 0:39 
GeneralRe: Horror, or not? Pin
Vasudevan Deepak Kumar27-Feb-08 1:15
Vasudevan Deepak Kumar27-Feb-08 1:15 
GeneralRe: Horror, or not? Pin
Expert Coming27-Feb-08 5:51
Expert Coming27-Feb-08 5:51 
GeneralRe: Horror, or not? Pin
leppie28-Feb-08 3:51
leppie28-Feb-08 3:51 
GeneralRe: Horror, or not? Pin
Expert Coming28-Feb-08 12:27
Expert Coming28-Feb-08 12:27 

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.