基本信息出版社:机械工业出版社
页码:1236 页
出版日期:2009年10月
ISBN:7111282485/9787111282488
条形码:9787111282488
版本:第1版
装帧:平装
开本:16
正文语种:英语
丛书名:经典原版书库
外文书名:Programming:Principles and Practice Using C++
内容简介 为编写实际的应用程序做好准备:无论你是为了进行软件开发还是进行其他领域的工作。《C++程序设计原理与实践(英文版)》假定你的最终目标是学会编写实际有用的程序。以基本概念和基本技术为重点:与传统的C++教材相比,《C++程序设计原理与实践(英文版)》对基本概念和基本技术的介绍更为深入。这会为你编写有用、正确.易维护和有效的代码打下坚实的基础。
用现代C++语言编程:
《C++程序设计原理与实践(英文版)》一方面介绍了通用的程序设计方法(包括面向对象程序设计和泛型程序设计)。另一方面还对软件开发实践中使用最广泛的程序设计语言——C++进行了很好的介绍。《C++程序设计原理与实践(英文版)》从开篇就开始介绍现代C++程序设计技术,并介绍了大量关于如何使用C++标准库来简化程序设计的内容。
适用于初学者以及任何希望学习新知识的人:
《C++程序设计原理与实践(英文版)》主要是为那些从未编写过程序的人编写的。而且已经由超过1000名大学一年级新生试用过。不过,对于专业人员和高年级学生来说,通过观察公认的程序设计大师如何处理编程中的各种问题。同样也会获得新的领悟和指引。
提供广阔的视野:
《C++程序设计原理与实践(英文版)》第一部分非常广泛地介绍了基本程序设计技术,包括基本概念、设计和编程技术、语言特性以及标准库。这些内容教你如何编写具有输入、输出、计算以及简单图形显示等功能的程序。《C++程序设计原理与实践(英文版)》第二部分则介绍了一些更专门性的内容(如文本处理和测试),并提供了大量的参考资料。
作者简介 Bjarne Stroustrup,英国剑桥大学计算机科学博士,C++语言的设计者和最初的实现者,也是《C++程序设计语言》(已由机械工业出版社引进出版)一书的作者。他现在是德州农工大学计算机科学首席教授。1993年,由于在C++领域的重大贡献,Bjame获得TACM的Grace Murray Hopper大奖并成为ACM院士。在进入学术界之前,他曾在AT&T贝尔实验室工作多年。他是ISO C++标准委员会的创始人之一。
编辑推荐 《C++程序设计原理与实践(英文版)》:C++之父Bjarne Stroustrup的最新力作。
目录
Preface
Chapter 0 Notes to the Reader
0.1 The structure of this book
0.1.1 General approach
0.1.2 Drills, exercises, etc.
0.1.3 What comes after this book?
0.2 A philosophy of teaching and learning
0.2.1 The order of topics
0.2.2 Programming and programming language
0.2.3 Portability
0.3 Programming and computer science
0.4 Creativity and problem solving
0.5 Request for feedback
0.6 References
0.7 Biographies
Bjarne Stroustrup
Lawrence "Pete" Pcterscn
Chapter 1 Computers, People, and Programming
1.1 introduction
1.2 Software
1.3 People
1.4 Computer science
1.5 Computers are everywhere
1.5.1 Screens and no screens
1.5.2 Shipping
1.5.3 Telecommunications
1.5.4 Medicine
1.5.5 Information
1.5.6 A verdcal view
1.5.7 So what?
1.6 Ideals for programmers
Part Ⅰ The Basics
Chapter 2 Hello, World!
2.1 Programs
2.2 The dassic first program
2.3 Compilation
2.4 Linking
2.5 Programming environments
Chapter 3 Objects, Types, and Values
3.1 Input
3.2 Variables
3.3 Input and type
3.4 Operations and operators
3.5 Assignment and initialization
3.5.1 An example: detect repeated words
3.6 Composite assignment operators
3.6.1 An example: find repeated words
3.7 Names
3.8 Types and objects
3.9 Type safety
3.9.1 Safe conversions
3.9.2 Unsafe conversions
Chapter 4 Computation
4.1 Computation
4.2 Objectives and tools
4.3 Expressions
4.3.1 Constant expressions
4.3.2 Operators
4.3.3 Conversions
4.4 Statements
4.4.1 Selection
4.4.2 Iteration
4.5 Functions
4.5.1 Why bother with functions?
4.5.2 Function declarations
4.6 Vector
4.6.1 Growing a vector
4.6.2 A numeric example
4.6.3 A text example
4.7 Language features
Chapter 5 Errors
5.1Introduction
5.2Sources of errors
5.3Compile-time errors
5.3.1 Syntax errors
5.3.2 Type errors
5.3.3 Non-errors
5.4Link-time errors
5.5Run-time errors
5.5.1 The caller deals with errors
5.5.2 The callee deals with errors
5.5.3 Error reporting
5.6Exceptions
5.6.1 Bad arguments
5.6.2 Range errors
5.6.3 Bad input
5.6.4 Narrowing errors
5.7Logic errors
5.8Estimation
5.9 Debugging
5.9.1 Practical debug advice
5.10 Pre-and post-conditions
5.10.1 Post-conditions
5.11 Testing
Chapter 6 Writing a Program
6.1 A problem
6.2 Thinking about the problem
6.2.1 Stages of development
6.2.2 Strategy
6.3 Back to the calculator!
6.3.1 First attempt
6.3.2 Tokens
6.3.3 Implementing tokens
6.3.4 Using tokens
6.3.5 Back to the drawing board
6.4 Grammars
6.4.1 A detour: English grammar
6.4.2 Writing a grammar
6.5 Turning a grammar into code
6.5.1 Implementing grammar rules
6.5.2 Expressions
6.5.3 Terms
6.5.4 Primary expressions
6.6 Trying the first version
6.7 Trying the second version
6.8 Token streams
6.8.1 Implementing Token_stream
6.8.2 Reading tokens
6.8.3 Reading numbers
6.9 Program structure
Chapter 7 Completing a Program
7.1 Introduction
7.2 Input and output
7.3 Error handling
7.4 Negative numbers
7.5 Remainder: %
7.6 Cleaning up the code
7.6.1 Symbolic constants
7.6.2 Use of functions
7.6.3 Gode layout
7.6.4 Commenting
7.7 Recovering from errors
7.8 Variables
7.8.1 Variables and definitions
7.8.2 Introducing names
7.8.3 Predefined names
7.8.4 Are we there yet?
……
Part Ⅱ Input and Output
Part Ⅲ Data and Algorithms
Part Ⅳ Broadening the View
Part Ⅴ Appendices
Glossary
Bibliography
Index
……
序言 Programming is the art of expressing solutions to problems so that a computer can execute those solutions. Much of the effort in programming is spent finding and refining solutions. Often, a problem is only fully understood through the process of programming a solution for it.
This book is for someone who has never programmed before but is willing to work hard to learn. It helps you understand the principles and acquire the practical skills of programming using the C++ programming language. My aim is for you to gain sufficient knowledge and experience to perform simple useful programming tasks using the best up-to-date techniques. How long will that take? As part of a first-year university course, you can work through this book in a semester (assuming that you have a workload of four courses of average difficulty). If you work by yourself, don't expect to spend less time than that (maybe 15 hours a week for 14 weeks).
Three months may seem a long time, but there's a lot to learn and you'll be writing your ftrst simple programs after about an hour. Also, all learning is gradual: each chapter introduces new useful concepts and illustrates them with examples inspired by real-world uses. Your ability to express ideas in code - getting a computer to do what you want it to do - gradually and steadily increases as you go along. I never say, "Learn a month's worth of theory and then see if you can use it."
文摘 插图:

