[6] Big Picture issues
(Part of C++ FAQ Lite, Copyright © 1991-2001, Marshall Cline, cline@parashift.com)


FAQs in section [6]:


[6.1] Is C++ a practical language?

Yes.

C++ is a practical tool. It's not perfect, but it's useful.

In the world of industrial software, C++ is viewed as a solid, mature, mainstream tool. It has widespread industry support which makes it "good" from an overall business perspective.

TopBottomPrevious sectionNext sectionSearch the FAQ ]


[6.2] Is C++ a perfect language?

Nope.

C++ wasn't designed to demonstrate what a perfect OO language looks like. It was designed to be a practical tool for solving real world problems. It has a few warts, but the only place where it's appropriate to keep fiddling with something until it's perfect is in a pure academic setting. That wasn't C++'s goal.

TopBottomPrevious sectionNext sectionSearch the FAQ ]


[6.3] What's the big deal with OO?

Object-oriented techniques are the best way we know of to develop large, complex software applications and systems.

OO hype: the software industry is "failing" to meet demands for large, complex software systems. But this "failure" is actually due to our successes: our successes have propelled users to ask for more. Unfortunately we created a market hunger that the "structured" analysis, design and programming techniques couldn't satisfy. This required us to create a better paradigm.

C++ is an OO programming language. C++ can also be used as a traditional programming language (as "as a better C"). However if you use it "as a better C," don't expect to get the benefits of object-oriented programming.

TopBottomPrevious sectionNext sectionSearch the FAQ ]


[6.4] Is C++ better than Ada? (or Visual Basic, C, FORTRAN, Pascal, Smalltalk, or any other language?)

This question generates much much more heat than light. Please read the following before posting some variant of this question.

In 99% of the cases, programming language selection is dominated by business considerations, not by technical considerations. Things that really end up mattering are things like availability of a programming environment for the development machine, availability of runtime environment(s) for the deployment machine(s), licensing/legal issues of the runtime and/or development environments, availability of trained developers, availability of consulting services, and corporate culture/politics. These business considerations generally play a much greater role than compile time performance, runtime performance, static vs. dynamic typing, static vs. dynamic binding, etc.

Anyone who argues in favor of one language over another in a purely technical manner (i.e., who ignores the dominant business issues) exposes themself as a techie weenie, and deserves not to be heard.

TopBottomPrevious sectionNext sectionSearch the FAQ ]


[6.5] Who uses C++?

Lots and lots of companies and government sites. Lots.

The large number of developers (and therefore the large amount of available support infrastructure including vendors, tools, training, etc.) is one of several critical features of C++.

TopBottomPrevious sectionNext sectionSearch the FAQ ]


[6.6] How long does it take to learn OO/C++?

Companies successfully teach standard industry "short courses," where a university semester course is compressed into one 40 hour work week. But regardless of where you get your training, make sure the courses have a hands-on element, since most people learn best when they have projects to help the concepts "gel." But even if they have the best training, they're not ready yet.

It takes 6-12 months to become proficient in OO/C++. Less if the developers have easy access to a "local" body of experts, more if there isn't a "good" general purpose C++ class library available. To become one of these experts who can mentor others takes around 3 years.

Some people never make it. You don't have a chance unless you are teachable and have personal drive. As a bare minimum on "teachability," you have to be able to admit when you've been wrong. As a bare minimum on "drive," you must be willing to put in some extra hours (it's a lot easier to learn some new facts than it is to change your paradigm [i.e., to change the way you think; to change your notion of goodness; to change your mental model of the world of technology]).

Two things you should do:

Two things you should not do:

TopBottomPrevious sectionNext sectionSearch the FAQ ]


[6.7] What are some features of C++ from a business perspective?

Here are a few features of OO/C++ from a business perspective:

TopBottomPrevious sectionNext sectionSearch the FAQ ]


[6.8] Are virtual functions (dynamic binding) central to OO/C++?

Yes!

Without virtual functions, C++ wouldn't be object-oriented. Operator overloading and non-virtual member functions are great, but they are, after all, just syntactic sugar for the more typical C notion of passing a pointer to a struct to a function. The standard library contains numerous templates that illustrate "generic programming" techniques, which are also great, but virtual functions are still at the heart of object-oriented programming using C++.

