Why did C++ come in the world and still companies needs C?

Why did C++ come in the world and still companies needs C? by Kurt Guntheroth

Answer by Kurt Guntheroth:

There is a lot of misinformation in the answers to this question.

First off, C++ is an almost perfect superset of C, so that anyone wishing to write, for instance, firmware or operating systems, can use the parts of C++ they need, with no performance penalty they don’t agree with. If they use facilities they don’t need and suffer performance issues, well, it’s a poor workman who blames his tools.

Implementing a C compiler from scratch is simpler than implementing a C++ compiler. In 1990 that was an important consideration. These days practically all compilers derive from Visual C, GCC, or clang. All of these compilers read C++, so there is no longer an excuse.

The basic difference between C and C++ is that C is a simple language for solving small problems. If all you want to do is solve small problems, you can learn C quickly. By contrast, it takes about two full-time years to acquire a journeyman’s experience with C++. Some people don’t want to invest this amount of time. They may argue very loudly that C is all you ever need, but the facts are that C++ was developed because C was not good enough for big problems. C has minimal to no support for encapsulation, dynamic variables, or generic programming. Sure, you can do big programs in C, but C has no expressive, well-checked idioms for things you need when doing big programs.

Why did C++ come in the world and still companies needs C?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s