A key principle in software design is reducing code duplication. Functional constructs provide additional opportunities for reducing code duplication through currying and functional composition.
The following topics will be covered in this chapter:
- How and why to avoid repeating code
- How to identify code similarities
- Using currying to remove certain types of code similarities
- Using composition to remove certain types of code similarities
- Using lambdas or composition to remove certain types of code similarities