News for hackers. Stuff that matters.
Re:LINQ Ruined My Favorite Interview Question by corresation on Thursday July 11, 2013 @01:02PM (#6027352)
I'm not sure what you're actually arguing for or against. There is nothing at all wrong with functional programming, and such had nothing whatsoever to do with my comment. That LINQ happens to use some functional techniques doesn't make my criticism a criticism of fP.
Re:LINQ Ruined My Favorite Interview Question by Strilanc on Thursday July 11, 2013 @01:32PM (#6027568)
Functional languages use the concepts you're criticizing even more extensively than LINQ does.
Re:LINQ Ruined My Favorite Interview Question by corresation on Thursday July 11, 2013 @02:18PM (#6027963)
What are the "concepts I'm criticizing"? I suspect that you have absolutely no idea what the context of my comment was, because your diversion on the topic of functional programming is just grossly out of place.

LINQ encourages the belief that set operations are free, such that you no longer have to concern yourself with concepts like memoization or appropriate structures. This has nothing to do with functional programming. Literally at all.

Re:LINQ Ruined My Favorite Interview Question by Strilanc on Thursday July 11, 2013 @02:56PM (#6028317)
You've actually been pretty vague about the concepts you're criticizing, except for "LINQ". Now I can see you were alluding to just the deferred execution part (the "lack of memoization").

Basically, you're saying it's too easy to accidentally perform a computation twice by iterating through a sequence twice. Recurse on that problem and you get an exponential blowup.

That is actually a problem mostly unique to LINQ and it is really important that a programmer understand the deferred semantics. Some tools, e.g. ReSharper, will detect multiple enumerations and warn you about it. Judicious use of ToArray/ToList solves most issues with defer-splosion.

Re:LINQ Ruined My Favorite Interview Question by corresation on Friday July 12, 2013 @09:36AM (#6032478)
I haven't been vague whatsoever.
Re:LINQ Ruined My Favorite Interview Question by Strilanc on Friday July 12, 2013 @12:06PM (#6033305)
In your first post, everything is "linq is bad" in generic terms except for these two bits:

> "it falls apart in real-world persistent code with considered algorithms and storage"

> "it makes it so easy to do [grouping / sorting / etc] that developers start to resort to that as a catch-all magical solution that is costless because how much could a line or two of code cost"

With hindsight I know your issue is with LINQ's deferred non-memoized execution. It's really easy to enumerate a sequence twice, but every place you do that might add a factor of 2 to the runtime and so there's a danger of exponential blowup that must be avoided. But that's not what I see when I read the above.

The above reads as complaints about easy composability and worries about code monkeys failing to consider what the code they're writing will do. Those are standard "functional / high-level programming is bad" complaints. With hindsight I know that's not what you meant, but that's what it reads like.