How does a "script" differ from a "program" or "subroutine"?

Oliver Fromme olli at haluter.fromme.com
Tue Aug 24 09:45:38 EDT 2004


tdi <ted at soleburymountain.com> wrote:
 > Ok, stupid question for the day. I'm reading the interview with Steve
 > Moret and he says: "Once a lot of scripts started going in we knew
 > there was no way we could back out of using Python."
 > 
 > I'm just getting into Python and am wondering if I'm missing something
 > or this is just a semantic issue.

Historically, the term "script" means a batch job, i.e. a
sequence of OS commands that are executed in an automated
manner (as opposed to typing those commands interactively),
with very limited possibilities of loops, conditionals and
variables.  DOS batch files (.BAT) are a typical example.

The term "program" means complex processing instructions
which implement algorithms in a particular programming
language (which does not normally contain OS commands
directly).

With some languages, the differences become very small, and
people tend to pay less attention to the distinction, so
"scripts" and "programs" are used as synonyms.  For example,
some advanced UNIX shells (like the zsh) have features that
support complex programming, such as various kinds of loops
and conditionals, arrays, dictionaries etc.

Python is more a programming language than a scripting
language (more than Perl, at least), although you can very
well use it for tasks which would typically be written in a
scripting language.

A subroutine is just another name for a procedure or a
function, i.e. a piece of program code that performs a
specific task, and which can be called from within the
program (once or multiple times).  You can define sub-
routines in almost every language (both for programming
and for scripting).

Best regards
   Oliver

-- 
Oliver Fromme, Konrad-Celtis-Str. 72, 81369 Munich, Germany

``All that we see or seem is just a dream within a dream.''
(E. A. Poe)



More information about the Python-list mailing list