[6] Big Picture issues, C++ FAQ Lite
[6] Big Picture issues
(Part of C++ FAQ Lite, Copyright © 1991-98, Marshall Cline, cline@parashift.com)
FAQs in section [6]:
[6.1] Is C++ a practical language?
[6.2] Is C++ a perfect language?
[6.3] What's the big deal with OO?
[6.4] Is C++ better than Ada? (or Visual Basic, C, FORTRAN,
Pascal, Smalltalk, or any other language?)
[6.5] Who uses C++?
[6.6] How long does it take to learn OO/C++?
[6.7] What are some features of C++ from a business perspective?
[6.8] Are virtual functions (dynamic binding) central to
OO/C++?
[6.9] I'm from Missouri. Can you give me a simple
reason why virtual functions (dynamic binding) make a big difference?
[6.10] Is C++ backward compatible with ANSI/ISO-C?
[6.11] Is C++ standardized?
[6.12] Where can I get a copy of the ANSI/ISO C++ standard?
[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.
[ Top | Bottom | Previous section | Next section ]
[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.
[ Top | Bottom | Previous section | Next section ]
[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.
[ Top | Bottom | Previous section | Next section ]
[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.
[ Top | Bottom | Previous section | Next section ]
[6.5] Who uses C++?
Lots and lots of companies and government sites. Lots.
The number of C++ developers doubles every year. You can imagine that five
people are becomming C++ developers while you read this FAQ.
Growth is one of several critical features of C++.
[ Top | Bottom | Previous section | Next section ]
[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:
Bring in a "mentor"
Get your people two books: one to tell them
what is legal, another to tell them what is
moral
Two things you should not do:
You should not bother having your
people trained in C as a stepping-stone to learning OO/C++
You should not bother
having your people trained in Smalltalk as a stepping-stone to learning
OO/C++
[ Top | Bottom | Previous section | Next section ]
[6.7] What are some features of C++ from a business perspective?
Here are a few features of OO/C++ from a business perspective:
C++ has a huge installed base, which means
you'll have multi-vendor support for tools,
environments, consulting services, etc., plus you'll have a very valuable
line-item on your resume
C++ lets developers provide simplified
interfaces to software chunks, which improves the
defect-rate when those chunks are (re)used
C++ lets you exploit developer's intuition through
operator overloading, which reduces the learning
curve for (re)users
C++ localizes access to a software chunk,
which reduces the cost of changes.
C++ reduces the safety-vs.-usability tradeoff, which improves the cost of
(re)using a chunk of software.
C++ reduces the safety-vs.-speed
tradeoff, which improves defect rates without degrading
performance.
C++ gives you inheritance and dynamic
binding which let old code call new
code, making it possible to quickly
extend/adapt your software to hit narrow market windows.
[ Top | Bottom | Previous section | Next section ]
[6.8] Are virtual functions (dynamic binding) central to
OO/C++?
Yes!
Without virtual functions, C++ is just a
syntactic variant of C. 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.
From a business perspective, C++ without virtual functions has very little
value-add over straight C. Technical people often think that there is a large
difference between C and non-OO C++, but without OO, 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 andadaptable, 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).
[ Top | Bottom | Previous section | Next section ]
[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.
[ Top | Bottom | Previous section | Next section ]
[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++).
[ Top | Bottom | Previous section | Next section ]
[6.11] Is C++ standardized?
[Recently rewrote now that the standard is here (on 5/98). Click here to go to the next FAQ in the "chain" of recent changes.]
Yes.
C++ has been standardized by ANSI (The American National Standards
Organization), BSI (The British Standards Institute), DIN (The German National
Standards Organization), several other national standards bodies, and ISO (The
International Standards Organization). The ISO standard has been finalized and
adopted by unanimous vote Nov 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
includes 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. Final
ratification by two dozen countries is expected by March 1998.
[ Top | Bottom | Previous section | Next section ]
[6.12] Where can I get a copy of the ANSI/ISO C++ standard?
[Recently rewrote now that the standard is here (on 5/98). Click here to go to the next FAQ in the "chain" of recent changes.]
You can get a paper copy of the standard from ANSI. Either send email to
Lynn Barra or send a letter to the
address below, and ask for the latest version of "Draft Proposed American
National Standard for Information Systems Programming Language C++" which
is document number CD14882. It is typically shipped 2-day FedEx within the
continental US. If you want to order via snail mail, send a letter to X3
Secretariat / 1250 Eye Street NW / Suite 200 / Washington, DC 20005 /
202-626-5738.
You cannot get a copy on-line since the ISO does not allow any machine readable
version of the standard to be made available to the public. However if you're
willing to get a slightly out-of-date version, use one of the following URLs:
HTML files:
Cygnus web,
Cygnus FTP.
Postscript and/or Adobe Acrobat:
AT&T,
Warwick (UK).
Finally, you can read the ISO committee's press release
here. This
press release is readable by non-programmers.
[ Top | Bottom | Previous section | Next section ]
E-mail the author
[ C++ FAQ Lite
| Table of contents
| Subject index
| About the author
| ©
| Download your own copy ]
Revised May 27, 1998
Wyszukiwarka
Podobne podstrony:
Big Picture Life After Silbig (6)wiatem rządzą kobiety Big Cyc txtWielka czerwona jedynka (The Big Red One) cz 2the big bang theory s04e15 hdtv xvid fqmA Life In Pictures DocumentaryZizek The Big One Doesn t ExistZłoty warkocz Big CycPiosenka góralska Big Cyc txtAdorabellePlushies Peanut Big Top Type DollChristmas Picture Gap Fill WorksheetpictureLeigh Brackett The Big Jump05 The Big Bright Green Pleasure Mahinewięcej podobnych podstron