This post originated from an RSS feed registered with Agile Buzz
by Martin Fowler.
Original Post: Refactoring Loops to Collection Pipelines
Feed Title: Martin Fowler's Bliki
Feed URL: http://martinfowler.com/feed.atom
Feed Description: A cross between a blog and wiki of my partly-formed ideas on software development
I've long been a fan of the programming pattern that I call
the collection
pipeline. This allows me to write computation on collections
in the form of a pipeline of familiar operations (eg filter,
map, reduce). More and more language environments now have the
language features and collection APIs to support pipelines, but
since they have been limited in use for so long, more people are
familiar with loops. In this article (which I'm releasing in
installments) I'll take some loops and show how I'd refactor
them into collection pipelines.