Novel Thoughts on Scripting and Languages

Terry Hancock hancock at anansispaceworks.com
Wed Jan 8 21:54:17 CET 2003


Dave Brueck wrote:
> So what do consider to be scripting versus programming and in what way
> does it matter? If Judoscript is simply a way to do Java stuff without
> having to go through an explicit compile step, then cool, more power to
> you. But if, as your site implies, there is additional value there that
> might be useful to me (above and beyond Python and similar languages),
> then help me understand what it is (note that simply asserting "it's
> better!" doesn't really help).

Just in the interest of adding gasoline to the flame... ;-D

I think it's "scripting" if it relies heavily on external applications, 
which you call more or less directly.  This is especially true if you use 
the operating system's help to make the call (as in using a well-defined 
"command line" within the program, as opposed to a function call -- just 
about any use of os.system() is going to be "scripting" IMHO).

On the other hand, it's programming when you use a library (or module) 
which is specifically designed to work with your programming language, and 
provide an appropriate API.

Of course, this is a fuzzy definition, and one can easily write a module 
which actually accomplishes its work by scripting, so that the module is 
"scripting", but the calling program is a "program", using a well-defined 
API.

An alternative definition that seems to fit my usage is that "scripting" is 
relatively unstructured, bricolage of code, while "programming" is 
engineered according to some basic paradigm (like "object-oriented", 
"functional", or simply "structured").  Of course, once again, this is a 
fuzzy definition -- level of organization of a program is a matter of 
degree.  In fact, I think I like this definition better.

I also think of "scripts" as being rather platform (or even specific 
computer dependent), whereas "programs" try to maximize portability. A 
consequence of this is that an "end user" probably has to edit a "script" 
to make use of it, but probably can use a "program" as is.

I also think, however, that using Python largely obviates the need to make 
any distinction between the two.  Except that, stylistically, it is 
sometimes useful to separate my "program" from "scripts" that are supposed 
to interact with it -- mainly because of the end-user issue: I need a way 
to semaphore to my user that they can mess with "config.py" all they want, 
but that getting into "Application.py" is probably bad news unless they 
really know what they're doing.  I usually try to acheive this through 
naming conventions, and/or directory structure. But I do find that using 
the same language for scripting and programming introduces some ambiguity 
at that level.

I'm curious whether other people have this problem, and what they do about 
it.

Curiously -- reading the subject line, this appears to be more on-topic 
than the lead post.  Hmmm.

Cheers,
Terry

-- 
Anansi Spaceworks
http://www.anansispaceworks.com




More information about the Python-list mailing list