The crucial concept here is feedback. We learn from experience and modify our behavior based on what we learn. That's essential for effective software development. For any large project, we don't know everything there is to know about the problem and its solution before we start. We can try out ideas and get feedback by programming, but in the earlier stages of development it is easier (and faster) to get feedback by writing down design ideas, trying out those design ideas, and using scenarios on friends. The best design tool we know of is a blackboard (use a whiteboard instead if you prefer chemical smells over chalk dust). Never design alone if you can avoid it! Don't start coding before you have tried out your ideas by explaining them to someone. Discuss designs and programming techniques with friends, colleagues, potential users, and so on before you head for the keyboard. It is amazing how much you can learn from simply trying to articulate an idea. After all, a program is nothing more than an expression (incode) of some ideas.
Similarly, when you get stuck implementing a program, look up from the keyboard. Think about the problem itself, rather than your incomplete solution. Talk with someone: explain what you want to do and why it doesn't work. It's amazing how often you fred the solution just by carefully explaining the problem to someone. Don't debug (find program errors) alone if you don't have to!
The focus of this book is implementation, and especially programming. We do not teach "problem solving" beyond giving you plenty of examples of problems and their solutions. Much of problem solving is recognizing a known problem and applying a known solution technique. Only when most subproblems are handled this way will you find the time to indulge in exciting and creative "outof-the-box thinking." So, we focus on showing how to express ideas dearly in code.