Converting Queries to Commands

When methods focus on a single responsibility, they fall into two broad categories. They are either queries that compute and return some value without producing side effects, or they are commands that change the state of the world or the state of the object they are on.

The former style is more common in functional programming. In fact, we can say that functional programming is all about organizing our code around pure queries. In contrast, OO biases toward methods that return void. We call...

 •  0 comments  •  flag
Share on Twitter
Published on July 11, 2017 12:38
No comments have been added yet.