Noise words are the words that do not offer any additional information about the variable. They are redundant and should be removed.
Some popular noise words are:
The (prefix)
Info
Data
Variable
Object
Manager
If your class is named UserInfo, you can just remove the Info and make it User. Using BookData instead of Book as class name is just a no-brainer, as a class stores Data anyways.
If you can’t pronounce a name, you can’t discuss it without sounding silly.
const yyyymmdstr = moment().format(“YYYY/MM/DD”);
const currentDate = moment().format(“YYYY/MM/DD”);
Avoid using magic numbers in your code. Opt for searchable, named constants. Do not use single-letter names for constants since they can appear in many places and therefore are not easily searchable.
if (student.classes.length < 7) { // Do something }
if (student.classes.length < MAX_CLASSES_PER_STUDENT) { // Do something }
File names should be named in PascalCase and should be named after the class they contain. If a file contains multiple classes, the file name should be named after the main class in the file.
Class names should be named in PascalCase.
Method names should be named in PascalCase.
Variable names should be named in camelCase.
Constants should be named in UPPER_SNAKE_CASE.
Enumerations should be named in PascalCase.
Enumeration members should be named in PascalCase.
Interface names should be named in PascalCase. and be Prefixed with the letter I.
Property names should be named in PascalCase.
Event names should be named in PascalCase.
Namespace names should be named in PascalCase.
Struct names should be named in PascalCase.
Delegate names should be named in PascalCase.
Type parameter names should be named in PascalCase.