I am beginer in C++ reading some books. I am always in doubt that why to go for Object orientation instead of procedural approach ??? Is there any distict advantage that the procedural approach is lacking in ???
Please help.
Well, the real problem with procedural code lies in creating large projects. Using objects, software is easier to maintain and reuse.
There are a great many things that object oriented software is distinguished for, but the bottom line is that if it is done well, it decreases development time.
When you can write a Class, and have it inherit from another class the majority of what you need it to do... well, you really saved yourself some time. CoolNameDenied
The world itself is "object-oriented," not procedural or anything else, so people tend to think in an object-oriented manner. When you model something in the world, it's usually conceptually easier to do it using objects.
OO programming also improves modularity and code-reuse, as CoolNameDenied pointed out, thus helping you work faster and more efficiently.
I want to add my vote for the two previous posts. I am a very good C programmer, and I still write low-level functions in C. But once I saw how C++ helps during design, development, maintenance, and reuse, I switched.
The benefit of C++ is productivity, in my opinion. No question there is a philosophical satisfaction from programming in a way that carves nature at its joints (object oriented), but even without that benefit, C++ when done correctly (and that in itself is a big caveat) makes an individual programmer, and an organization, more productive.
I still love C for its elegance and stark simplicity.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.