Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Efficiency of program

I want to know whether there is an effect on program efficiency by adopting object oriented approach to a problem as compared to the structured programming approach in any programming language but specially in c++.

like image 803
Abdul Samad Avatar asked Nov 06 '10 05:11

Abdul Samad


1 Answers

Maybe. Maybe not.

You can write efficient object-oriented code. You can write inefficient structured code.

It depends on the application, how well the code is written, and how heavily the code is optimized. In general, you should write code so that it has a good, clean, modular architecture and is well designed, then if you have problems with performance optimize the hot spots that are causing performance issues.

Use object oriented programming where it makes sense to use it and use structured programming where it makes sense to use it. You don't have to choose between one and the other: you can use both.

like image 76
James McNellis Avatar answered Oct 05 '22 11:10

James McNellis