I like that, moritz! It's so true!
I would have said: A script is a small program ans a program is a big script.
s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e
| [reply] [d/l] [select] |
| [reply] |
:D perl, produced by dry humor
| [reply] |
There are no sharp borders, it's basically about size and claim. see Scripting_language
For me (!) a script is a short efficient hack which is supposed to just do a little job and doesn't have to meet quality criteria of larger projects (lifespan, modularity, clear scopes and namespaces (i.e. no global vars), encapsulation, documentation, maintainability, and so on ...)
Sometimes scripts evolve into larger programs where all this quality aspects have to be added, but there is no magical byte added in this process, which turns a script into a "real" program.
PS: Yeah and it's also a flame topic, because some people try to vilify Perl as "only a script language". But in the context of this board it's no fun, better try vi vs emacs for some action. ;-) | [reply] |
Personally, I take the view that a program is a self-contained file that can only be run in a pre-compiled/ linked form e.g. an executable ... c/w a script, being any file, in text form, that can be/is interpreted on the fly by an external program.
Hence in most cases, I view the terms perl script and perl program as being synonymous (since they both require an external perl binary + libraries in order to run) ... unless and until I've used perl2exe, Par or maybe even Wx::Perl::Packager to create a self-contained executable entity.
A user level that continues to overstate my experience :-))
| [reply] |
For me, a 'script' is a code that I can whip together in ten minutes or less to solve an immediate problem. It implies that there are no tests, packaging, and anything more that perfunctory documentation. Often, none of the corner cases are considered, since the problem that I am sorting is very specific.
A program, on the other hand, is code that I expect to be hanging around for a while and needs the formal structure of POD, a test-harness, and a bit of thought in the design process.
(Note: I often find that a script that I wrote twice last week really should become a program....)
My people in the Computer Science disciplines make the distinction between 'script' and 'program' in terms of the mechanism that is used to run them. A script is run through an Interpreter; a program is run through a Compiler. The implication is that the Interpreter does not produce a reusable intermediate structure (no 'object code') that can be saved and used again later without reprocessing the source code. This distinction has gotten badly blurred in past decade or so, what with Just In Time Compilers and Interpreters that output byte-code-objects that are executed by a VM.
----
I Go Back to Sleep, Now.
OGB
| [reply] |