Introduction to functional programming

There are several types of programming paradigms and Functional programming is just one of them.

So if you don’t know what is it? then you came to the right place because here, in this article, we are providing you with the Introduction to functional programming.

What is Functional Programming?

Functional Programming is a Programming paradigm (a method to solve particular programming problem).

It’s completely a different approach as compared to Object-oriented programming.

Its main focus is to know “what to solve” instead of “how to solve”. By this, we mean that it uses expressions instead of statements.

An expression is evaluated to produce values whereas a statement is executed to assign variables only.

Following are some Examples of programming languages which fall under the category of Functional Programming:

  • JavaScript
  • Lisp
  • Haskell
  • Scala
  • Racket

Also Read – Introduction to JavaScript programming – For beginners

Some Pros and Cons of Functional Programming:

Pros

  • Best to start with – If you are thinking to start programming then Functional programming is the best paradigm to follow in the beginning.
  • Avoid a Shared State for programmers – Using a Functional Programming paradigm the programmers can avoid a shared state or side effects which eliminates bugs caused by multiple functions competing for the same resources.
  • Favor declarative and denotational styles – It also tends to favor declarative and denotational styles, which do not spell out step-by-step instructions for operations, but instead concentrate on what to do, letting the underlying functions take care of the how.

Cons

  • Difficult for Some people – A person who knows object-oriented programming may find functional programming difficult to adapt at first glance.

Conclusion

So this was all regarding introduction to functional programming. if you find it useful then do let us know in the comment section below, we would love to hear that.

Stay tuned for more.

Leave a Comment