|
|
|
|
|
by bshimmin
4010 days ago
|
|
3.3 Use readable synonyms in place of reserved words.
// bad
const superman = {
class: 'alien',
};
// bad
const superman = {
klass: 'alien',
};
What is unreadable about "klass"? Rails, for example, uses "klass" and it's never been hard for me (or, I suspect, anyone) to understand. |
|
"Make sure you set the class-with-a-k property to 'alien'."
"Make sure you set the type property to 'alien'."