Talk: The Pipes Library: How Plumbing Can Make Your Code More Expressive
In code we work with collections of objects all the time, yet it's not always easy to operate on them with concise and expressive code.
Traversing collections with for loops gets ugly and brittle as soon as they have more than a few lines. STL algorithms are a big step further, but they don't compose well (ever had the need for a "transform_if" algorithm?) Ranges are another big step further, but like every library they don't cover all cases (Did you know about the transform-filter performance problem? Or that you're not allowed to use rvalues as inputs? Or that you have to use tuples when working on several collections?)
In this talk you will discover pipes, another way to write expressive code to operate with collections: write your code as plumbing through which your data flows Like every library pipes also have their limitations, which we will present, but using them as a complement of ranges and STL algorithms will bring you the following benefits:
- An efficient transform-filter
- zip two collections without using tuples
- send data to several outputs
- use rvalues as inputs and as intermediate results
- pick up the data coming out of STL algorithms
- integrate results in destination containers
- pipes are very easy to implement, so you can add new ones
Come see how pipes can improve your code!