Imperative approach in OOP language

Why do I see more competitive programmers using functional approach rather than objected oriented in OOP like C++?

When OOP approach is more reliable than functional approach and vice versa?

Is there something that a C++ developer can do and C developer can’t?

Hi prrateekk,

well these OOPS based answer can be found in any of the OOPS book. but for a while you asked about competitive programmers so in competitive programming you can apply both approach but it will be overkill in case of OOPS because you don’t need it. its all about logic there is nothing like real world model and security issue in competitive programming. OOPS is more reliable due to security what we all need. and finally there is nothing that a c++ can do and C not because c++ is derived from C means you can do anything but it will something like that you are again deriving a new language from C which has OOPS feature. C is mother language of many languages eg C++,java etc. i hope you have found answer if some query then ask :slight_smile:
so go for functional approach :)

Thank you for such a great answer sir

1 Like

I think Codechef is not the right place to use the Object Oriented Features of C++.

The main reason is it consumes more memory and time than Functional Programming!

You will always see the int main() in the Codechef and other Programming contests.

In case you are using JAVA, Java will not spare you if you will not use its OOP features :stuck_out_tongue:

OOP comes handy when we are in the field of software development. Algorithmic writing doesn’t need much OOP features.

Many features like:

  • Inheritance
  • Encapsulation, etc

are not used in Algorithmic Programming.

So understand the beauty of code!

Happy Coding! :slight_smile:

Thank you both for your answers.
Overall what I got is that OOP and functional approach both can do the task for you.
But,because of the security provided by OOP,it is preferred in software development.

If I made a wrong conclusion,please do correct me.

If more to share,help would be great.