Introduction to Functional Programming and its features

Posted By :Dimpal Bhatia |27th September 2019

Functional Programming:- Functional programming is a process of thinking about software development by creating pure functions.Functional programming is a declarative programming style in which we bind everything in mathematical functions style. The main focus of functional programming is on "What to solve" instead of "How to solve".
Functional programming also uses expressions. It does not uses statements.We execute statement to assign variables whereas an expression is used to produce a value.

                                 

1) Immutable Data:- Immutable data means we can't modify object state once created.we can easily create new data structures rather than modifying existing once.

 

2) Referential transparency:- Referential transparency is the property of a program.An expression in a program is called as referentially transparent if we can change it with value and both the resulting behavior will be same. This means that whether reference or actual value is used as input the program's behavior is not changed.

 

3) Modularity:- Modular design increases productivity. Small modules can be coded quickly and have a greater chance of re-use which surely leads to faster development of programs. Apart from it, the modules can be tested separately which helps you to reduce the time spent on unit testing and debugging.

 

4) Maintainability:- Maintainability is a simple term which means functional programming is easier to maintain as you don't need to worry about accidentally changing anything outside the given function.

 

5) First-class function:-  It is attributed to programming language entities that have no restriction on their use. So, It can appear anywhere in the program.

 

6) Closure:- The closure is an inner function which can access variables of parent function's even after the varible is not declared as final.

 

7) Higher-order functions:- Higher-order functions either take other functions as arguments or return them as results. Higher-order functions allow partial applications or currying. This technique applies a function to its arguments one at a time, as each application returning a new function which accepts the next argument.

 

Conclusion

1) Functional programming is a different way of thinking about software construction based on some fundamental defining principles.


2) The main concepts of functional programming focuses on results, not process.


3) The objective of any Functional programming language is to minimize the mathematical functions.


4) Some most prominent Functional programming languages: 

a)Haskell

b)SM

c) Clojure

d) Scala

e) Erlang

f) Clean

 

5) Immutable Data means that you should easily able to create data structures instead of modifying ones which is already exist.


6)  Allows you to avoid confusing problems and errors in the code.


7) Functional code is not easy, so it is difficult to understand for the beginner.


8) Functional programming uses Immutable data while OOP uses Mutable data.

 


About Author

Dimpal Bhatia

She is a bright java developer. She has a good knowledge of JavaScript, jQuery, JSP, and ElasticSearch. Her hobbies are playing badminton and reading books

Request For Proposal

[contact-form-7 404 "Not Found"]

Ready to innovate ? Let's get in touch

Chat With Us