473,388 Members | 1,405 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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

tdi
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.

Thanks.
-Ted

Jul 18 '05 #1
11 2299
A subroutine is another name for "procedure", "function", or "method".
They are made like this:

def fu():
...

A program can contain any number of subroutines, along with classes,
variables, etc.

A script is just a program, but has the implication that it's a simple
program for a simple task.

On Mon, Aug 23, 2004 at 05:18:40PM -0700, tdi 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.

Thanks.
-Ted

Jul 18 '05 #2
Phil Frost <in****@bitglue.com> wrote in message news:<ma**************************************@pyt hon.org>...
A script is just a program, but has the implication that it's a simple
program for a simple task.


I think the major implication is not that it's simple but it's written
in some 'interpreted' (rather than compiled) language. so we say
Python or Perl or Bash script, but not 'C script'. Look at the job
openings: you'll often see something like this: 'knowledge of
scripting languages (such as Perl and/or Python)'.
Jul 18 '05 #3
Porky Pig Jr wrote:
Phil Frost <in****@bitglue.com> wrote in message news:<ma**************************************@pyt hon.org>...
A script is just a program, but has the implication that it's a simple
program for a simple task.

I think the major implication is not that it's simple but it's written
in some 'interpreted' (rather than compiled) language. so we say
Python or Perl or Bash script, but not 'C script'. Look at the job
openings: you'll often see something like this: 'knowledge of
scripting languages (such as Perl and/or Python)'.


Before this explodes into another long thread, please check the
archives for this newsgroup if you have any interest in this
topic. It has been discussed at length, and both Phil's and
Porky Pig's responses have been posted before, along with
others (which I have a feeling we're about to see yet again
from other people in spite of this post... ;-).

-Peter
Jul 18 '05 #4
In article <56**************************@posting.google.com >,
Porky Pig Jr <po**********@my-deja.com> wrote:
Phil Frost <in****@bitglue.com> wrote in message
news:<ma**************************************@py thon.org>...
A script is just a program, but has the implication that it's a simple
program for a simple task.


I think the major implication is not that it's simple but it's written
in some 'interpreted' (rather than compiled) language. so we say
Python or Perl or Bash script, but not 'C script'. Look at the job
openings: you'll often see something like this: 'knowledge of
scripting languages (such as Perl and/or Python)'.


All true--but we also shouldn't limit ourselves to the notoriously
imprecise dialect of employment advertisements. Let's recognize
that's how managers and HR functionaries talk, but recognize that
our own concepts need to be sharper.
Jul 18 '05 #5
tdi <te*@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)
Jul 18 '05 #6
On 24 Aug 2004 13:45:38 GMT, Oliver Fromme <ol**@haluter.fromme.com>
declaimed the following in comp.lang.python:

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.
I'd put REXX at the split point between a strictly OS scripting
language (JCL, DCL, shell scripts) and interpreted programming language
(Python, BASIC, PERL, etc.). Primarily for REXX's easy means of using OS
commands -- any statement not recognized as a REXX statement is
automatically passed to the current defined command host (normally a
command shell, but could be a REXX compatible editor, or other
application). None of this hassle of explicitly calling os.system() (for
example). For ambiguous statements (those that could be REXX or command
host), putting quotes around those meant for the host was sufficient.
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).
And to confuse the matter, the old FORTRAN terminology (at
least, in my old classes) referred to "function subprograms" and
"subroutine subprograms".

-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <

Jul 18 '05 #7
In article <lv********************************@4ax.com>,
Dennis Lee Bieber <wl*****@ix.netcom.com> wrote:
On 24 Aug 2004 13:45:38 GMT, Oliver Fromme <ol**@haluter.fromme.com>
declaimed the following in comp.lang.python:

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.

I'd put REXX at the split point between a strictly OS scripting
language (JCL, DCL, shell scripts) and interpreted programming language
(Python, BASIC, PERL, etc.). Primarily for REXX's easy means of using OS
commands -- any statement not recognized as a REXX statement is
automatically passed to the current defined command host (normally a
command shell, but could be a REXX compatible editor, or other
application). None of this hassle of explicitly calling os.system() (for
example). For ambiguous statements (those that could be REXX or command
host), putting quotes around those meant for the host was sufficient.


And you might have added, it can be applied to other environments
besides the OS, as an application scripting language. In either
case it takes functionality of a type that is commonly wielded by
hand, and exposes it in a programming language. Hence, a script,
obviously derived from common English usage of the word.

Donn Cave, do**@u.washington.edu
Jul 18 '05 #8


Dennis Lee Bieber wrote:
[snip]
And to confuse the matter, the old FORTRAN terminology (at
least, in my old classes) referred to "function subprograms" and
"subroutine subprograms".

Yes, because the former returned a value, the latter did not.

Colin W.

Jul 18 '05 #9
Larry Wall said it best:
"A script is what you give the actors, a program is what you give the
audience"

--
Part of the problem since 1976
http://badcomputer.no-ip.com

"...the number of UNIX installations has grown to 10, with more expected..."
- Dennis Ritchie and Ken Thompson, June 1972
Jul 18 '05 #10
On Tue, 24 Aug 2004 09:22:18 -0700, Donn Cave <do**@u.washington.edu>
declaimed the following in comp.lang.python:
automatically passed to the current defined command host (normally a
command shell, but could be a REXX compatible editor, or other

<snip>
And you might have added, it can be applied to other environments
besides the OS, as an application scripting language. In either
I thought I had, though the use of "defined command host" may
have been obscure. <G>
-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <

Jul 18 '05 #11
Porky Pig Jr wrote:
Phil Frost <in****@bitglue.com> wrote in message news:<ma**************************************@pyt hon.org>...
A script is just a program, but has the implication that it's a simple
program for a simple task.


I think the major implication is not that it's simple but it's written
in some 'interpreted' (rather than compiled) language.


To my way of thinking, a "script" is a canned sequence of
commands for something that one normally uses interactively.
On that basis, python "scripts" aren't really scripts, they're
programs -- because the Python interpreter isn't normally
used interactively, except for trying things out during
programming.

--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg

Jul 18 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mark Creelman | last post by:
Hello all: I am attempting to use a database program that I downloaded from http://www.thescripts.com/serversidescripting/perl/tutorials/asimpledatabaseprogram/database.txt with good...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.