📄 preface.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<!--
This document was converted from RTF source:
By rtftohtml 4.19
See http://www.sunpack.com/RTF
Filename:TIC2Vone.rtf
Application Directory:C:\TOOLS\RTF2HTML\
Subject:
Author:Bruce Eckel
Operator:Bruce Eckel
Document Comments:
Version Comments:
Comments:
Keywords:
Translation Date:09/27/2001
Translation Time:05:25:21
Translation Platform:Win32
Number of Output files:22
This File:Preface.html
SplitDepth=1
SkipNavPanel=1
SkipLeadingToc=1
SkipTrailingToc=1
GenContents=1
GenFrames=1
GenIndex=1
-->
<HEAD lang="en"><META http-equiv="Content-Type" content="text/html">
<TITLE> Preface</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF"><DIV ALIGN="CENTER">
<a href="http://www.MindView.net">
<img src="mindview-head.gif" alt="MindView Inc." BORDER = "0"></a>
<CENTER>
<FONT FACE="Verdana" size = "-1">
[ <a href="README-HTML.txt">Viewing Hints</a> ]
[ <a href="http://www.mindview.net/CPPServices/SolutionGuide.html">Exercise Solutions</a> ]
[ <a href="http://www.mindview.net/ThinkingInCPP2e.html">Volume 2</a> ]
[ <a href="http://www.mindview.net/MailingList.html">Free Newsletter</a> ] <br>
[ <a href="http://www.mindview.net/CPPServices/#PublicSeminars">Seminars</a> ]
[ <a href="http://www.mindview.net/CPPServices/#SeminarsOnCD">Seminars on CD ROM</a> ]
[ <a href="http://www.mindview.net/CPPServices/#ConsultingServices">Consulting</a> ]
</FONT>
<H2><FONT FACE="Verdana">
Thinking in C++, 2nd ed. Volume 1</FONT></H2></FONT>
<H3><FONT FACE="Verdana">©2000 by Bruce Eckel</FONT></H3></FONT>
<FONT FACE="Verdana" size = "-1">
[ <a href="Frontmatter.html">Previous Chapter</a> ]
[ <a href="Contents.html">Table of Contents</a> ]
[ <a href="DocIndex.html">Index</a> ]
[ <a href="Chapter01.html">Next Chapter</a> ]
</FONT>
</CENTER>
</P></DIV><FONT FACE = "Verdana"><H1 ALIGN="LEFT">
<A NAME="_Toc472654661"></A>Preface</H1></FONT>
<DIV ALIGN="LEFT"><P><FONT FACE="Verdana" SIZE=4>Like any human language, C++
provides a way to express concepts. If successful, this medium of expression
will be significantly easier and more flexible than the alternatives as problems
grow larger and more complex.</FONT><BR><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">You can’t just look at C++ as a
collection of features; some of the features make no sense in isolation. You can
only use the sum of the parts if you are thinking about <I>design</I>, not
simply coding. And to understand C++ this way, you must understand the problems
with C and with programming in general. This book discusses programming
problems, why they are problems, and the approach C++ has taken to solve such
problems. Thus, the set of features I explain in each chapter will be based on
the way that I see a particular type of problem being solved with the language.
In this way I hope to move you, a little at a time, from understanding C to the
point where the C++ mindset becomes your native tongue.</FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">Throughout, I’ll be taking the
attitude that you want to build a model in your head that allows you to
understand the language all the way down to the bare metal; if you encounter a
puzzle, you’ll be able to feed it to your model and deduce the answer. I
will try to convey to you the insights that have rearranged my brain to make me
start “thinking in
C++.”</FONT><A NAME="_Toc462979666"></A><A NAME="_Toc312373769"></A><A NAME="_Toc472654662"></A><BR></P></DIV>
<A NAME="Heading2"></A><FONT FACE = "Verdana"><H2 ALIGN="LEFT">
What’s new in the second
edition<BR><A NAME="Index1"></A><A NAME="Index2"></A></H2></FONT>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">This book is a thorough rewrite of the
first edition to reflect all of the changes introduced in C++ by the
finalization of the C++ Standard, and also to reflect what I’ve learned
since writing the first edition. The entire text present in the first edition
has been examined and rewritten, sometimes removing old examples, often changing
existing examples and adding new ones, and adding many new exercises.
Significant rearrangement and re-ordering of the material took place to reflect
the availability of better tools and my improved understanding of how people
learn C++. A new chapter was added which is a rapid introduction to the
<A NAME="Index3"></A>C concepts and basic C++ features for those who don’t
have the C background to tackle the rest of the book. The
<A NAME="Index4"></A>CD ROM bound into the back of the book contains a seminar
that is an even gentler introduction to the C concepts necessary to understand
C++ (or Java). It was created by <A NAME="Index5"></A>Chuck Allison for my
company (MindView, Inc.), and it’s called
“<A NAME="Index6"></A>Thinking in C: Foundations for Java and C++.”
It introduces you to the aspects of C that are necessary for you to move on to
C++ or Java, leaving out the nasty bits that C programmers must deal with on a
day-to-day basis but that the C++ and <A NAME="Index7"></A>Java languages steer
you away from (or even eliminate, in the case of Java).</FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">So the short answer to the question
“what’s different in the 2<SUP>nd</SUP> edition?” is: what
isn’t brand new has been rewritten, sometimes to the point where you
wouldn’t recognize the original examples and
material.</FONT><A NAME="_Toc462979667"></A><A NAME="_Toc472654663"></A><BR></P></DIV>
<A NAME="Heading3"></A><FONT FACE = "Verdana"><H3 ALIGN="LEFT">
What’s in Volume 2 of this book</H3></FONT>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">The completion of the C++ Standard also
added a number of important new libraries, such as <B>string</B> and the
containers and algorithms in the Standard C++ Library, as well as new complexity
in templates. These and other more advanced topics have been relegated to
<A NAME="Index8"></A><A NAME="Index9"></A>Volume 2 of this book, including
issues such as multiple inheritance, exception handling, design patterns, and
topics about building and debugging stable
systems.</FONT><A NAME="_Toc462979668"></A><A NAME="_Toc472654664"></A><BR></P></DIV>
<A NAME="Heading4"></A><FONT FACE = "Verdana"><H3 ALIGN="LEFT">
How to get Volume 2</H3></FONT>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">Just like the book you currently hold,
<I>Thinking in C++, Volume 2 </I>is downloadable in its entirety from my Web
site at <I>www.BruceEckel.com</I>. You can find information on the Web site
about the expected print date of Volume 2.</FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">The Web site also contains the source
code for both of the books, along with updates and information about other
seminars-on-CD ROM that MindView, Inc. offers, public seminars, and in-house
training, consulting, mentoring, and
walkthroughs.</FONT><A NAME="_Toc462979669"></A><A NAME="_Toc472654665"></A><BR></P></DIV>
<A NAME="Heading5"></A><FONT FACE = "Verdana"><H2 ALIGN="LEFT">
Prerequisites</H2></FONT>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">In the first edition of this book, I
decided to assume that someone else had taught you C and that you have at least
a reading level of comfort with it. My primary focus was on simplifying what I
found difficult: the C++ language. In this edition I have added a chapter that
is a rapid introduction to C, along with the <I>Thinking in C</I> seminar-on-CD,
but I am still assuming that you already have some kind of programming
experience. In addition, just as you learn many new words intuitively by seeing
them in context in a novel, it’s possible to learn a great deal about C
from the context in which it is used in the rest of the
book.</FONT><A NAME="_Toc312373770"></A><A NAME="_Toc462979670"></A><A NAME="_Toc472654666"></A><BR></P></DIV>
<A NAME="Heading6"></A><FONT FACE = "Verdana"><H2 ALIGN="LEFT">
Learning C++</H2></FONT>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">I clawed my way into C++ from exactly the
same position I expect many of the readers of this book are in: as a programmer
with a very no-nonsense, nuts-and-bolts attitude about programming. Worse, my
background and experience was in hardware-level embedded programming, in which C
has often been considered a high-level language and an inefficient overkill for
pushing bits around. I discovered later that I wasn’t even a very good C
programmer, hiding my ignorance of structures, <B>malloc( )</B> and
<B>free( )</B>, <B>setjmp( )</B> and <B>longjmp( )</B>, and other
“sophisticated” concepts, scuttling away in shame when the subjects
came up in conversation instead of reaching out for new
knowledge.</FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">When I began my struggle to understand
C++, the only decent book was <A NAME="Index10"></A>Bjarne Stroustrup’s
self-professed “expert’s
guide,</FONT><A NAME="fnB1" HREF="#fn1">[1]</A><A NAME="Index11"></A><FONT FACE="Georgia">”
so I was left to simplify the basic concepts on my own. This resulted in my
first C++ book,</FONT><A NAME="fnB2" HREF="#fn2">[2]</A><FONT FACE="Georgia">
which was essentially a brain dump of my experience. That was designed as a
reader’s guide to bring programmers into C and C++ at the same time. Both
editions</FONT><A NAME="fnB3" HREF="#fn3">[3]</A><FONT FACE="Georgia"> of the
book garnered enthusiastic response.</FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">At about the same time that <I>Using
C++</I> came out, I began teaching the language in seminars and presentations.
Teaching C++ (and later, Java) became my profession; I’ve seen nodding
heads, blank faces, and puzzled expressions in audiences all over the world
since 1989. As I began giving in-house training to smaller groups of people, I
discovered something during the exercises. Even those people who were smiling
and nodding were confused about many issues. I found out, by creating and
chairing the C++ and Java tracks at the Software Development Conference for many
years, that I and other speakers tended to give the typical audience too many
topics, too fast. So eventually, through both variety in the audience level and
the way that I presented the material, I would end up losing some portion of the
audience. Maybe it’s asking too much, but because I am one of those people
resistant to traditional lecturing (and for most people, I believe, such
resistance results from boredom), I wanted to try to keep everyone up to
speed.</FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">For a time, I was creating a number of
different presentations in fairly short order. Thus, I ended up learning by
experiment and iteration (a technique that also works well in C++ program
design). Eventually I developed a course using everything I had learned from my
teaching experience. It tackles the learning problem in discrete, easy-to-digest
steps and for a hands-on seminar (the ideal learning situation) there are
exercises following each of the presentations. You can find out about my
<A NAME="Index12"></A><A NAME="Index13"></A>public seminars at
<I>www.BruceEckel.com</I>, and you can also learn about the seminars that
I’ve turned into CD ROMs.</FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">The first edition of this book developed
over the course of two years, and the material in this book has been road-tested
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -