The Promises of Functional Programming

In this entry I’m going to talk about an article by Konrad Hinsen. It is titled as “The Promises of Functional Programming”.
This article talks about the advantages of moving to functional programming (they’re more robust, compact easy parallelizable). But what is functional programming? Functional programming is a way of programming using mathematical functions avoiding mutable data and changes of states.
What principally characterize functional programming is that it is composed by functions, as I already said, of mathematical type or in mathematical context. This means that a function will always produce the same output when given the same input. Since there are no side effects, variables are not modified, and they aren’t required. This aspect surprised me because in all the programming languages that I’m familiarized with, variables are part of their fundamentals. But this is just the beginning, another fundamental aspect of functional programming that can be interpreted as a lack compared to other programming languages is that there are no “loops”. In this type of programming, the recursion is what replaces loops (recursion is when a function calls itself directly or indirectly).
At this point I started to relate these concepts with Clojure. In Clojure or any other functional language, there is no need to create variables because we use a function as a parameter of the other and so on. And without variables to modify, there is no need of loops. We only need recursion to “emulate” or replace them. 
At the end of the article, the author talked about two computing aspects that are rapidly gaining importance: concurrency and parallelism. Nowadays, single-processing performance is no longer enough, so we need parallelism by using multiple cores and concurrency to execute several threads on the same data. 
This article made me see other side of Clojure advantages. It is incredible how with every entry I’m realizing that there is no other programming language better than Clojure. Actually, the real point here that I’m starting to consider is that: There shouldn’t be other programming languages, we do not need them.

Comments

Popular posts from this blog

Beating the Averages

Rich Hickey on Clojure

Language as the Ultimate Weapon