Re:Object oriented programming with ANSI-C (1993)
by klipt on Sunday January 05, 2014 @02:25AM
(#7014972)
> OO is not the "one true way"
Personally, I think C++'s big win over C++ is not OOP but generics. You can do OOP in C if you want; you can't do generics efficiently and safely.
Re:Object oriented programming with ANSI-C (1993)
by dllthomas on Tuesday January 07, 2014 @05:39PM
(#7020502)
You can't do generics in very much generality without compromising safety, true. You can get some (sometimes a surprising amount) done with macros, and safer now with static casts. Templates are still a win though, to be sure (syntax aside...)
OO is not the "one true way", that has been shown time and time again. It's really not difficult to find a library for things you need in C. The fact that they aren't all available to include the moment you open your editor/IDE isn't a reason to use C++.
I use both C and C++ regularly. I love a lot of things about C++, but it also brings a lot of baggage along with it. It is an extremely complex language and I have seen some really, terribly awful code written in it.
I've seen bad C code as well, but C++ makes it easier to write bad code and harder to restructure it if you need to because you have to deal with much more abstraction. C++ also lends itself to writing code which contains very subtle errors in it. C makes that more difficult.
I read your post and I just hear someone with little C experience who loves his objects and can't fathom doing things another way.