Click here to Skip to main content
15,304,164 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
AnswerRe: Is this a known pattern? Pin
Ennis Ray Lynch, Jr.15-Feb-12 3:48
MemberEnnis Ray Lynch, Jr.15-Feb-12 3:48 
AnswerRe: Is this a known pattern? Pin
Henry Minute15-Feb-12 3:48
MemberHenry Minute15-Feb-12 3:48 
GeneralRe: Is this a known pattern? Pin
Nicholas Butler15-Feb-12 4:16
sitebuilderNicholas Butler15-Feb-12 4:16 
GeneralRe: Is this a known pattern? Pin
IAbstract16-Feb-12 5:21
MemberIAbstract16-Feb-12 5:21 
GeneralRe: Is this a known pattern? Pin
Henry Minute16-Feb-12 6:07
MemberHenry Minute16-Feb-12 6:07 
AnswerRe: Is this a known pattern? Pin
Pete O'Hanlon15-Feb-12 3:50
mvaPete O'Hanlon15-Feb-12 3:50 
GeneralRe: Is this a known pattern? Pin
Vivi Chellappa15-Feb-12 5:26
professionalVivi Chellappa15-Feb-12 5:26 
AnswerRe: Is this a known pattern? Pin
BobJanova15-Feb-12 3:53
MemberBobJanova15-Feb-12 3:53 
I'm thinking condition-based programming. I'm not sure if I just made that up right now though.

Also, isn't that exactly the type of thing you can already do with a Linq query?

It is elegant, just like Linq, and it's a good thing to do as long as you can implement it in such a way that the condition is only executed as little as possible, and you don't have to load the whole potential result set into memory and then filter it.

It's more functional programming than declarative, I think. In languages where functions are first class objects (e.g. Javascript) it is more common to pass filter functions or other types of function (for example a sort order comparator) around and potentially declare them locally as you have done here. What you're passing in the 'where' parameter is a pure function.
GeneralRe: Is this a known pattern? Pin
Nicholas Butler15-Feb-12 4:27
sitebuilderNicholas Butler15-Feb-12 4:27 
AnswerRe: Is this a known pattern? Pin
TheGreatAndPowerfulOz15-Feb-12 4:34
MemberTheGreatAndPowerfulOz15-Feb-12 4:34 
AnswerRe: Is this a known pattern? Pin
R. Giskard Reventlov15-Feb-12 4:44
MemberR. Giskard Reventlov15-Feb-12 4:44 
AnswerRe: Is this a known pattern? Pin
Baxter R Pearson16-Feb-12 1:16
MemberBaxter R Pearson16-Feb-12 1:16 
GeneralRe: Is this a known pattern? Pin
Nicholas Butler16-Feb-12 3:50
sitebuilderNicholas Butler16-Feb-12 3:50 
AnswerRe: Is this a known pattern? Pin
Member 388572416-Feb-12 1:16
MemberMember 388572416-Feb-12 1:16 
AnswerRe: Is this a known pattern? Pin
Nathan Gloyn16-Feb-12 1:22
MemberNathan Gloyn16-Feb-12 1:22 
GeneralRe: Is this a known pattern? Pin
Nicholas Butler16-Feb-12 3:54
sitebuilderNicholas Butler16-Feb-12 3:54 
GeneralRe: Is this a known pattern? Pin
Nathan Gloyn16-Feb-12 3:59
MemberNathan Gloyn16-Feb-12 3:59 
AnswerRe: Is this a known pattern? Pin
jim lahey16-Feb-12 2:19
Memberjim lahey16-Feb-12 2:19 
AnswerRe: Is this a known pattern? Pin
Brandon Ledbetter16-Feb-12 2:24
MemberBrandon Ledbetter16-Feb-12 2:24 
GeneralRe: Is this a known pattern? Pin
Nicholas Butler16-Feb-12 4:09
sitebuilderNicholas Butler16-Feb-12 4:09 
AnswerRe: Is this a known pattern? Pin
Fabio Franco16-Feb-12 2:30
professionalFabio Franco16-Feb-12 2:30 
AnswerRe: Is this a known pattern? Pin
Alessandro Degola16-Feb-12 2:58
MemberAlessandro Degola16-Feb-12 2:58 
AnswerRe: Is this a known pattern? Pin
User 483504716-Feb-12 3:18
MemberUser 483504716-Feb-12 3:18 
AnswerRe: Is this a known pattern? Pin
Jonathan C Dickinson16-Feb-12 4:02
MemberJonathan C Dickinson16-Feb-12 4:02 
AnswerRe: Is this a known pattern? Pin
K Quinn16-Feb-12 5:01
MemberK Quinn16-Feb-12 5:01 

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.


Straw Poll

On which operating systems are you writing code?
Let's see if things have changed since we last ran this. "writing code" meaning editing, building, and running the code on that OS.
  Results   770 votes