Skip to content
/ naming Public

🦾 Consistant naming system

License

Notifications You must be signed in to change notification settings

k2on/naming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Naming

Word Order

The order of words should increase in specificity.

❌ Don't do:

let Car, // <- root class
    CombustionCar,
    FordCombustionCar,
    ElectricCar,
    TeslaElectricCar;

✅ Do this:

let Car, // <- root class
    CarCombustion,
    CarCombustionFord,
    CarElectric,
    CarElectricTesla;

Verbs

Verbs are used in function names. Verbs with ! have side effects.

Intent Verbs
Create make, build!
Read get, read!
Compute is
Update set!, add!, write!
Destroy remove!

Examples

Make

A function that parses a string into a custom type.
parseCustomType
makeCustomTypeFromString

Compute

NOTE: Compute functions should be pure. If there needs to be some side effect in a computation, it should happen outside of the function and passed as an argument.

A method that validates some config.
validateConfig
isValidConfig Config > Valid
isConfigValid
If a file exists or not.
fileExists
doesFileExist Does is not a Compute verb
isFileExist

About

🦾 Consistant naming system

Topics

Resources

License

Stars

Watchers

Forks