Effective C++(影印版)
[绝版]基本信息
编辑推荐
荣获1992年 效能大奖 这本书相当于是C++的兵法,要想用好C++就必须知道这本书,强烈推荐!汇总了使用C++的50个方针,指导你更好地进行编程和设计,并针对每个方针给出了具体的例子。
内容简介回到顶部↑
本书汇总了使用C++的50个方针,指导你更好地进行编程和设计,并针对每个方针给出了具体的例子。本书的主要内容有:针对面向对象设计、类设计以及继承的正确用法所给出的方针;对标准C++库的讨论,包括如何使用像string和vector这样的标准模板库来编写优秀的程序;类内部的常量初始化、名字空间和成员模板等;编程高手的督智建议。本书的作者斯科特·迈耶斯是C++方面的公认权威,本书第一版曾创下发行量100000册的成绩,并被翻译成四种语言,其受欢迎程度不言自明。
作译者回到顶部↑
本书提供作译者介绍
Scott Meyers是C++方面的公认权威,他为全世界的客户提供咨询服务,并且是《C++ Report》的专栏作家。他是全球技术会议的有号召力的发言人,也是《More Effective C++》和《Effective C++ CD》两部作品的作者。他于1993年在布朗大学获得计算机科学系的哲学博士学位。
.. << 查看详细
.. << 查看详细
目录回到顶部↑
preface
acknowledgements
introduction
shifting from c to c++
items 1:prefer const and inline to #define
items 2:prefer iostream to stdio.h
items 3:prefer new and delete to malloc and free
items 4:prefer c++-style comments
memory management
items 5:use the same form in corresponding uses of new and delete
items 6:use delete on pointer members in destructors
items 7:be prepared for out-of-memory conditions
items 8:adhere to convention when writing operator new and operator delete
items 9:avoid hiding the "normal" form of new
items 10:write operator delete if you write operator new
acknowledgements
introduction
shifting from c to c++
items 1:prefer const and inline to #define
items 2:prefer iostream to stdio.h
items 3:prefer new and delete to malloc and free
items 4:prefer c++-style comments
memory management
items 5:use the same form in corresponding uses of new and delete
items 6:use delete on pointer members in destructors
items 7:be prepared for out-of-memory conditions
items 8:adhere to convention when writing operator new and operator delete
items 9:avoid hiding the "normal" form of new
items 10:write operator delete if you write operator new
前言回到顶部↑
Preface
This book is a direct outgrowth of my experiences teaching C++ to professional programmers. I've found that most students, after a week of intensive instruction, feel comfortable with the basic constructs of the language, but they tend to be less sanguine about their abfiity to put the constructs together in an effective manner. Thus began my attempt to formulate short, specific, easy-to-remember guidelines for effective software development in C++: a summary of the things
experienced C++ programmers almost always do or almost always avoid doing.
I was originally interested in rules that could be enforced by some kind of lint-like program. To that end, I led research into the development of tools to examine C++ source code for violations of userspecified conditions? Unfortunately, the research ended before a complete prototype could be developed. Fortunately, several commercial C++-checklng products are now avafiable.
Though my initial interest was in programming rules that could be automatically enforced, I soon realized the limitations of that approach. The majority of guidelines used by good C++ programmers are too difficult to formalize or have too many important exceptions to be
blindly enforced by a program. I was thus led to the notion of something less precise than a computer program, but still more focused and to-the-point than a general C++ textbook. The result you now hold in your hands: a book containing 50 specific suggestions on how to improve your C++ programs and designs.
In this book, you'll find advice on what you should do, and why, and what you should not do, and why not. Fundamentally, of course, the whys are more important than the whats, but it's a lot more convenient to refer to a list of guidelines than to memorize a textbook or
two.
Unlike most books on C++, my presentation here is not organized around particular language features. That is, I don't talk about constmctors in one place, about virtual functions in another, about inheritance in a third, etc. Instead, each discussion in the book is
tailored to the guideline it accompanies, and my coverage of the various aspects of a particular language feature may be dispersed throughout the book.
The advantage of this approach is that it better reflects the complexity of the software systems for which C++ is often chosen, systems in which understanding individual language features is not enough. For example, experienced C++ developers know that understanding inline functions and understanding virtual destructors does not necessarily mean you understand inline virtual destructors. Such battle-scarred developers recognize that comprehending the interactions between the features in C++ is of the greatest possible importance In using the language effectively. The organization of this book reflects that fundamental truth.
The disadvantage of this design is that you may have to look In more than one place to find everything I have to say about a particular C++ construct. To minimize the inconvenience of this approach, I have sprinkled cross-references liberally throughout the text, and a comprehensive index is provided at the end of the book.
In preparing this second edition, my ambition to improve the book has been tempered by fear. Tens of thousands of programmers embraced the first edition of Effective C++, and I didn't want to destroy whatever characteristics attracted them to it. However, in the six years since I wrote the book, C++ has changed, the C++ library has changed (see Item 49), my understanding of C++ has changed, and accepted usage of C++ has changed. That's a lot of change, and it was important to me that the technical material in Effective C++ be revised to reflect those changes. I'd done what I could by updating individual pages between printings, but books and software are frighteningly similar -- there comes a time when localized enhancements fall to suffice, and the
only recourse is a system-wide rewrite. This book is the result of that rewrite: Effective C++, Version 2.0. Those familiar with the first edition may be interested to know that every Item in the book has been reworked. I believe the overall structure of the book remains sound, however, so little there has changed. Of the 50 original Items, I retained 48, though I tinkered with the wordlng of a few Item titles (in addition to revising the accompanying discussions). The retired Items (i.e., those replaced with completely new material) are numbers 32 and 49, though much of the information that used to be in Item 32 somehow found its way into the revamped Item 1. I swapped the order of Items 41 and 42, because that made it easier to present the revised material they contain. Finally, I reversed the direction of my inheritance arrows. They now follow the almost universal convention of pointing from derived classes to base classes.
This is the same convention I followed in my 1996 book, More Effective C++, an overview of which you can find on pages 237-238 of this volume.
The set of guidelines in this book is far from exhaustive, but comingup with good rules -- ones that are applicable to almost all applications almost all the time -- is harder than it looks. Perhaps you know of additional guidelines, of more ways in which to program effectively
in C++. If so, I would be delighted to hear about them.
On the other hand, you may feel that some of the Items in this book are inappropriate as general advice; that there is a better way to accomplish a task examined in the book; or that one or more of the technical discussions is unclear, incomplete, or misleading. I encourage you to let me know about these things, too.
Donald Knuth has a long history of offering a small reward to people who notify him of errors in his books. The quest for a perfect book is laudable in any case, but in view of the number of bug-ridden C++ books that have been rushed to market, I feel especially strongly compelled to follow Knuth's example. Therefore, for each error in this book that is reported to me -- be it technical, grammatical, typographical, or otherwise -- I will, in future printings, gladly add to the acknowl edgments the name of the first person to bring that error to my atten-
tion.
This book is a direct outgrowth of my experiences teaching C++ to professional programmers. I've found that most students, after a week of intensive instruction, feel comfortable with the basic constructs of the language, but they tend to be less sanguine about their abfiity to put the constructs together in an effective manner. Thus began my attempt to formulate short, specific, easy-to-remember guidelines for effective software development in C++: a summary of the things
experienced C++ programmers almost always do or almost always avoid doing.
I was originally interested in rules that could be enforced by some kind of lint-like program. To that end, I led research into the development of tools to examine C++ source code for violations of userspecified conditions? Unfortunately, the research ended before a complete prototype could be developed. Fortunately, several commercial C++-checklng products are now avafiable.
Though my initial interest was in programming rules that could be automatically enforced, I soon realized the limitations of that approach. The majority of guidelines used by good C++ programmers are too difficult to formalize or have too many important exceptions to be
blindly enforced by a program. I was thus led to the notion of something less precise than a computer program, but still more focused and to-the-point than a general C++ textbook. The result you now hold in your hands: a book containing 50 specific suggestions on how to improve your C++ programs and designs.
In this book, you'll find advice on what you should do, and why, and what you should not do, and why not. Fundamentally, of course, the whys are more important than the whats, but it's a lot more convenient to refer to a list of guidelines than to memorize a textbook or
two.
Unlike most books on C++, my presentation here is not organized around particular language features. That is, I don't talk about constmctors in one place, about virtual functions in another, about inheritance in a third, etc. Instead, each discussion in the book is
tailored to the guideline it accompanies, and my coverage of the various aspects of a particular language feature may be dispersed throughout the book.
The advantage of this approach is that it better reflects the complexity of the software systems for which C++ is often chosen, systems in which understanding individual language features is not enough. For example, experienced C++ developers know that understanding inline functions and understanding virtual destructors does not necessarily mean you understand inline virtual destructors. Such battle-scarred developers recognize that comprehending the interactions between the features in C++ is of the greatest possible importance In using the language effectively. The organization of this book reflects that fundamental truth.
The disadvantage of this design is that you may have to look In more than one place to find everything I have to say about a particular C++ construct. To minimize the inconvenience of this approach, I have sprinkled cross-references liberally throughout the text, and a comprehensive index is provided at the end of the book.
In preparing this second edition, my ambition to improve the book has been tempered by fear. Tens of thousands of programmers embraced the first edition of Effective C++, and I didn't want to destroy whatever characteristics attracted them to it. However, in the six years since I wrote the book, C++ has changed, the C++ library has changed (see Item 49), my understanding of C++ has changed, and accepted usage of C++ has changed. That's a lot of change, and it was important to me that the technical material in Effective C++ be revised to reflect those changes. I'd done what I could by updating individual pages between printings, but books and software are frighteningly similar -- there comes a time when localized enhancements fall to suffice, and the
only recourse is a system-wide rewrite. This book is the result of that rewrite: Effective C++, Version 2.0. Those familiar with the first edition may be interested to know that every Item in the book has been reworked. I believe the overall structure of the book remains sound, however, so little there has changed. Of the 50 original Items, I retained 48, though I tinkered with the wordlng of a few Item titles (in addition to revising the accompanying discussions). The retired Items (i.e., those replaced with completely new material) are numbers 32 and 49, though much of the information that used to be in Item 32 somehow found its way into the revamped Item 1. I swapped the order of Items 41 and 42, because that made it easier to present the revised material they contain. Finally, I reversed the direction of my inheritance arrows. They now follow the almost universal convention of pointing from derived classes to base classes.
This is the same convention I followed in my 1996 book, More Effective C++, an overview of which you can find on pages 237-238 of this volume.
The set of guidelines in this book is far from exhaustive, but comingup with good rules -- ones that are applicable to almost all applications almost all the time -- is harder than it looks. Perhaps you know of additional guidelines, of more ways in which to program effectively
in C++. If so, I would be delighted to hear about them.
On the other hand, you may feel that some of the Items in this book are inappropriate as general advice; that there is a better way to accomplish a task examined in the book; or that one or more of the technical discussions is unclear, incomplete, or misleading. I encourage you to let me know about these things, too.
Donald Knuth has a long history of offering a small reward to people who notify him of errors in his books. The quest for a perfect book is laudable in any case, but in view of the number of bug-ridden C++ books that have been rushed to market, I feel especially strongly compelled to follow Knuth's example. Therefore, for each error in this book that is reported to me -- be it technical, grammatical, typographical, or otherwise -- I will, in future printings, gladly add to the acknowl edgments the name of the first person to bring that error to my atten-
tion.
相关资源回到顶部↑
· 【推荐】众多高校学子口口相传,他们共同的选择--华清远见嵌入式学院(嵌入式Linux就业课程、3G手机开发就业课程,通过入学测试即签100%就业协议,4个月集中实训,世界500强企业成功就业保障!!!)· 【亚嵌教育 嵌入式培训专家】(嵌入式培训,嵌入式Linux培训,ARM培训,Linux培训,3G培训,Android培训,WINCE培训,DSP培训,FPGA培训,嵌入式就业培训)
· 程序员的7种武器(正则表达式、编程语言、数据库、算法、软件调试、开发环境)
· C/C++ 经典著作(《C专家编程》《C++ Templates中文版》《C和指针 》《C陷阱与缺陷》《C++沉思录》)
评论交流
共有10人开贴评论 10人参与评论 10人参与打分 查看
评价等级:







