quote:Original post by David M.
MadKeithV--I''ve never used templates or anything like that. I just tried using classes for my interfaces once, and...well, I wasn''t all that impressed, to say the least. I couldn''t see how I was stepping into the "next phase" of programming, as my peers like to shove down my throat.
Perhaps your programming practices are already well-structured and lend themselves to code reuse, genericity, polymorphism, encapsulation/data hiding, and the many other benefits that C++ encourages you to use through explicit language features. There''s no reason you couldn''t do all this in C. But if you''re not using some of the above paradigms, there will undoubtedly be times when you might find your work was made easier, quicker, or less error-prone if you were.
quote:
What really bugs me, as I''ve probably said before, is when people tell me there are things I just "can''t do" in C Classic. They like to tell me that they''re technologically "ahead" of me. Well, pffft, I say.
I agree: anything that can be done in C++, can be done in ASM. It may not be as obvious to someone glancing through the code But it can be done. I don''t think it''s as easy to do though.
quote:That is, I believe that `smart programmer'' trumps `smart language'' every time.
This is true, but it''s not really the point.
Smart programmer with dumb language is probably marginally better
than dumb programmer with smart language.
However, smart programmer with smart language is going to be able
to accomplish more than either of the above.
And this is what C++ is about. It''s a powerful tool, slightly harder than C to use well, but eventually allows you to build up and manage complex systems more quickly and easily, in most people''s opinions. It just provides some short cuts and syntactical encouragement to some good programming paradigms.
quote:
Now, another thing I don''t like is having all my private functions and variables in the header file. I prefer to have the interface in the header file, and the implementation in the C file. I don''t know why, exactly--it''s just a, um, snobby aesthetic thing of mine.
This makes sense to me too, and I consider it something of a discrepancy in C++, although only a minor one. In this way, C can actually seem better than C++ for data hiding and encapsulation in some cases. Certain ''private'' functions that don''t need to act on private class members, I just make as static non-member functions in the class implementation file so no-one else ever knows they exist.