Wednesday, April 8, 2020

Functional programming

Hello,

Today most developers have knowledge of the object oriented, which represents an approach to computer programming that represents the outside world as objects. For example, if you want to represent a car, you will create a car-type object that will have four wheels, an engine, a mileage. These are attributes. The car can also accelerate, slow down. These are functions. In general, an object will be represented by a class which will gather the data (= attributes) and the processing of its data (= functions).

On the other hand, there is another paradigm a little less known but which is growing more and more, it is the Functional programming.


Functional programming, as its name suggests, is programming based on the notion of functions and the notion of methods. Suddenly we find that in a functional program, all the elements can be understood as functions and also the code can be executed by successive calls of functions and methods.

Functional programming represents a declarative programming paradigm, i.e. the program is described in the form of a description of the solution with respect to an initial state.
Functional programming, like any programming technique, is used as a tool to solve certain classes of problems. Very useful for callbacks, which are used in GUIs for event loops. Certain types of arithmetic problems can be solved more quickly with Functional programming (for example calculating the derivative of a mathematical function).

Scala, Haskell, Erlang or Groovy are functional languages ​​that you may have encountered, but it is also possible to code differently in java using some functional principles (and libraries). Java 8 and JSR 355 will introduce the basics of functionality in Java.

you can consult the article in french, Fuctionnal Programming

0 comments:

Post a Comment