Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
6 views
in Technology Trends by (55.6k points)

Can anyone tell me whether functional programming is better than OOP?

2 Answers

0 votes
by (119k points)
edited by

Functional programming and OOP are programming techniques deals with different tasks. Object-oriented programming is the best for the back end and security apps whereas functional programming approaches shine for other tasks.  There are other tasks that do well with functional programming. Functional programming is better if you want to deal with unchanging values such as in mathematical calculations. Functional programming is better if you are not concerned with lower security concerns but want to produce solid and reliable apps.

You can watch this video on Functional Programming and OOP to understand more:

0 votes
by (140 points)
I would not  see both paradigms as opposite. Functional programming was used for a very long time as a main paradigm, but with growing complexity functional programs get hard to maintain. Objects combine data and functions, so they build functional units that are relatively isolated from other objects, so it is far easier to keep things running.

I have been developing software for many years and some of my "object oriented" units have been designed 20 years ago and are still doing a good job.

On the other hand, I had to rewrite old programs, and this was much easier if they have been build with objects. Sometimes, a complete unit with 10.000 lines of code could be substituted by a new object without any big trouble.

But basically, objects also consist of functions. So I think OO is just the next step in evolution

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...