Choosing a functional paradigm language has been a hot topic for a while. Functional vs. Object Oriented Paradigm is a constant discussion topic within the developers.
Before thinking the benefits of FP, the working environment must be suitable for modern work
The key of success at the management point of view is not to micromanage. Let the team choose their working methods and tools. The project is always a compromise between time, features and given resources. It’s all about how the project management sees that triangle.
Treat the professional developers with this Sledge Hammer principle: “Trust me, I know what I’m doing”. Developers should know exactly how the program works, because code is the most detailed specification of the solution. It’s all about communication between the people – and between the human and the computer.
When the environment is suitable for working, then we can discuss about the benefits of FP
So why should I choose FP instead of OOP/imperative? What benefits it would bring the table? Here’s some thinking I’ve done in the past years based on my experiences:
Functional programming makes especially list handling a way easier. There are effective functional languages like Clojure or Scala. Another option is to use functional libraries like Ramda or Lodash. I like flexible code, so I prefer using scalable languages, like ES6, Scala, Java8 or C#/LINQ. With OOP and FP combined I have more options available. It’s also a safe choice when there ain’t so much pure functional programmers in the team (yet). Scaling the Object Oriented code with functional flavour is understandable compromise with functional averages like me. Actually I’m on my way of using only functional languages.
Here’s some benefits I found on functional paradigm which could save some money
It’s stateless and then also immutable, so no side effects
When the state is immutable, it’s way easier to scale up and still control the whole
Here’s a recap of my points:
Let the developers to choose the right tools and processes for building the high quality solution
As a team member, encourage the colleagues at least try to code with FP
Functional code is simple and easy to maintain. when it works, it works (no side-effects like in OOP). Broken code is easier to recognise and refactoring is less risky operation
Data must persist outside the code (like in Redux architecture). It shortens or eliminates debugging marathons. Less risk for wasting the time hunting the bugs from the production environment
- REPL-driven development: http://blog.jayfields.com/2014/01/repl-driven-development.html
- About Promises and asynchronous programming: https://en.wikipedia.org/wiki/Futures_and_promises
- Reactive programming with RxJava: https://github.com/ReactiveX/RxJava
- Uncle Bob’s classic handbook. I think every developer must read this: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882