Accelerated C++中文版

Andrew Koenig, Barbara E.Moo

出版时间

2003-12-01

ISBN

9787508318196

评分

★★★★★
书籍介绍
这本书最鲜明的主张,是颠覆了传统编程教材「先讲语法、再谈应用」的循序渐进套路。它从第一堂课起就让你用标准库写真实程序,把vector、string、算法库当作理所当然的工具,而非高不可攀的进阶内容。许多读者因此感受到「走上了C++的正途」——不是被各种底层细节拖入泥沼,而是带着现代、实用的视角进入这门语言。当然,这种「倒过来」的讲法并非人人适应:无基础的读者会感到吃力,需要咬牙坚持。它适合愿意接受一种高效但略显陡峭路径的学习者,无论是初入门的新手,还是想重新梳理C++体系的老手,都能从中获得新的体悟。
AI导读
核心看点
  • 从实用概念入手,快速编写真实程序
  • 结合语言特性与标准库,避免低效学习
  • 斯坦福教学经验验证,独特的教学方法
读者共识
  • 被公认为C++最佳入门书籍之一
  • 例子现代化且实用,非枯燥语法堆砌
  • 虽非学习终点,但作为起点堪称经典
精彩摘录
  • "The int type is sufficient for rows because the number of rows depends only on the value of pad, which we control. Every C++ implementation is required to allow every int variable to take on values up to at least 32767, which is plenty. Nevertheless, whenever we define a variable that contains the s"
  • "C++ offers a way of saying that a particular name should always be interpreted as coming from a particular namespace. For example, by writing"
  • "we can say that we intend to use the name cout to mean std::cout exclusively, and that we do not intend to define anything named cout ourselves. Once we have done so, we can say cout instead of std::cout."
  • "Logically enough, such a declaration is called a using-declaration. The name that it mentions behaves similarly to other names. For example, if a using-declaration appears within braces, the name that it defines has its given meaning from where it is defined to the closing brace."
  • "By the same token, we do not bother to give an initial value to x, because the first thing we do with it is read into it, thereby obliterating any value we might have given it."
  • "Our goal is to write the final grade with three significant digits, which we do by using setprecision. Like endl, setprecision is a manipulator. It manipulates the stream by causing subsequent output on that stream to appear with the given number of significant digits. By writing setprecision(3), we"
  • "It is usually not worth the bother to use const references for parameters of simple built-in types, such as int or double. Such small objects are usually fast enough to copy that there's little, if any, overhead in passing them by value."
  • "Whenever we write a try statement, we must think carefully about side effects and when they occur. We must assume that anything between try and catch might throw an exception. If it does so, then any computation that would have been executed after the exception is skipped. What is important to reali"
下载
收藏