Loading…

Functional programming

What is it and where to read about it?

In case you a beginner in the world of programming, then you probably do not know three main paradigms: logical, imperative and functional programming. 

 

In the first case, the main principles are quite clear: you follow math logic for outputting facts and states from the already known ones. The hot example of such a programming language is Prolog. 

 

Operation principle of imperative programming is forming the instructions, consequent commands that should be executed by a machine. You can just open the list of the most popular programming languages, and those above are imperative programming languages. 

Now we turn to functional programming. It may become difficult to understand after the classic school programming lessons. Exactly for this reason, here are the most useful sources on functional programming for future experience and general development.

What is it

So, as we have already found out, imperative programming works with strictly defined states and instructions. The functional is based on the interaction with functions, that is, certain processes that describe the relationship between input and output parameters. Thus, while an imperative language describes a concrete action with known input parameters, a functional one describes a certain interaction body, without going down to specific cases.

 

Despite the emerging complexity, functional programming has a set of advantages:

 

  1. The code becomes shorter;

  2. The code becomes more comprehensive;

  3. The code includes the signs of good imperative programming languages: modularity, typification, code cleanness.

 

The examples of functional programming languages are LISP (Clojure), Haskell, Scala, R. In general, you can even try to write functional code on Python or Ruby, but it is more entertainment for your brains, rather than a rational usage of the programming language possibilities.

Accurately

It is logical that many books and articles have been written on functional programming that has existed for almost 50 years. So what’s the point of presenting your own version of “OP for dummies”, if everything has already been online for a long time in a beautiful and readable form? So just share the links:

  1. Nice article, providing a historical excursion, bright figures, but the main thing is the good examples.

  2. Book, which every functional developer should read.

  3. Online course, which you can listen to.

  4. Funny and useful slide show on functional programming.

  5. For those who prefer the learning from a chronological beginning – the book of Christian Queinnec «Lisp in Small Pieces».

 

What should I do with this knowledge

 

As for the application field, functional programming is an indispensable tool for creating artificial intelligence or in areas where imperative languages consume too many resources (for example, in Data Science). So if you decide to direct your further career in this direction, then it’s time to lay aside the literature described above and leave your mark on someone’s virtual head.

 


Leave a Comment