Quote Originally Posted by nigelhoath View Post
"You don't need to use any object-oriented programming in C++. There are other paradigms"

This I think is interesting. I have heard C programmers inferring OO is a must but from what I see I could well write any C program in C++ with little alteration.
You could do that, but the issues that I see is the eventual creeping in of C++ constructs into a program that started out as 'C'. This often leads to buggy programs, since C++ has object types that you cannot reliably use 'C' coding on.

To be more explicit, 'C' has only one category of data types called POD (Plain-Old-Data) types, while C++ supports POD and non-POD types. It's the non-POD types that trip up C programmers attempting C++ code. Things such as calling memcpy(), memset(), malloc() when using non-POD types is potentially fatal in a C++ program.

So I would recommend not trying to code a mixture of C and C++ programming techniques in the same application unless you know exactly what you're doing (usually this can be accomplished by a person experienced in both C and C++. The opinion of many is that no matter the experience you have in 'C', you are not an experienced C++ programmer because C++ looks like 'C').

What I mean by not having to use object-oriented methods, there is a paradigm in C++ called policy-based programming, where there is little, if any use of object-oriented programming (i.e. usage of virtual functions, polymorphism, etc.). To properly exploit this, you have to be an experienced and close to expert C++ programmer. It isn't for the beginner C++ programmer. Here is a link:

http://en.wikipedia.org/wiki/Policy_based_programming

Note that even the Standard Template Library uses very little, if any object-oriented techniques. None of the STL containers are designed to be used in an OO style (lack of virtual destructor is the dead-giveaway). I've read that the inventor of STL was against any usage of the containers as "base classes" to be derived from.

Regards,

Paul McKenzie