3 ms·
I think of scripts as a sub-type of program; it is more appropriate to contrast it to a library, such that the intent changes a few expectations about how the p
by lizard 3y ago
I think of scripts as a sub-type of program; it is more appropriate to contrast it to a library, such that the intent changes a few expectations about how the program is built and maintained.
A script is specifically a program intended to perform a user process.
Scripts may be maintained by the "user" who has knowledge of the process, rather than the domain or software engineering. Things like style guides don't matter for a script if just needs to gets the job done. They may be messy and easier to replace than refactor if the process or environment change.
In Python I also make the distinction that a script (can) use hyphens in the name, which can be executed, e.g. `python do-thing.py`, but can't be imported through a typical `import` statement (because they generally shouldn't be).
As you say, this isn't really _important_. Scripts _can be_ well written and follow engineering principles. I just use this distinction to recognize the need for these "fast and loose" programs, where there's more emphasis on making a thing happen than maintaining the code.
By saying, "This is a script," I'm really saying, "I don't expect to put a lot of energy into it."
- Fire-Dragon-DoL 3y agoDoes this classification give any value? I couldn't answer yes for any point, so considering them the same it's simpler.
- lizard 3y agoDoes being able to say I have a labrador. instead of, I have a dog. give any value? It depends what you are doing and who you are working with, I suppose.