Script vs Program

Simon simon108 at my-deja.com
Tue Dec 12 17:40:11 EST 2000


In article <krFV5.102015$U46.3205226 at news1.sttls1.wa.home.com>,
  "Greg Jorgensen" <gregj at pobox.com> wrote:
> <simon108 at my-deja.com> wrote in message news:9069v6
$ifi$1 at nnrp1.deja.com...
>
> > Java is not called scripting language because you have a compiler
> > that "compiles" your script, therefore entering in the category of
> > compile languages instead of interpreted as Python.
> > In any case you can call your Python code scripts programs if they
> > actually perform any type of i/o .
>
> I'm not sure what your point is. Java source code is compiled into
byte
> codes that are executed by a JVM. Python works the same way, but the
compile
> step is generally invisible.
>
> I don't know what I/O has to do with anything. Are my C programs
scripts if
> they don't perform I/O?
>
> --
> Greg Jorgensen
> Deschooling Society
> Portland, Oregon, USA
> gregj at pobox.com
>
>

--
 "In Python, like in C, procedures are just functions that don't return
a value. In fact, technically speaking, procedures do return a value,
albeit a rather boring one. This value is called None (it's a built-in
name). Writing the value None is normally suppressed by the interpreter
if it would be the only value written."
By this quote taken from the Python tutorial I will try to state why I
consider I/O a part in writing a program in Python. If you write a set
of functions and variable declarations in Python , you are not really
writing a program but defining resources for your program(s) to use. In
fact there is no need for a program if you directly use the command
interpreter and obtain the results by manipulating your pre-defined
functions and variables (although it may be argued that the fact that
the input of a set of instructions to obtain the results in the
interpreter might be called a program).
Now I would say that to write a function by itself is not a program, to
use the function through the Python interpreter is not a program, A
program would be a set of instructions to get the values, manipulate
those functions and return a result and I will add to this, that this
set of instructions should have the ability to be recalled and executed
automatically(by means of the interpreter or by executing its object
code). In that sense I am saying that if you replicate in a file those
instructions you performed in the interpreter manually and are able to
execute them automatically from that file (being the input the
definitions of the variables and functions previously defined, or the
users direct input, and the output the results of such manipulation)
then you have a strict definition of a program.
Now I am not going to argue whether the functions or procedures
returning a "none" value should be consider programs but I would say
that you can call the file with the instructions to manipulate the
functions and variables and that return a result or output a script but
the file with the variables and function definition by itself(if they
do not produce any results or outputs different than none) that you can
not call that a program.

You can gather all the ingredients to make bread, but without a recipe
you do not have bread, you have ingredients.


Sent via Deja.com
http://www.deja.com/



More information about the Python-list mailing list