📄 preface.htm
字号:
<!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:C:\TEMP\TicV2\html\TicV2.rtf
Application Directory:C:\TOOLS\RTF2HTML\
Subject:
Author:Bruce Eckel
Operator:Bruce Eckel
Document Comments:
Version Comments:
Comments:
Keywords:
Translation Date:09/26/2001
Translation Time:08:32:18
Translation Platform:Win32
Number of Output files:19
This File:C:\TEMP\TicV2\html\Preface.htm
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.gif" alt="MindView Inc." BORDER = "0"></a>
<CENTER>
<FONT FACE="Verdana, Tahoma, Arial, Helvetica, Sans" size = "-1">
[ <a href="README.txt">Viewing Hints</a> ]
[ <a href="RevisionHistory.htm">Revision History</a> ]
[ <a href="http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html">Book Home Page</a> ]
[ <a href="http://www.mindview.net/Etc/MailingList.html">Free Newsletter</a> ] <br>
[ <a href="http://www.mindview.net/Seminars">Seminars</a> ]
[ <a href="http://www.mindview.net/CDs">Seminars on CD ROM</a> ]
[ <a href="http://www.mindview.net/Services">Consulting</a> ]
</FONT>
<H2><FONT FACE="Verdana, Tahoma, Arial, Helvetica, Sans">
Thinking in C++, 2nd edition, Volume 2<br>
<small>Revision 4.0</small></FONT></H2>
<H3><FONT FACE="Verdana, Tahoma, Arial, Helvetica, Sans">
by Bruce Eckel & Chuck Allison<br>©2001 MindView, Inc.</FONT></H3>
<FONT FACE="Verdana, Tahoma, Arial, Helvetica, Sans" size = "-1">
[ <a href="FrontMtr.htm">Previous Chapter</a> ]
[ <a href="SimpCont.htm">Short TOC</a> ]
[ <a href="Contents.htm">Table of Contents</a> ]
[ <a href="DocIdx.htm">Index</a> ]
[ <a href="Part1.htm">Next Chapter</a> ]
</FONT>
</CENTER>
</P></DIV><A NAME="_Toc312373768"></A><A NAME="_Toc462305061"></A><A NAME="_Toc519041862"></A><A NAME="Heading1"></A><FONT FACE = "Verdana, Tahoma, Arial, Helvetica, Sans"><H1 ALIGN="LEFT">
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></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++ in 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 which have rearranged my brain to make me
start “thinking in
C++.”</FONT><A NAME="_Toc312373769"></A><A NAME="_Toc462305062"></A><A NAME="_Toc519041863"></A><BR></P></DIV>
<A NAME="Heading2"></A><FONT FACE = "Verdana, Tahoma, Arial, Helvetica, Sans"><H2 ALIGN="LEFT">
What’s new in the second edition</H2></FONT>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">This book is a thorough rewrite of the
first edition to reflect all the changes introduced in C++ by the finalization
of the ANSI/ISO C++ Standard. 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 C
concepts and basic C++ features for those who haven’t been exposed. The CD
ROM bound into the back of the book contains a seminar which is an even gentler
introduction to the C concepts necessary to understand C++ (or Java). It was
created by Chuck Allison for my company (MindView, Inc.) and it’s called
“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 Java languages steer you away from).</FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">So the short answer 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="_Toc462305063"></A><A NAME="_Toc519041864"></A><BR></P></DIV>
<A NAME="Heading3"></A><FONT FACE = "Verdana, Tahoma, Arial, Helvetica, Sans"><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 Standard
Template Library (STL) as well as new complexity in templates. These and other
more advanced topics have been relegated to Volume 2 of this book, including
issues like multiple inheritance, exception handling, design patterns and topics
about building stable systems and debugging
them.</FONT><A NAME="_Toc462305064"></A><A NAME="_Toc519041865"></A><BR></P></DIV>
<A NAME="Heading4"></A><FONT FACE = "Verdana, Tahoma, Arial, Helvetica, Sans"><H3 ALIGN="LEFT">
How to get Volume 2</H3></FONT>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia"><I>Thinking in C++, Volume 2 </I>is
freely downloadable in its entirety from the web site at
<A HREF="http://www.BruceEckel.com">www.BruceEckel.com</A>. The final version of
Volume 2 will be completed and printed in Summer 2002.</FONT><BR></P></DIV>
<DIV ALIGN="LEFT"><P><FONT FACE="Georgia">The web site also contains the source
code for both the books, along with updates and information about CD ROMs,
public seminars, and in-house training, consulting, mentoring and
walk-throughs.</FONT><A NAME="_Toc462305065"></A><A NAME="_Toc519041866"></A><BR></P></DIV>
<A NAME="Heading5"></A><FONT FACE = "Verdana, Tahoma, Arial, Helvetica, Sans"><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 very rapid introduction to C, along with the <I>Thinking in C</I>
seminar-on-CD, but still assuming that you have some kind of programming
experience already. 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="_Toc462305067"></A><A NAME="_Toc519041867"></A><BR></P></DIV>
<A NAME="Heading6"></A><FONT FACE = "Verdana, Tahoma, Arial, Helvetica, Sans"><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 as I expect many of the readers of this book will: 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, where 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> &
<B>free( )</B>, <B>setjmp( )</B> & <B>longjmp( )</B>, and
other “sophisticated” concepts, scuttling away in shame when the
subjects came up in conversation rather than 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 Stroustrup’s self-professed
“expert’s
guide,</FONT><A NAME="fnB1" HREF="#fn1">[1]</A><A NAME="Index1"></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 an 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 live 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 with 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -