-1

Can we use Procedural Programming to solve any problem that can be solved using Object Oriented Programming Concepts? My problem is are there some particular problems which can only be solved using OOP concepts.

Please help me understand this.

Rajind Ruparathna
  • 2,215
  • 24
  • 55
  • 3
    The programming paradigm does not affect what problems you can solve, it can only make it easier (or harder) to write the code to do so. You can solve the same problems in assembly language or in C#, but the former is usually going to take a lot longer. – S.L. Barth is on codidact.com Jun 26 '14 at 13:51
  • What @S.L.Barth is true. Also the right paradigm lets a team both develop and mantain the source code easly. The right paradigm let you expand your project with more efficency. The right paradigm let you write less bug in a code. But you can choose whatever you want. – Antonio Ragagnin Jun 26 '14 at 13:54

2 Answers2

2

Yes. Anything that can be solved using OOP can be solved using procedural programming. In the end the compiler just turns your OOP code into assembly, which is procedural.

It all comes down to what the combination of the CPU/RAM etc in your computer can do. Since your computer is Turing Complete it can solve any problem that be solved by any other language or machine that is also Turing Complete.

mclaassen
  • 5,018
  • 4
  • 30
  • 52
2

Nearly all programming languages are "Turing complete". That means programs written in one paradigm (say the functional one) can always be converted to another one (say the logical one). A compiler is just a tool that translates code from one language/paradigm to another. Thus the moment a language is Turing complete, you can solve anything in that language you can in any other, although the performance and elegance of the code might vary.

Currently on the hardware level, the only implemented paradigm is the procedural one (there have been some experiments with the functional and logical one and even OO has already been implemented on a CPU).

Willem Van Onsem
  • 443,496
  • 30
  • 428
  • 555