Is c with classes a recommended coding style?

In c++ primer 5, effective c++, essential c++, The C++ Programming Language, essential c++ and other's famous c++ books all suggest us should use more high level behaviors offer by c++.

But they never told us "don't treat c++ as c", so "c with classes" is not that bad in c++(in most of the time)?
Last edited on
I'm not sure, but C to C++ is not only a change in available programming means, but also a change in paradigm. What you're saying is to use C++ as a procedural language with classes, instead of using it as an object-oriented language.

If it's bad or not may depend on the situation, but my point is, adding classes changes the programming paradigm, not only adds a syntactic feature. And in object oriented programming you solve problems in a different way than in procedural programming, not only with different means.

That said, as a pragmatic I would advocate to be conscious of the two paradigms and use whichever is best for your problem. C++ seems to be very well suited to that approach.
Topic archived. No new replies allowed.