7 ms·
In my experience, the advantage of functional programming is that it is very easy to understand and debug. If my program consists of series of small functions t
by smanek 18y ago
In my experience, the advantage of functional programming is that it is very easy to understand and debug. If my program consists of series of small functions that each have no side effects, things become very straight forward. I won't have one function mysteriously causing problems in another part of the program because it modifies global state in some unexpected way.
Combined with decent unit testing to ensure that each small function works as expected, it becomes exceedingly unlikely that changes will introduce difficult to debug issues.
One of the best books that first showed me how you can use a lot of the features of functional languages (first class functions, lambdas, etc) to build better functional programs was Norvig's PAIP.