Chapter 15. Solving common problems functionally
This chapter covers
- Using assertions
- Reading property files
- Adapting imperative libraries
You now have at your disposal many functional tools that can make your life as a programmer easier. But knowing the tools isn’t enough. To become efficient in functional programming, you must make it second nature. You need to think functionally. Initially you’ll keep your imperative reflexes, and you’ll probably have to think about how you might translate an imperative solution into functional coding. You’ll have become a proficient functional programmer when your first approach to a programming problem is to think about a functional solution first (and perhaps have some difficulties translating it into imperative!).
To reach this stage, there’s no other way than practicing. And because, at least in the Java world, a huge majority of the known solutions to common problems are imperative, it can be a good exercise to look at some common problems and see how they can be solved in a functional way.