On Jun 4, 6:20*pm, Greg Herlihy <gre...@mac.com> wrote:
> One of C++'s design goals was to be a "better 'C' than 'C'" - so, in
> fact it does make sense to write in C++ - the kind of program that one
> might otherwise write in C. Or to put it another way: even programs
> that are not by nature object-oriented, can still take advantage of C+
> +'s other features. For example, a C++ program use inline functions,
> function templates or const variables in places where a C program
> would use a macro.
C++ took C and added more features to it, so it's better. The only
problem with C++ is that its added complexity adds considerably to the
complexity of its compiler. This gives rise to two issues:
1) The unavailability of C++ compilers
2) Bugs in C++ compilers
If I'm programming something simple then I'll go for C so that it's
more portable. If I'm programming for a micrcontroller, then I've no
choice but to go for C because there isn't a C++ compiler available.
If I'm programming a GUI application for Windows, Linux, Mac, etc.,
then I'll go for C++.
|