3 ms·
Personally, I'd say that a script is: - A program - Contained in a single file - Distributed in source code form - Intended to automate a single well-define
by crote 3y ago
Personally, I'd say that a script is:
- A program
- Contained in a single file
- Distributed in source code form
- Intended to automate a single well-defined process
- With no or minimal interactivity beyond command-line parameters.
In essence, a script is just a formalization of a task a user is trying to accomplish. It could be replaced by a well-trained monkey and primarily serves to avoid making mistakes when trying to execute it again and again.
- philote 3y agoI've written "scripts" that do things like create a user, run migrations, or do some processing on a file that pull in either or both of 3rd-party libraries or other code I wrote (ie. db models). So the "contained in a single file" for me isn't a hard requirement. I do think the rest of your points are accurate though. I'd also add that a script runs until the task is done, and no longer. Whereas you may have other programs, like web services or queue workers, that continue running and doing their tasks.