发表于:2007-5-27 16:11:00
effective STL 影印版
http://www.china-pub.com/computers/common/info.asp?id=12314
effective C++ second edition 影印版
http://www.china-pub.com/computers/common/info.asp?id=12315
more exceptional c++ 中文版
http://www.china-pub.com/computers/common/info.asp?id=7487
The C++ Standard Library A tutorial and reference
http://www.china-pub.com/computers/common/info.asp?id=7645
Programming Windows with MFC 2nd 影印版
http://www.china-pub.com/computers/common/info.asp?id=3804
Data Structures with C++
http://www.china-pub.com/computers/common/info.asp?id=1903
computer networks:
http://www.china-pub.com/computers/common/info.asp?id=977
MFC programming with Visual C++ 6 unleashed
http://www.china-pub.com/computers/common/info.asp?id=257
Visual C++实现MPEG/JPEG编解码技术
http://www.china-pub.com/computers/common/info.asp?id=8348
Red Hat Linux 7.2 Unleashed
http://www.china-pub.com/computers/common/info.asp?id=6499
The C++ programming language (special edition)
http://www.china-pub.com/computers/common/info.asp?id=3311
C++程序设计语言题解
http://www.china-pub.com/computers/common/info.asp?id=8224
C++ Gotchas Avoiding common problems in coding and design
http://www.china-pub.com/computers/common/info.asp?id=12299
Modern C++ design
http://www.china-pub.com/computers/common/info.asp?id=12302
Ruminations on C++
http://www.china-pub.com/computers/common/info.asp?id=8149
Linux内核2.4版源代码分析大全
http://www.china-pub.com/computers/common/info.asp?id=4359
UML面向对象设计基础
http://www.china-pub.com/computers/common/info.asp?id=10374
刚搬家,发现有许多以前买的书现在已经不用了。现低价转让,上海可当面交易。
书基本上都很新。
MSN: ee96liu@hotmail.com
http://www.china-pub.com/computers/common/info.asp?id=12314
effective C++ second edition 影印版
http://www.china-pub.com/computers/common/info.asp?id=12315
more exceptional c++ 中文版
http://www.china-pub.com/computers/common/info.asp?id=7487
The C++ Standard Library A tutorial and reference
http://www.china-pub.com/computers/common/info.asp?id=7645
Programming Windows with MFC 2nd 影印版
http://www.china-pub.com/computers/common/info.asp?id=3804
Data Structures with C++
http://www.china-pub.com/computers/common/info.asp?id=1903
computer networks:
http://www.china-pub.com/computers/common/info.asp?id=977
MFC programming with Visual C++ 6 unleashed
http://www.china-pub.com/computers/common/info.asp?id=257
Visual C++实现MPEG/JPEG编解码技术
http://www.china-pub.com/computers/common/info.asp?id=8348
Red Hat Linux 7.2 Unleashed
http://www.china-pub.com/computers/common/info.asp?id=6499
The C++ programming language (special edition)
http://www.china-pub.com/computers/common/info.asp?id=3311
C++程序设计语言题解
http://www.china-pub.com/computers/common/info.asp?id=8224
C++ Gotchas Avoiding common problems in coding and design
http://www.china-pub.com/computers/common/info.asp?id=12299
Modern C++ design
http://www.china-pub.com/computers/common/info.asp?id=12302
Ruminations on C++
http://www.china-pub.com/computers/common/info.asp?id=8149
Linux内核2.4版源代码分析大全
http://www.china-pub.com/computers/common/info.asp?id=4359
UML面向对象设计基础
http://www.china-pub.com/computers/common/info.asp?id=10374
刚搬家,发现有许多以前买的书现在已经不用了。现低价转让,上海可当面交易。
书基本上都很新。
MSN: ee96liu@hotmail.com
| 我要写评论 |
| 查看所有评论交流(共10条) |













加载中...

