Saturday, November 17, 2007

Script vs Program

I think the difference between "scripts" and
"programs" relates to the human processes that
are involved in their development.

A script is basically written directly, possibly
going through several iterative cycles of refinement.
Scripts generally have a reasonably simple architecture
(even if they are quite long and complex in actuality).

A program is *designed* and code is written to
implement that design.

I mostly write scripts. Generally this is no real
"design" involved. Certainly there is some
analysis of my needs (desired outputs and/or
effects) and my inputs and resources (expected
inputs, available tools or data, etc). However,
the necessary filtering, transformation and
manipulations of my inputs are generally pretty
straightforward enough of obviate any formal
design process.

Naturally I do my scripting using languages that
are particularly well suited to this process
(interpreted, high-level languages that offer
flexible manipulations of strings, lines of input,
whole files, etc). Obviously there are many
scripting languages that are particularly apropos
for tasks in specific domains (awk and text
processing, expect for automation of interactive
processes, TCL/Tk for GUI interfaces, procmail for
e-mail filtering, sorting and auto-response generation,
etc).

I don't think of Python as a "scripting" language
though it certainly has "scripting" features.

Now are you still confused???

2 comments:

kurtnele said...

A program executes on the CPU in assembly. A script is interpreted by a program. This is the fundamental difference.

Aurobindo said...

Thanks for sharing your thoughts.