mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Updated the new ES.3
Added xref, massaged summary.
This commit is contained in:
parent
627ed66ce6
commit
520ac9c695
|
@ -9978,12 +9978,12 @@ Once the checking for overflow and error handling has been added that code gets
|
|||
Not easy. ??? Look for messy loops, nested loops, long functions, absence of function calls, lack of use of non-built-in types. Cyclomatic complexity?
|
||||
|
||||
### <a name="Res-DRY"></a>ES.3: Don't repeat yourself, avoid redundant code
|
||||
Duplicated or otherwise redundant code obscures intent and makes it harder to understand the logic. There are several other reasons to avoid redundant code. For example, it makes maintenance harder.
|
||||
|
||||
Duplicated or otherwise redundant code obscures intent, makes it harder to understand the logic, and makes maintenance harder, among other problems. It often arises from cut-and-paste programming.
|
||||
|
||||
Use standard algorithms where apropriate, instead of writing some own implementation.
|
||||
|
||||
**See also**: [SL.1](#Rsl-lib)
|
||||
|
||||
**See also**: [SL.1](#Rsl-lib), [ES.11](#Res-auto)
|
||||
|
||||
##### Example
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user