Click here to Skip to main content
15,900,818 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: Linq2Horror Pin
PIEBALDconsult27-Jan-12 16:03
mvePIEBALDconsult27-Jan-12 16:03 
GeneralRe: Linq2Horror Pin
riced28-Jan-12 6:27
riced28-Jan-12 6:27 
GeneralRe: Linq2Horror Pin
icestatue23-Feb-12 3:14
icestatue23-Feb-12 3:14 
GeneralRe: Linq2Horror Pin
gavindon1-Feb-12 10:51
gavindon1-Feb-12 10:51 
GeneralRe: Linq2Horror Pin
killabyte25-Jan-12 14:29
killabyte25-Jan-12 14:29 
GeneralRe: Linq2Horror Pin
Robert Rohde25-Jan-12 17:52
Robert Rohde25-Jan-12 17:52 
GeneralRe: Linq2Horror Pin
killabyte27-Jan-12 9:46
killabyte27-Jan-12 9:46 
GeneralRe: Linq2Horror Pin
Sander Rossel19-Mar-12 21:50
professionalSander Rossel19-Mar-12 21:50 
I love the smell of long and 'unreadable' LINQ queries in the morning! Big Grin | :-D
Actually I think the well formatted isn't THAT hard to read. I guess it depends on what you're used to.
Basically, a quick look at the (formatted) code tells me you enumerate through files, do this parallel, select some stuff, use this to make another selection, with this last selection you loop through all items in that collection and ok... It gets a bit fuzzy after that, but you end up selecting individual lines and even chars and putting them back together again.
That's probably more than I could tell from a quick look at any piece of 'normal' code.

The horror in such code lies not in readability (not using LINQ might stretch the code to twice or thrice its size and many 'normal' code is just as unreadable), the horror is in debugging these things! You can't make changes while running, you can't see the values of variables, you can't see the results of functions... It's a disaster!

That said, I wouldn't use it in production code, but as you mentioned, neither do you Smile | :)
It's an OO world.
C#
public class Naerling : Lazy<Person>{
    public void DoWork(){ throw new NotImplementedException(); }
}

GeneralRe: Linq2Horror Pin
Robert Rohde22-Mar-12 2:07
Robert Rohde22-Mar-12 2:07 
GeneralGoodbye version control Pin
RobCroll20-Mar-12 12:07
RobCroll20-Mar-12 12:07 
GeneralRe: Goodbye version control Pin
Robert Rohde22-Mar-12 2:11
Robert Rohde22-Mar-12 2:11 
GeneralRe: Goodbye version control Pin
RobCroll22-Mar-12 12:36
RobCroll22-Mar-12 12:36 
GeneralLogical AND with false... PinPopular
Albert Holguin23-Jan-12 14:09
professionalAlbert Holguin23-Jan-12 14:09 
GeneralRe: Logical AND with false... PinPopular
ZurdoDev24-Jan-12 3:01
professionalZurdoDev24-Jan-12 3:01 
GeneralRe: Logical AND with false... Pin
PIEBALDconsult24-Jan-12 4:01
mvePIEBALDconsult24-Jan-12 4:01 
GeneralRe: Logical AND with false... Pin
Albert Holguin24-Jan-12 5:05
professionalAlbert Holguin24-Jan-12 5:05 
GeneralRe: Logical AND with false... Pin
BobJanova24-Jan-12 9:55
BobJanova24-Jan-12 9:55 
GeneralRe: Logical AND with false... Pin
cpkilekofp27-Jan-12 6:44
cpkilekofp27-Jan-12 6:44 
GeneralRe: Logical AND with false... Pin
BillW3325-Jan-12 5:05
professionalBillW3325-Jan-12 5:05 
GeneralRe: Logical AND with false... Pin
englebart27-Jan-12 2:11
professionalenglebart27-Jan-12 2:11 
GeneralRe: Logical AND with false... Pin
Albert Holguin27-Jan-12 9:16
professionalAlbert Holguin27-Jan-12 9:16 
GeneralClassical unitialized C pointer Pin
Jochen Arndt20-Jan-12 0:59
professionalJochen Arndt20-Jan-12 0:59 
GeneralRe: Classical unitialized C pointer Pin
Albert Holguin23-Jan-12 4:52
professionalAlbert Holguin23-Jan-12 4:52 
JokeRe: Classical unitialized C pointer Pin
cpkilekofp27-Jan-12 6:35
cpkilekofp27-Jan-12 6:35 
GeneralRe: Classical unitialized C pointer Pin
ii_noname_ii24-Jan-12 3:42
ii_noname_ii24-Jan-12 3:42 

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.