دسترسی نامحدود
برای کاربرانی که ثبت نام کرده اند
برای ارتباط با ما می توانید از طریق شماره موبایل زیر از طریق تماس و پیامک با ما در ارتباط باشید
در صورت عدم پاسخ گویی از طریق پیامک با پشتیبان در ارتباط باشید
برای کاربرانی که ثبت نام کرده اند
درصورت عدم همخوانی توضیحات با کتاب
از ساعت 7 صبح تا 10 شب
دسته بندی: برنامه نویسی: زبان های برنامه نویسی ویرایش: نویسندگان: Mats Henricson. Erik Nyquist سری: Series in Innovative Technology ISBN (شابک) : 9780131209657, 0131209655 ناشر: Prentice Hall سال نشر: 1996 تعداد صفحات: 244 زبان: English فرمت فایل : PDF (درصورت درخواست کاربر به PDF، EPUB یا AZW3 تبدیل می شود) حجم فایل: 2 مگابایت
در صورت تبدیل فایل کتاب Industrial Strength C++: Rules and Recommendations به فرمت های PDF، EPUB، AZW3، MOBI و یا DJVU می توانید به پشتیبان اطلاع دهید تا فایل مورد نظر را تبدیل نمایند.
توجه داشته باشید کتاب قدرت صنعتی ج: قوانین و توصیهها نسخه زبان اصلی می باشد و کتاب ترجمه شده به فارسی نمی باشد. وبسایت اینترنشنال لایبرری ارائه دهنده کتاب های زبان اصلی می باشد و هیچ گونه کتاب ترجمه شده یا نوشته شده به فارسی را ارائه نمی دهد.
Mats Henricson Erik Nyquist......Page 1
The class interface 55......Page 3
Parts of C++ to avoid 157......Page 4
Index 215......Page 5
Acknowledgements......Page 13
Naming......Page 21
Rec 1.2 Use English names for identifiers.......Page 22
EXAMPLE 1.2 Different ways to print an object......Page 23
EXAMPLE 1.4 Names used by a template function......Page 24
Rec 1.4 Only namespace names should be global.......Page 25
EXAMPLE 1.6 Accessing names from namespace......Page 26
Rec 1.5 Do not use global using declarations and using directives inside header files.......Page 27
Rule 1.8 Do not use identifiers that contain two or more underscores in a row. Rule 1.9 Do not us.........Page 28
EXAMPLE 1.10 Use of underscores in names......Page 29
Organizing thecode......Page 31
EXAMPLE 2.1 Testing for self-containment......Page 32
EXAMPLE 2.2 Data member of class type......Page 33
Rule 2.3 Enclose all code in header files within include guards.......Page 34
EmcString.icc......Page 35
Rec 2.5 Definitions for all template functions of a class should be placed in a separate file.......Page 36
EXAMPLE 2.7 Class template......Page 37
EmcQueue.hh......Page 38
Comments......Page 39
Long copyright comment......Page 40
Rec 3.3 Every file should declare a local constant string that identifies the file.......Page 41
Rec 3.5 All comments should be written in English.......Page 42
Control flow......Page 45
Rule 4.1 Do not change a loop variable inside a for-loop block.......Page 46
EXAMPLE 4.1 Block after for-loop......Page 47
EXAMPLE 4.3 How to write switch statements......Page 48
EXAMPLE 4.4 How to break out of a loop......Page 49
Rec 4.7 Do not have too complex functions.......Page 50
Object Life Cycle......Page 51
EXAMPLE 5.1 Initializing variables......Page 52
EXAMPLE 5.3 Assignment instead of initialization......Page 53
EXAMPLE 5.5 Correct use of “magic” number......Page 54
Rec 5.5 Initialize all data members.......Page 55
EXAMPLE 5.6 Constructor initialization lists......Page 56
Rec 5.7 Do not use or pass this in constructor initializer lists.......Page 57
Rec 5.11 A class that manages resources should declare a copy constructor, a copy assignment oper.........Page 58
EXAMPLE 5.8 Returning dangling pointers and references......Page 59
Rec 5.10 If objects of a class should never be copied, then the copy constructor and the copy ass.........Page 60
Rec 5.11 A class that manages resources should declare a copy constructor, a copy assignment oper.........Page 61
EXAMPLE 5.10 Copyable class that manages memory......Page 62
EXAMPLE 5.12 Implementing a copy assignment operator......Page 63
Conversions......Page 67
EXAMPLE 6.1 Explicit conversions......Page 68
Rec 6.2 Use the new cast operators (dynamic_cast, const_cast, reinterpret_cast and static_cast) i.........Page 69
EXAMPLE 6.4 New style casts......Page 71
EXAMPLE 6.6 Object in write-protected memory......Page 72
EXAMPLE 6.7 Class with mutable data member......Page 73
The class interface......Page 75
Rec 7.1 Make simple functions inline.......Page 76
Rule 7.2 Do not declare virtual member functions as inline.......Page 77
Argument passing and return values......Page 78
EXAMPLE 7.2 Different types of function parameters......Page 79
Rec 7.4 Only use a parameter of pointer type if the function stores the address, or passes it to .........Page 80
EXAMPLE 7.4 Pointer and reference arguments......Page 81
Rec 7.5 Pass arguments of class types by reference or pointer.......Page 82
EXAMPLE 7.5 Passing arguments of unknown type......Page 83
EXAMPLE 7.6 Passing base class reference......Page 84
EXAMPLE 7.8 Return value from assignment operators......Page 85
Rule 7.8 A pointer or reference parameter should be declared const if the function does not chang.........Page 86
Rule 7.9 The copy constructor and copy assignment operator should always have a const reference a.........Page 87
EXAMPLE 7.11 Copyable type parameter......Page 88
EXAMPLE 7.12 Accessing string literals......Page 89
EXAMPLE 7.13 Implications of const......Page 90
Rule 7.12 A member function that gives non-const access to the representation of an object must n.........Page 91
EXAMPLE 7.15 Accessing characters in a string......Page 92
Rec 7.13 Do not let const member functions change the state of the program.......Page 93
See Also......Page 94
Rec 7.15 If you overload one out of a closely-related set of operators, then you should overload .........Page 95
EXAMPLE 7.18 Implementation of closely related operators......Page 96
EXAMPLE 7.19 Hiding member functions......Page 97
EXAMPLE 7.20 Inheriting overloaded virtual member functions......Page 99
EXAMPLE 7.22 Default arguments for member function......Page 100
Rec 7.18 One-argument constructors should be declared explicit.......Page 101
EXAMPLE 7.24 How to avoid conversion operator function......Page 102
new and delete......Page 107
Rule 8.1 delete should only be used with new. Rule 8.2 delete [] should only be used with new [].......Page 108
Rule 8.3 Do not access a pointer or reference to a deleted object.......Page 109
EXAMPLE 8.3 Objects that commit suicide......Page 110
EXAMPLE 8.4 Placement new......Page 111
EXAMPLE 8.5 Class with customized memory management......Page 113
Rec 8.6 Customize the memory management for a class if memory management is an unacceptably-large.........Page 114
Static Objects......Page 115
Rec 9.1 Objects with static storage duration should only be declared within the scope of a class,.........Page 116
EXAMPLE 9.2 Static data member......Page 117
EXAMPLE 9.5 Access to static object inside constructor......Page 118
EXAMPLE 9.7 Initialization object......Page 120
Object- oriented programming......Page 123
Rule 10.1 Only declare data members private.......Page 124
EXAMPLE 10.1 Returning non-const reference to object......Page 125
Rec 10.3 Selection statements (if and switch) should be used when the flow of control depends on .........Page 126
EXAMPLE 10.3 Factory class......Page 127
EXAMPLE 10.4 Dynamic binding......Page 129
Rule 10.4 A public base class must either have a public virtual destructor or a protected destruc.........Page 130
EXAMPLE 10.5 Deleting a derived class object......Page 131
EXAMPLE 10.6 Virtual base class......Page 132
See Also......Page 135
EXAMPLE 10.7 Pre- and postconditions......Page 136
EXAMPLE 10.8 Using member function with precondition......Page 137
Rec 10.7 Use C++ to describe preconditions, postconditions and class invariants.......Page 138
EXAMPLE 10.10 Using comments to specify class template......Page 139
Rule 10.8 A pointer or reference to an object of a derived class should be possible to use wherev.........Page 140
EXAMPLE 10.13 Specification of overriden member function......Page 141
EXAMPLE 10.14 Describing template argument requirements......Page 143
EXAMPLE 10.15 Checking type constraints......Page 144
EXAMPLE 10.16 Performance characteristics of types......Page 145
Assertions......Page 149
Rec 11.2 Remove all assertions from production code.......Page 150
EXAMPLE 11.2 Assertions and exceptions......Page 151
Error handling......Page 153
Rec 12.1 Check for all errors reported from functions. Rec 12.2 Use exception handling instead of.........Page 154
EXAMPLE 12.1 Checking status value......Page 155
EXAMPLE 12.2 Throwing an exception......Page 156
Rec 12.3 Only throw exceptions when a function fails to perform what it is expected to do.......Page 157
EXAMPLE 12.3 Member function with precondition......Page 158
EXAMPLE 12.4 Returning special value to report failure......Page 159
Rule 12.5 Do not let destructors called during stack unwinding throw exceptions.......Page 160
EXAMPLE 12.5 Preventing exceptions inside destructors......Page 161
EXAMPLE 12.6 Exception class constructor......Page 162
See Also......Page 163
3. call function to release resource......Page 164
EXAMPLE 12.7 Unsafe memory allocation......Page 165
EXAMPLE 12.9 Exception safe allocation of free store objects......Page 166
Rec 12.10 Before letting any exceptions propagate out of a member function, make certain that the.........Page 167
EXAMPLE 12.10 Exception safe copy assignment operator......Page 168
See Also......Page 169
Rec 12.12 Group related exception types by using inheritance. Rec 12.13 Only catch objects by ref.........Page 170
EXAMPLE 12.12 Inheritance of exception classes......Page 171
Rule 12.14 Always catch exceptions the user is not supposed to know about.......Page 173
Rec 12.15 Do not catch exceptions you are not supposed to know about.......Page 174
EXAMPLE 12.14 Exception specification......Page 175
Library functions to avoid......Page 177
Rule 13.2 Use the iostream library instead of C-style I/O.......Page 178
Rec 13.4 Use overloaded functions and chained function calls instead of functions with an unspeci.........Page 179
EXAMPLE 13.3 Overloading of operator<<......Page 180
EXAMPLE 13.4 Macros do not obey scope rules......Page 181
EXAMPLE 13.7 Function-like macro, SQUARE......Page 182
EXAMPLE 13.10 How to define synonyms for a type......Page 183
EXAMPLE 13.11 Passing array to function......Page 184
Rec 13.7 Do not use unions.......Page 185
Size of executables......Page 187
Rec 14.1 Avoid duplicated code and data.......Page 188
Rule 14.2 When a public base class has a virtual destructor, each derived class should declare an.........Page 190
Portability......Page 191
EXAMPLE 15.1 Implementation-defined behavior......Page 192
EXAMPLE 15.3 Undefined behavior......Page 193
EXAMPLE 15.5 Type of fixed size......Page 194
EXAMPLE 15.6 Good and bad way of including files......Page 195
EXAMPLE 15.8 Case-sensitivity of header file name......Page 196
Rule 15.7 Do not make assumptions about the size of or layout in memory of an object.......Page 197
Rec 15.9 If possible, use plain int to store, pass or return integer values.......Page 198
EXAMPLE 15.12 chars can be signed or unsigned......Page 199
Rec 15.12 Use typedefs or classes to hide the representation of application-specific data types.......Page 200
EXAMPLE 15.14 Prefixed name......Page 201
Rec 15.14 Use macros to prevent usage of unsupported keywords.......Page 202
EXAMPLE 15.16 Forward-compatibility macros......Page 203
Other compiler differences......Page 204
EXAMPLE 15.18 Using a template......Page 205
EXAMPLE 15.19 Template header file......Page 206
EXAMPLE 15.20 Temporary objects......Page 207
EXAMPLE 15.21 A pragma-directive......Page 208
EXAMPLE 15.24 Evaluation order of subexpressions......Page 209
Style......Page 211
Style 1.1 Do not mix coding styles within a group of closely related classes.......Page 212
EXAMPLE 16.1 How to separate words in an identifier......Page 213
Style 1.6 The names of macros should be in uppercase.......Page 214
EXAMPLE 16.6 Integral suffixes......Page 215
Style 1.9 Header files should have the extension “.hh”. Style 1.10 Inline definition files should.........Page 216
EXAMPLE 16.7 Specifying parameter names......Page 217
EXAMPLE 16.9 Explicitly given access specifiers......Page 218
EXAMPLE 16.10 Where to implement inline member functions......Page 219
EXAMPLE 16.13 How to access static members......Page 220
const correct......Page 223
global scope......Page 224
resource......Page 225
virtual table......Page 226
Illegal naming......Page 227
Constructor initializer lists......Page 228
Const Correctness......Page 229
Static Objects......Page 230
When to throw exceptions......Page 231
Size of executables......Page 232
Other compiler differences......Page 233
Lexical style......Page 234
C......Page 235
E......Page 237
H......Page 238
K......Page 239
N......Page 240
P......Page 241
S......Page 242
U......Page 243
W......Page 244