From a business perspective, there is very little reason to switch from straight C to C++ without virtual functions (we'll ignore generic programming and the standard library in this FAQ). Technical people often think that there is a large difference between C and non-OO C++, but without OO, the difference usually isn't enough to justify the cost of training developers, new tools, etc. In other words, if I were to advise a manager regarding whether to switch from C to non-OO C++ (i.e., to switch languages but not paradigms), I'd probably discourage him or her unless there were compelling tool-oriented reasons. From a business perspective, OO can help make systems extensible and adaptable, but just the syntax of C++ classes without OO may not even reduce the maintenance cost, and it surely adds to the training cost significantly.

Bottom line: C++ without virtual is not OO. Programming with classes but without dynamic binding is called "object based," but not "object oriented." Throwing out virtual functions is the same as throwing out OO. All you have left is object-based programming, similar to the original Ada language (the new Ada language, by the way, supports true OO rather than just object-based programming).

TopBottomPrevious sectionNext sectionSearch the FAQ ]


[6.9] I'm from Missouri. Can you give me a simple reason why virtual functions (dynamic binding) make a big difference?

Overview: Dynamic binding can improve reuse by letting old code call new code.

Before OO came along, reuse was accomplished by having new code call old code. For example, a programmer might write some code that called some reusable code such as printf().

With OO, reuse can also be accomplished by having old code call new code. For example, a programmer might write some code that is called by a framework that was written by their great, great grandfather. There's no need to change great-great-grandpa's code. In fact, it doesn't even need to be recompiled. Even if all you have left is the object file and the source code that great-great-grandpa wrote was lost 25 years ago, that ancient object file will call the new extension without anything falling apart.

That is extensibility, and that is OO.

TopBottomPrevious sectionNext sectionSearch the FAQ ]


[6.10] Is C++ backward compatible with ANSI/ISO C?

Almost.

C++ is as close as possible to compatible with C, but no closer. In practice, the major difference is that C++ requires prototypes, and that f() declares a function that takes no parameters (in C, f() is the same as f(...)).

There are some very subtle differences as well, like sizeof('x') is equal to sizeof(char) in C++ but is equal to sizeof(int) in C. Also, C++ puts structure "tags" in the same namespace as other names, whereas C requires an explicit struct (e.g., the typedef struct Fred Fred; technique still works, but is redundant in C++).

TopBottomPrevious sectionNext sectionSearch the FAQ ]


[6.11] Is C++ standardized?

Yes.

The C++ standard was finalized and adopted by ISO (International Organization for Standardization) as well as several national standards organizations such as ANSI (The American National Standards Institute), BSI (The British Standards Institute), DIN (The German National Standards Organization). The ISO standard was finalized and adopted by unanimous vote November 14, 1997.

The ANSI C++ committee is called "X3J16". The ISO C++ standards group is called "WG21". The major players in the ANSI/ISO C++ standards process include just about everyone: representatives from Australia, Canada, Denmark, France, Germany, Ireland, Japan, the Netherlands, New Zealand, Sweden, the UK, and the USA, along with representatives from about a hundred companies and many interested individuals. Major players include AT&T, Ericsson, Digital, Borland, Hewlett Packard, IBM, Mentor Graphics, Microsoft, Silicon Graphics, Sun Microsystems, and Siemens. After about 8 years of work, this standard is now complete. On November 14, 1997, the standard was approved by a unanimous vote of the countries that had representatives present in Morristown.

TopBottomPrevious sectionNext sectionSearch the FAQ ]


[6.12] Where can I get a copy of the ANSI/ISO C++ standard? UPDATED!

[Recently total rewrite; changed several URLs thanks to Brian K. Hamon and Garen Parham (in 4/01). Click here to go to the next FAQ in the "chain" of recent changes.]

There are at least three ways to get a soft-copy of this document:

Note: The ISO document is well over ten times more expensive than the ANSI document, however the technical content is the same. The ISO document has a different title page, but the technical material is identical to the ANSI document. Please don't email asking me why ISO charges so much more for fundamentally the same thing; that's ISO's business decision; you'll have to take it up with ISO's publishing/sales department.

There are at least two ways to get a hard-copy of this document:

There are two other potentially interesting (and free) documents you might want to look at:

TopBottomPrevious sectionNext sectionSearch the FAQ ]


E-Mail E-mail the author
C++ FAQ LiteTable of contentsSubject indexAbout the author©Download your own copy ]
Revised Aug 15, 2001