Naming things in small projects
In a small project the name of a script is most of its documentation. Two habits have saved more re-reading than any amount of comments.
Start with the verb
Every script does one thing, and the file name says what:
check-config.sh
build-site.sh
run-tests.sh
Listed together, the scripts read as a table of contents for the
project. A name like utils.sh says the opposite: that
several unrelated things live in one file.
Use the same word everywhere
If the script is called build-site.sh, the documentation
says “build the site”, the scheduled job is called “site build” and the
log line says “building site”. It sounds like a small thing until a
search for “site build” finds every place the idea appears.
When a name has to change
Sometimes the first name turns out to describe the implementation rather than the purpose. Renaming is cheap while the project is small and dear later, so it is worth doing as soon as the better name is obvious. The rename is finished when a search for the old word finds nothing.