As we well know, when we talk about the different ways or approaches that we have we can find different flavors for different users. It goes from programming in assembly languages, object-oriented programming up to functional languages (e. g. LISP and more recently Clojure).
But the real question to ask, is if it is really desirable to start programming on a functional language? Up to now, I cannot answer this question, but I can give you the landscape of the pros and cons of the programming languages.
First of all, we need to keep in mind that the fundamental principle of functional programming is that you realize a computation by composing functions. But the context of this functions is purely mathematic this means, that given a value you pass it to a function to obtain some other value (mapping from input values to output values); however, the most programming languages take functions as a subroutine that returns a value.
Also, we need to clarify that functional programming do not use per se loop cycles, in functional programming we use something called recursion, this is, a function that calls itself directly or indirectly.
Another of the benefits that functional programming provides you, is the concurrency and parallelism but I agree with the article writer that it is not as simple as you could imagine accomplish this fact also with functional programming. The advantage that you achieve by parallelizing in a functional language is that you do not have the problem of maintaining the data in a coherent state because you do not have to fight with variables or saving information in memory because this is not the functional programming approach.
Finally, nowadays the functional programming has been very popular and used in the scientific research field and it is not very popular for writing real-life programs but with the time I am sure that this will going to change (or maybe not).
No hay comentarios:
Publicar un comentario