IS FUNCTIONAL PROGRAMMING IN C# A GOOD IDEA?

When all you have is a hammer, everything looks like a nail. Should programming languages be seen as general problem solving devices that can be applied to any problem and, as a consequence, to any solution strategy? Or should they be viewed as tools that are good for particular tasks, and less good or even useless for others? Practical understanding of different programming languages, the driving factors that define their priorities, and the consequences of the design decisions seems to point quite clearly toward the “tool” understanding of programming languages. Functional programming is a good example to document this statement. Let’s face it: if you want to write some purely functional code, you’ll have a much easier time doing it with the help of a purely functional language — that is, one that has been created with the precise techniques in mind that you are going to employ. No surprise there, really.

In reality, it’s all about finding the best compromise. It is certainly a goal to strive for to understanding the specialties of different languages and to be able to make informed decisions about their applicability to a particular problem situation. But in most real-world projects, there are limits to the number of such choices you can reasonably make. Other programmers involved may not be familiar with the same subset of tools that you know. It pays in the long term to have some consistency across projects, because it keeps down ...

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.