After a month you have fifteen scripts. Three work, four are half finished, and the names are variations on test and script two. Finding the one that renamed the photographs takes longer than writing it again, which is how most beginner work gets lost.
What should the naming convention be?
What it does, in words, with no version numbers. Rename_photos_by_date is findable; script_v3_final is not, and the version number always lies because the final one is never the last.
Underscores or hyphens rather than spaces, since spaces cause problems when running scripts from a terminal.
How should folders be arranged?
- One folder per project. Even a single-file project.
- The script, its notes and its sample data together.
- A separate folder for experiments. Things you are trying rather than keeping.
- Nothing important in a downloads folder. Which is where beginner scripts tend to live.
What should you keep alongside the code?
A short note saying what the script does, how to run it and what it expects. Three sentences, in a text file in the same folder, written when the script works rather than later.
This is the single highest-value habit in this article, because the thing you forget is never the code, it is how to run it.
What does that note need?
What it does. What it needs to exist before running, such as a folder or a file. Exactly how to run it, as a command you can copy. What it produces and where. Anything that will break it.
What about the code itself?
Comments explaining why rather than what. A line saying that a section skips files starting with a full stop because those are hidden system files is useful in six months; a comment restating the code is not.
Do beginners need version control?
Not for the first few scripts, and sooner than most people adopt it. The immediate benefit is not collaboration, it is being able to get back a version that worked after an afternoon of changes that did not.
Until then, keeping a dated copy before making substantial changes achieves the same thing crudely and takes two seconds.
What about backup?
Whatever backs up the rest of your documents should cover it, provided your code is not sitting in a temporary folder. This is a genuine argument for not working in downloads.
How do you find things later?
By searching the contents rather than the names, which every operating system supports and most people forget. A search for the folder name a script operates on will find it even when the file name is unhelpful.
What is the minimum worth doing?
Descriptive names, one folder per project, and a three-line note beside anything that works. Ten seconds per script, and it is the difference between a growing collection of tools and a folder you eventually stop opening.