INTERVIEW WITH BJARNE STROUSTRUP
Biltek: What ideas were behind the initial design
and implementation of C++? Are these ideas still fresh
and valid?
Bjarne Stroustrup:
The initial idea was to create a language that allowed
programming to be simultaneously elegant and efficient.
That idea is obviously as relevant as ever. The most-recently
hyped languages seem to be neither for large-scale system
building.
The particular approach that I took: to add the Simula
class concept to C and to simultaneously improve the
facilities for static type checking was only the beginning.
More recent improvements, such as templates and exceptions,
have taken C++ programming far closer to my original
ideals than could be done with only its initial feature
set. ISO Standard C++ is a far better approximation
to my ideals than earlier versions. The standard library
provides many examples of the expressive power of Standard
C++. I expect major advances in C++ libraries, both
in the standard libraries and in mo more specialized
libraries. See links from my C++ page.
Importantly, we have also seen major advances in the
techniques used to build systems using C++, such as
generic programming using templates and exception-safe
resource management using constructors and destructors.
Biltek: What was the response from C community
to C++? Was C++ adapted in general or is the majority
of C++ programmers those who learnt C++ in the first
place?
BS: Responses vary.
Some take to C++ as ducks to water, some don't have
a clue either way and follow the style they first encounter
as the one true style, and some react violently against
the "complicated" C++ facilities - typically
missing the programming styles and techniques that those
facilities exist to support.
I suspect that the majority of C++ programmers still
learn C first, but these days this is simply a result
of misguided education policies. C++ is easily a better
first language than C. If for no other reason, than
because it has better type checking and a better standard
library. For a more detailed arguments, see "Learning
Standard C++ as a New Language", which can be downloaded
from my home pages.
Biltek: Do you think C++ has missed the Web?
BS: Or maybe the web
missed C++? In the rush to bring new commercial applications
to market, good scalable system design has often been
ignored. I think that C++ has an expanding role within
the infrastructure of the Web, just as it has within
just about any other large system.
Also, in which language is your browser programmed?
C++, of course, in almost all cases.
Biltek: What are the
most important milestones for C++ in the 80's and 90's?
Do you predict any significant event in this decade?
BS: The most important
events in the 80s must have been the first commercial
release of my original C++ compiler and the publication
of the 1st edition of TC++PL. Those happened on the
same day, October 14 1985.
I consider the most important milestones of the 90s
to be the ISO standard (approved by vote in 1997 and
ratified in 1998) and publication of the 3rd edition
of TC++PL in 1997.
I pick these pairs of events to emphasize the importance
of matching language features with the programming techniques
they exist to support.
My guess is that the key event in the 00s will be
the C++0x revision of the ISO C++ Standard. My prediction
(and hope) is that this will include major new standard
libraries, but no major language changes. I hope to
see standardized support for concurrency, resource management,
pattern matching, and much more. I would probably have
to write a 4th edition of TC++PL to match, but C++0x
is still several years into the future. The C++ community
still needs to catch up with the 1998 standard both
in terms of understanding the facilities offered and
the techniques needed to use Standard C++ well.
Biltek: Java and C# have been promoted for an
alternative to C++. What do you
think about Java and C# both technically and as being
an "alternative"?
BS: C++ has become
the dominant general-purpose programming language. That
implies that any new language must be marketed as an
alternative to C++.
I am no fan of proprietary programming languages.
Nor do I like the idea of closely integrating a programming
language with a proprietary systems architecture. Finally,
I consider the much-hyped "simplicity" of
these languages a result of immaturity and a focus on
novices at the expense of experienced system builders,
and a focus on small programs at the expense of larger
systems.
That said, someone who doesn't share my worries about
vendor lock-in and who doesn't have my needs for scale
and performance can gain some advantages from using
a more constrained language with more direct support
for some common applications.
Biltek: How much has the latest standard penetrated
into real world? (compilers, usage by programmers, etc.)
BS: The recent releases
of C++ implementations are close enough to the standard
for me to use them all for the latest C++ programming
techniques (relying on exceptions and templates). I
also get good portability across different compilers
and systems.
I see many programmers moving to advanced and productive
style of C++ relying on the standard library and other
template-based libraries. Naturally, not everyone has
noticed that the C++ really did change with the standard
and the programming techniques it supports. Many programmers
are still stuck with an antiquated (and less-productive)
view of C++ as "just a better C" or as "a
language for object-oriented programming using class
hierarchies". However, that is changing. As time
passes, more programmers come to master generic programming
techniques, use of exceptions, and multiparadigm programming
(that is, programming using a combination of techniques
drawn from object-oriented programming, generic programming,
etc.).
There are major differences in the degree to which
these techniques have penetrated into different user
communities. New textbooks, such as TC++PL3 and Koenig
& Moo: "Accelerated C++" help here.
Biltek: Do you believe
GUI tools and fancy methodologies will really change
how programming is done?
BS: Definitely. There
is a vast difference between, say, using Borland C++
Builder to craft an interface and to program that interface
directly from an library. However, not every programming
task is suited to GUI tools, and I think that most serious
systems building - C++'s greatest area of strength -
is large unaffected by GUI tools.
Different people mean different things by words such
as "fancy methodologies". I'm not a great
believer in elaborate design methods with supporting
tools. I am, however, a strong supporter of systematic
use of data abstraction, object-oriented programming
and generic programming. Anyone who sits down and just
writes page after page of code without an overall design
and without supporting classes and templates is simply
wasting time and creating unnecessary maintenance problems.
The key to good programs are classes, class hierarchies,
and templates that directly represent design decisions
and keep separate concerns separate in the code. Often,
the best approach to a challenging application is first
to design supporting libraries. Without library support,
just about everything is difficult in C++. With suitable
language support, most things are easy. That is one
reason that much of the effort in the design of C++
has been to improve the facilities for writing libraries.
Biltek: What would
you suggest to students and programmers just beginning
their career in computing/programming?
BS: Don't just study
computing/programming. Gain experience in one or more
other fields so that you have expertise that gives you
an idea of what is worth computing. Also, be sure that
you can express your ideas effectively in writing and
verbally. Unexplained ideas are sterile.
When looking at programs and systems, try to express
concepts as directly as possibly in code - in any language.
Learn several programming languages - knowing only one
language can stifle the imagination and is a prescription
for bigotry. In general, gain acquaintance with a variety
of systems, ideas, and techniques. Your time as a student
is the time when you can explore widely. Afterwards,
in "the real world", you will most likely
have to focus on a few specific problems and have far
less time to explore and experiment.
For more information about C++, see my homepages:
http://www.research.att.com/~bs
Bora Güngören
b.gungoren@ieee.org
|