By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,972 Members | 911 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,972 IT Pros & Developers. It's quick & easy.

difference between plain C and a full object oriented programming

P: n/a
I wander what is the penalty of speend for using object oriented
programming (C++) against the play C.

Have a nice day,
Mihai

Jul 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
mihai wrote:
I wander what is the penalty of speend for using object oriented
programming (C++) against the play C.


No, the penalty of speend is always caused by the programmer. BTW, OO
programming is much harder than procedural programming.

Jul 23 '05 #2

P: n/a
mihai wrote:
I wonder,
"What is the [performance] penalty
for using object oriented programming (C++)
instead of plain C?"


None.
Object oriented programming
is as good an idea in C as it is in C++.
C++ just makes it easier and more reliable
because it is an object oriented programming language --
it includes direct support for object oriented programming:
1.) encapsulation (actually, data hiding),
2.) inheritance and
3.) run-time polymorphism.

Of course, new C++ programmers create problems for themselves
when they try to use the new language features
in inappropriate situations.
As a rule, you should avoid doing anything in C++
that you wouldn't do in C.
Jul 23 '05 #3

P: n/a
mihai wrote:
I wander what is the penalty of speend for using object oriented
programming (C++) against the play C.


None whatsoever.
Jul 23 '05 #4

P: n/a

"mihai" <Mi*********@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I wander what is the penalty of speend for using object oriented
programming (C++) against the play C.

Have a nice day,
Mihai


Both C and C++ can support OO programming. Consider this. Lets suppose you
have a bunch of classes or types that are related in some way. Who will be
faster? The non-OO language programmer that has to create a container for
each single type or the OO programmer that can use one container to store
all the types, including those derived types not yet created?

Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.