FUNCTIONAL PROGRAMMING IS A MINDSET

In the end, functional programming is a mindset. If you are willing to think in a certain way, it can offer you interesting solutions or at least food for thought, with a relevance to many practical aspects of programming today. You can do it in any programming language you want — well, almost. It should make your life easier and reduce the amount of code you need to write as well as the time to market for your next project and the maintenance efforts that come later.

Something that’s sometimes criticized about functional programming is the fact that the approaches are not bound to the most performative ones you could use to solve any given problem. This may or may not be true for any given algorithm–language combination — it is, of course, hard to make a general statement about this. It’s also difficult to judge given that an application of functional principles may enable you to utilize the processing resources provided by your machine more efficiently. The reality is that if a qualified person sat down and optimized each algorithm by hand, on a low level, using C code or assembler instructions, then he could certainly make everything run more efficiently. But at some point in the past the majority of programmers started moving away from such approaches and using higher level languages for most of the programming work they needed to do. They started looking at the time to market, the programmer’s efficiency, as a higher priority than the creation ...

Get Functional Programming in C#: Classic Programming Techniques for Modern Projects 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.