Skip to content

Commit

Permalink
[javascript, typescript] replace_magic_with_identifier (#2265)
Browse files Browse the repository at this point in the history
* ...facilitates documentation *and translation*.

* ...facilitates documentation *and translation*.
  • Loading branch information
habere-et-dispertire authored Aug 29, 2023
1 parent a303e01 commit e3f233c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ When possible, named constants are often a better choice than inlined literals b
The programmer might infer the meaning after reading the code carefully, but it is not obvious.
Magic values become particularly confusing when the same value is used for different purposes in one section of code.
- It is easier to alter the value, as it is not duplicated.
- It encourages and facilitates documentation.
- It encourages and facilitates documentation and translation.
- It aids with autocompletion in many IDEs.
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ When possible, named constants are often a better choice than inlined literals b
The programmer might infer the meaning after reading the code carefully, but it is not obvious.
Magic values become particularly confusing when the same value is used for different purposes in one section of code.
- It is easier to alter the value, as it is not duplicated.
- It encourages and facilitates documentation.
- It encourages and facilitates documentation and translation.
- It aids with autocompletion in many IDEs.

0 comments on commit e3f233c

Please sign in to comment.