

Refactoring Loops to Collection Pipelines - kilimchoi
http://martinfowler.com/articles/refactoring-pipelines.html

======
VeejayRampay
Every time I see code examples for operations like these, it reminds me of how
nice Ruby is as a language. The blocks are concise, non-cryptic and could even
shortened to .map(&:twitter_handle).compact

~~~
Mithaldu
That applies to all dynamic languages with useful list operations, really.
Have an example in Ruby's forebear language:

    
    
        sub twitter_handles {
            my ( $authors, $company ) = @_;
            grep defined,
              map $_->twitter_handle,
              grep $_->company eq $company, @$authors;
        }
    

This free book goes into the same kind of topic, only much more deep:
[http://hop.perl.plover.com/](http://hop.perl.plover.com/)

~~~
gclaramunt
That applies to all languages with useful list operations :) (I don't think
dynamic has any relation)

------
willtim
Why does Fowler always feel the need to invent his own terminology? A more
accurate and accepted description for his examples would be "Stream
combinators".

------
clebio
I recently went looking for a Python implementation of the Javascript
convention of operator chaining. In that search, I found an SO answer saying
that it's called [fluent
interface]([https://en.wikipedia.org/wiki/Fluent_interface](https://en.wikipedia.org/wiki/Fluent_interface)).
Is this not the same thing?

~~~
willtim
This is indeed how most OO languages implement stream combinators (e.g. C#),
but doesn't describe the F# and Clojure examples given.

~~~
clebio
I admit some degree of ignorance, but the Wikipedia page I linked to has a C#
example very similar to Fowler's final C# code:
[https://en.wikipedia.org/wiki/Fluent_interface#C.23](https://en.wikipedia.org/wiki/Fluent_interface#C.23)

Am I missing some subtle difference?

------
innguest
If Martin Fowler and his piecemeal refactoring posts is what it'll take for
the OO people to move out of State then I should thank Mr. Fowler.

~~~
willtim
No we should thank Erik Meijer for that :)

