Chapter 10. Pattern Implementation Using Object/Functional Programming
Most modern programming languages (partially or completely) support Functional Programming (FP) constructs these days. As outlined in the previous chapters, the advent of many-core computing is a factor in this progressive evolution. In some cases, we can encode a solution using OOP, and there can be a functional version of the solution as well. The most pragmatic use of the FP constructs can be undertaken by judiciously mixing them with OOP code. This is also called object/functional programming, and is becoming a dominant paradigm in languages such as F#, Scala, Ruby, and so on. The C# programming language is not an exception. There are instances where programmers abuse FP constructs to make themselves appear modern, often resulting in unreadable code. Programming being a social activity (in addition to its intellectual appeal), the readability of code is as important as its elegance and performance. In this chapter...