⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cppfatherletter.html

📁 关于 C++ 的历史无须我来介绍了
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <link rel="stylesheet" href="css/stdlayout.css" type="text/css">
  <link rel="stylesheet" href="css/print.css" type="text/css">
  <meta content="text/html; charset=gb2312" http-equiv="content-type">
  <title>C++爸爸(Bjarne Stroustrup)给C++初学者的信</title>
</head>
<body>
<h3><a href="http://caterpillar.onlyfun.net/GossipCN/index.html">From
Gossip@caterpillar</a></h3>
<h1><a href="CppGossip.html">C++
Gossip:&nbsp;<span class="Topic">C++</span><span class="Topic">爸爸(Bjarne
Stroustrup)给C++初学者的信</span><br>
</a></h1>
<br>
<span style="font-weight: bold;">From: bs@alice.att.com (Bjarne
Stroustrup) </span><br>
Newsgroups: comp.os.msdos.programmer, <br>
comp.sys.ibm.pc.programmer, <br>
comp.lang.c++,comp.lang.c <br>
Subject: Newbie Wants Advice on C-Programming <br>
Summary: general comments on learning C++ <br>
Date: 29 Dec 92 17:52:53 GMT <br>
Organization: AT&amp;T Bell Laboratories, Murray Hill NJ <br>
Lines: 288 <br>
<br>
<div style="text-align: justify;">There has - under various headings -
been several related discussions about the proper way to learn C++,
C++'s relation to C, C++'s relation to Smalltalk, the difference (or
not) between data abstraction and object-oriented programming, etc.<br>
</div>
<br style="font-weight: bold;">
<span style="font-weight: bold;">虽然标题各不相同,但已经有过好几个与学习C++相关的讨论话题,像是C++与C的
关联、C++与Smalltalk的关联、资料抽象化与物件导向程式设计之间的差异(或者不同点)等等。 </span><br>
<br>
<div style="text-align: justify;">I think the practical concern
underlying many of these discussions is: <br>
Given that I don't have much time to learn new techniques and concepts,
how do I start using C++ effectively?<br>
</div>
<br style="font-weight: bold;">
<span style="font-weight: bold;">我想在这许多讨论中实际上关心的是: </span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">如果我没有太多的时间来学习新的技术或观念,初学C++的话怎么样才比较有效率?
</span><br>
<br>
<div style="text-align: justify;">It is clear that to use C++ ``best''
in an arbitrary situation you need a deep understanding of many
concepts and techniques, but that can only be achieved through years of
study and experiments. It is little help to tell a novice (a novice
with C++, typically not a novice with programming in general), first to
gain a thorough understanding of C, Smalltalk, CLOS, Pascal, ML,
Eiffel, assembler, capability based systems, OODMBSs, program
verification techniques, etc., and then apply the lessons learned to
C++ on his or her next project. All of those topics are worthy of study
and would - in the long run - help, but practical programmers (and
students) cannot take years off from whatever they are doing for a
comprehensive study of programming languages and techniques.<br>
</div>
<br>
<span style="font-weight: bold;">很显然的,要让C++在任意的场合中都能好好的发挥,对许多的观念与技术都要有深刻
的了解,但这是要长年的研究与经验才能够得到的。所以以下的说词对初学者(一般来说,基本上一个C++初学者并不一定是程式设计上的初学者)是没什么用
的:“首先要对C、Smalltalk、CLOS、Pascal、ML、Eiffel、assembler等等有个彻底的认识,然后将在C++课程上所学
到的东西,应用至下一个专案中。”上面所提及的几个主题都值得研究,而且最后一定会有帮助,但是实务性为主的程式设计人员(与学生)没办法抛开目前目前手
上的工作,然后花上好几年的时间来彻底研究这些程式语言与技术。 </span><br>
<br>
<div style="text-align: justify;">On the other hand, most novices
understand that ``a little knowledge is a dangerous thing'' and would
like some assurance that the little they can afford time to learn
before/while starting their next project will be of help and not a
distraction or a hinderance to the success of that project. They would
also like to be confident that the little new they can absorb
immediately can be part of a path that can lead to the more
comprehensive understanding actually desired rather than an isolated
skill leading nowhere further.<br>
</div>
<br>
<span style="font-weight: bold;">另一方面,大部份的初学者都了解到“一知半解是很危险的”,他们希望能够保证在开始
下一个(或正在进行的)专案中,目前所付出的这些时间最好是有帮助的,而不是一种困扰或妨碍。他们也需要确定所学到的这些新知,将来是可以成为广泛应用的
技术,而不只是个将来不再使用的封闭技巧。</span><br>
<br>
<div style="text-align: justify;">Naturally, more than one approach can
fulfill these criteria and exactly which to choose depends on the
individual's background, immediate needs, and the time available. I
think many educators, trainers, and posters to the net underestimate
the imporatance of this: after all, it appears so much more cost
effective - and easier - to ``educate'' people in large batches rather
than bothering with individuals.<br>
</div>
<br style="font-weight: bold;">
<span style="font-weight: bold;">自然的,有很多方法可以符合这些考量,至于选择哪一种方法必须依据个人所拥有的背
景、立即性需求以及可运用的时间来决定。我想许多教育训练人员以及海报都低估了这些元素的重要性:毕竟,这要花费许多心力才能看出效果:毕竟批次的教导人
员总是比为了个案而烦恼来得轻松多了。 </span><br>
<br>
Consider a few common questions: <br>
I don't know C or C++, should I learn C first? <br>
I want to do OOP, should I learn Smalltalk before C++? <br>
Should I start using C++ as an OOPL or as a better C? <br>
How long does it take to learn C++?<br>
<br>
<span style="font-weight: bold;">想想几个常见的问题: </span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">我不懂C或C++,要不要先学C呢? </span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">我要进行OOP(物件导向程式设计),需不需要在学C++之前先学
Smalltalk? </span><br style="font-weight: bold;">
<span style="font-weight: bold;">我应该将C++当作OOPL(物件导向程式设计语言)吗?或只是一个"更好的C"?
</span><br style="font-weight: bold;">
<span style="font-weight: bold;">学C++要花多久的时间? </span><br>
<br>
<div style="text-align: justify;">I don't claim to have the only
answers ``the (only) right answers'' to these questions. As I said the
``right'' answer depends on the circumstances. Most C++ textbook
writers, teachers, and programmers have their own answers. For example,
I seem to remember that the C++ FAQ discusses these questions. My
answers are based on years of programming in C++ and other languages,
teaching short C++ design and programming courses (mainly to
professional programmers), consulting about to introduction of and use
of C++, discussing C++, and generally thinking about programming,
design, and C++.<br>
</div>
<br>
<span style="font-weight: bold;">我不想宣称只有唯一的答案,"对这些问题唯一且正确的的答案"。要我说的话,正确的
答案要看情况。大部份C++书本的作者、老师与程式设计人员都有他们自己的答案,例如,我依稀记得C++
FAQ讨论过这些问题。我的答案则是基于多年来的C++程式设计经验、对其它的语言的了解、短期的C++设计教学与程式设计课程(主要是对专业的程式设计
人员)、C++的使用资询与简介、C++的讨论、以及常常地想着写程式、设计与C++。 </span><br>
<br>
I don't know C or C++, should I learn C first?<br>
<br style="font-weight: bold;">
<span style="font-weight: bold;">我不懂C或C++,要不要先学C? </span><br>
<br>
<div style="text-align: justify;">No. Learn C++ first. The C subset of
C++ is easier to learn for C/C++ novices and easier to use than C
itself. The reason is that C++ provides better guarantees than C
(stronger type checking). In addition, C++ provides many minor
features, such as the `new' operator, that are notationally more
convenient and less error-prone than their C alternatives. Thus, if you
plan to learn C and C++ (or just C++) you shouldn't take the detour
through C. To use C well, you need to know tricks and techniques that
aren't anywhere near as important or common in C++ as they are in C.
Good C textbooks tends (reasonably enough) to emphasize the techniques
that you will need for completing major projects in C. Good C++
textbooks, on the other hand, emphasizes techniques and features that
lead to the use of C++ for data abstraction and object-oriented
programming. Knowing the C++ constructs, their (lower-level) C
alternatives are trivially learned (if necessary).<br>
</div>
<br>
<span style="font-weight: bold;">不!先学C++。C++的C子集对于C/C++初学者来说是比较容易,而使用C本身
确实比较容易,原因在于C++提供了比C(强型别检查)更多安全性。除此之外,C++还提供了许多小特性,像是"new"运算子,这明显的比C中相对应的
功能更方便且更能避免错误,因此,如果您想要学C与C++(或只要C++),您不用迂回的从C开始学起,要把C用的好,您会需要知道一些技巧与技术,而这
些在C++中并不会像在C中一样的重要与常见,好的C教科书会特意强调完成一个使用C的专案时所需要的技术(这相当合理),然而另一方面,好的C++教科
书则强调一些技术与特性,C++的这些技术与特性会将重点放在资料抽象化与物件导向程式设计。了解了C++的建构,在(低层次的)C的相对应部份自然也会
学起来了(如果有需要的话)。 </span><br>
<br>
To show my inclinations:<br>
To learn C use:<br>
<br>
<span style="font-weight: bold;">我个人的倾向则是: </span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">要学C的话,使用下面这一本书作为主要教科书: </span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">Kernighan and Ritchie: </span><br
 style="font-weight: bold;">
<span style="font-weight: bold;">The C programming Language (2nd
edition) </span><br style="font-weight: bold;">
<span style="font-weight: bold;">Prentice Hall, 1988. </span><br>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -