Monday, July 08, 2024

Abandoning Immutable Functional Programming Simplified Code Significantly

A Cloud Web Service JavaScript library that I integrated with at work several years ago has released a new version. And, while upgrading it, I noticed they simplified one of its JavaScript APIs significantly by abandoning the Immutable Functional Programming craze that was hyped up mindlessly everywhere over the last 10 years, employing a very sensible Object Oriented Design instead. 

I always knew the recent emphasis on "Immutable Functional Programming" was over-engineering and premature-optimization plus a lack of proper knowledge and understanding of Functional Programming being perfectly OK with mutation given that Lisp supported both mutation and immutability depending on the use-case (you can learn more about that here: https://www.youtube.com/playlist?list=PLE18841CABEA24090) as well as the fact that Object Oriented Programming is simply an advanced case of Functional Programming, so it is perfectly OK as an improved application of Functional Programming (you can learn more about that here: https://andymaleh.blogspot.com/2019/07/is-oop-compatible-with-functional.html). 

I am not saying Immutable Functional Programming does not have its place at all. But, applying it everywhere is a premature optimization trade-off that ruins productivity and maintainability due to breaking the 80/20 rule that dictates that we should follow the simplest programming model possible for most of the work and only optimize the few cases that have special performance requirements (like by applying Immutable Functional Programming techniques). 

I am glad many developers are finding out the hard way that I was right all along about "Immutable Functional Programming" not being important in most apps and that it causes awful over-engineering/premature-optimization that slows down productivity and maintainability significantly. 

I guess it is time to say "I told you so!"


No comments: