Click here to Skip to main content
15,886,026 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: reviewing old code Pin
AspDotNetDev17-Feb-12 7:04
protectorAspDotNetDev17-Feb-12 7:04 
GeneralRe: reviewing old code Pin
TorstenFrings16-Feb-12 23:21
TorstenFrings16-Feb-12 23:21 
GeneralRe: reviewing old code Pin
Nagy Vilmos17-Feb-12 0:28
professionalNagy Vilmos17-Feb-12 0:28 
GeneralRe: reviewing old code Pin
0bx17-Feb-12 5:29
0bx17-Feb-12 5:29 
GeneralRe: reviewing old code Pin
Francis W. Porretto17-Feb-12 0:54
Francis W. Porretto17-Feb-12 0:54 
GeneralRe: reviewing old code Pin
Robert Heffernan17-Feb-12 0:55
Robert Heffernan17-Feb-12 0:55 
GeneralRe: reviewing old code Pin
PIEBALDconsult17-Feb-12 2:34
mvePIEBALDconsult17-Feb-12 2:34 
GeneralRe: reviewing old code Pin
Harley L. Pebley17-Feb-12 5:43
Harley L. Pebley17-Feb-12 5:43 
0bx wrote:
foreach (Node thing in Node.GetCurrent().Children)
{
Stuff.Add(thing);
}

Others have commented on the outer looping constructs. Regarding the inner foreach loop, I'd just get rid of it:
C#
Stuff.AddRange(Node.GetCurrent().Children);

Cheers.
GeneralRe: reviewing old code Pin
englebart20-Feb-12 4:38
professionalenglebart20-Feb-12 4:38 
GeneralRe: reviewing old code Pin
KP Lee23-Feb-12 19:00
KP Lee23-Feb-12 19:00 
GeneralDefinition of 100% sure Pin
Lal Miah15-Feb-12 19:10
Lal Miah15-Feb-12 19:10 
GeneralRe: Definition of 100% sure Pin
krumia15-Feb-12 19:26
krumia15-Feb-12 19:26 
GeneralRe: Definition of 100% sure Pin
Mohibur Rashid15-Feb-12 19:28
professionalMohibur Rashid15-Feb-12 19:28 
GeneralChanges goes whong PinPopular
sergiogarcianinja15-Feb-12 3:32
sergiogarcianinja15-Feb-12 3:32 
GeneralRe: Changes goes whong Pin
BobJanova15-Feb-12 3:43
BobJanova15-Feb-12 3:43 
GeneralRe: Changes goes whong PinPopular
sergiogarcianinja15-Feb-12 3:51
sergiogarcianinja15-Feb-12 3:51 
GeneralRe: Changes goes whong Pin
TorstenFrings15-Feb-12 23:26
TorstenFrings15-Feb-12 23:26 
GeneralRe: Changes goes whong Pin
ekolis16-Feb-12 14:18
ekolis16-Feb-12 14:18 
GeneralRe: Changes goes whong Pin
BloodyBaron19-Feb-12 1:11
BloodyBaron19-Feb-12 1:11 
GeneralRe: Changes goes whong Pin
GenJerDan15-Feb-12 7:39
GenJerDan15-Feb-12 7:39 
GeneralRe: Changes goes whong Pin
BillW3315-Feb-12 9:28
professionalBillW3315-Feb-12 9:28 
GeneralRe: Changes goes whong Pin
Lutosław15-Feb-12 10:08
Lutosław15-Feb-12 10:08 
GeneralRe: Changes goes whong Pin
ZurdoDev17-Feb-12 4:28
professionalZurdoDev17-Feb-12 4:28 
GeneralAn issue got finally fixed Pin
Lutosław15-Feb-12 1:34
Lutosław15-Feb-12 1:34 
GeneralRe: An issue got finally fixed Pin
richiej15-Feb-12 3:28
richiej15-Feb-12 3:28 

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.