Unveiling functional programming

As we mentioned earlier, functional programming is a programming paradigm. You can think of a paradigm as a way of thinking when constructing programs. C++ is a multi-paradigm language. We can use it to develop programs in a procedural paradigm, that is, by executing statements one after one another. In Chapter 3, Details of Object-Oriented Programming, we discussed the object-oriented approach, which involves decomposing a complex system into intercommunicating objects. Functional programming, on the other hand, encourages us to decompose the system into functions rather than objects. It operates with expressions rather than statements. Basically, you take something as input and pass it to a function that ...

Get Expert C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.