Re: As a programmer of both languages...



jacob navia wrote:
Ian Collins wrote:
jacob navia wrote:
Ian Collins wrote:
jacob navia wrote:

The difference between C and C++ is the object orientation of C++.
C is
not object oriented.

Are you really dense, or just being obtuse? As you have been told many
times before, C++ is a multi paradigm language. You can *choose* to
write OO or procedural code in C++.

You can't program in C++ without using classes. Even if you define
a simple structure it is actually a class.

Your ignorance continues to astound. Maybe you should take some time
out and learn C++ before slagging it off.


Yes Sir!

struct A {
int age;
char *Name;
};

int main(void)
{
A jacob;
}

This is valid C++ but invalid C. In C++ each "structure" definition
is just a CLASS where all members are PUBLIC by default. I see this
explanation in all C++ books I read but in my ignorance I believe
them. Stupid isn't it?

What's your point? The fact that struct is close to a synonym for class
is irrelevant. Your example struct is equally valid in both languages,
C++ treats it exactly the same as C. Saying you can't write anything
useful in C++ without classes is like saying you can't write anything
useful in C without using structs. In both languages we represent
collections of data in structures.

Maybe, who knows what buzzword will be invented in the future, but
the fact is that without classes you just can't do anything at all in
C++.

If everything C does plus quite a bit more (like your beloved operator
overloading) amounts to nothing.....


You are just playing word games, a favorite sport in this group.
Of course you can write programs in C and compile them with C++,
modulo some differences it is possible.

That's not what I said. Are function templates OO? Is function
overloading OO? Are exceptions OO?

Does your beloved operator overloading make sense without structs?

I would be surprised that you
can use the STL without using implicitly a class!!!

Many of the C++ standard library algorithms work equally well with
pointers. Very little of the STL is OO, which ironically is a common
criticism of it from OO purists.

All of the extensions to C you keep pushing are available in standard
C++, today.

--
Ian Collins.
.



Relevant Pages