My Programming Experience

For over 20 years, I have done various kinds of programming with the computers I've worked on. I started out with FORTRAN, the original high-level programming language, the ancestor of them all (it looks a lot like C or Pascal). I was fortunate to be able to use VAX FORTRAN, which has a lot of nice structured extensions, like DO / ENDDO and so forth; as it was, the FORTRAN 77 standard only had IF / THEN / ELSE.

After leaving Cornell, I was stuck on Unix, which I've never really loved (though practically bulletproof, it's extremely short on user-friendlness); and the FORTRAN available there was not structured. So I moved to C, and eventually to C++. Of course, one nice thing is that C has all those nice structured features, and I don't think I've written a GO TO in a long time. One thing annoying about C was that one could not dynamically allocate multidimensional arrays in one simple step; one either had to allocate pointers to parts of the array, and then the array parts themselves, or else create one's own indexing function.

But C++ is really nice, and I do not wish to go back to plain C. Instead of ugly scanf() and printf() statements and variations like fscanf() and fprintf() and sscanf() and sprintf(), I can do I/O without having to specify what type of data it is, and what type of object I'm doing I/O from/to. I've written array objects which contain multidimensional indexing, and with template classes, I can make an array of whatever I want; something also not very pretty in plain C. A nice feature of FORTRAN is "function overloading" -- one can specify a function with, not only its name, but also its arguments. Thus sin(x) gets turned into the single-precision version is x is single-precision, the double-precision version if x is double-precision, and so forth. C++ simply takes this concept to greater heights, allowing one to define one's own overloaded functions -- and default arguments. C++ also does inheritance, which is a nice way of passing a pointer to a function. A base class defines a function that does something, or maybe even nothing :-), and it gets overridden by a descendant class having a function with the same name and arguments.

Some time after I had written that, I discovered the Standard Template Library, which contains its own type-safe array classes, as well as many others.

I have also gotten into Java; Java I am interested in because it contains some standard libraries for doing GUI stuff, and relatively easy-to-use libraries at that, and because it can be completely cross-platform; I've managed to construct such fun GUI stuff as a Spirograph program. The cross-platformness of Java is almost a necessity to me, because most GUI software is very operating-system-specific, and I like being able to write for Windows (Windoze?) without actually using Windows. In this context, Sun's slogan of "100% Pure Java" is a masterpiece of sloganeering. The ease of programming is also good for me, because I've used Metrowerks PowerPlant and Borland Object Windows Library, and both of them were a real pain to use; I spent a large amount of time on the phone with consultants, though I did succeed in accomplishing more with the PowerPlant project I tried (writing an image viewer from scratch) as opposed to the OWL one (modifying an existing image viewer that came in its sample code).

As to the MacOS itself, Apple has come out with NeXTStep in disguise: MacOS X. This allows me to use NeXTian stuff like the Interface Builder, where one can connect GUI objects to class methods.

I've also done some programming in another programming language in the FORTRAN/C mold, Pascal. I remember using THINK Pascal on an early PeeCee (PC AT) to do some fun things with its sound generator (just makes a simple tone). I also did the same with an old Amiga, only I had more control over the sound. And I think I did some Mac stuff also, but I don't recall whether I did anything really significant.

More recently, I've taken the Python side of the Perl-Python debate by writing Python programs to write such things as auto-downloaders and vote counters.

I've also used such packages as Mathematica; while that offers some very nice high-level manipulation (one can create arbitrary configurations of lists with it, for example, and it has *numerous* predefined functions), it is s...l...o...w.

HyperCard (a MacOS thingie that Apple's done too little to develop or promote) I've done a little bit with; however, it's limited to the stack-of-very-similar-pages format, which makes it difficult to do very much with it. It seems to me that I'd be better off using something like Java or HTML for much of what HyperCard is good for.

As to scripting, I've had broad, but admittedly rather shallow, experience. For the various CLI's I've used (VM/CMS, VMS, Unix, and DOS), I usually have not done much more than put a lot of command-line commands into a file; the most I've usually done is put the script's command-line arguments into the commands. Here's an example that may make it easier to see; imagine a Unix file p2g containing:


ppmquant -fs $1.ppm | ppmtogif >$1.gif

Now invoke it with some filename,

p2g nice_image

The $1 gets replaced by nice_image, and the command executed becomes

ppmquant -fs nice_image.ppm | ppmtogif > nice_image.gif

As to GUI's, there is only one easily scriptable one out there, and that's the MacOS. And one can script it with AppleScript, which can listen in on what an app is doing (some apps, at least, including the Finder), and then edit the AppleScript transcript of what went on. One can also consult a scriptable app's dictionary for the commands it recognizes (the Finder, for example, has a rather large one). Of course, one cannot record control statements, but one can put them in, such as looping over a list of files.

Apple's documentation on it is disappointingly sparse, so I've had to buy outside books on AppleScript, and I've had a fair degree of success programming it. However, it is v...e...r...y s...l...o...w, and there are not very many convenient extensions for doing GUI stuff ("display dialog" is rather limited). Just the same, it is more pleasant for a lot of work than C++, because it has a built-in character-string type, as Java does. I've written AppleScripts for such things as cleaning out web-browser caches and composing command files for processing a lot of images on a Unix box.

It may seem that programming is all CLI'ish stuff; consider this C++ example of the canonical first program to write:


#include < iostream.h> 
void main() {cout < <  "Hello, world!" < <  endl;}

A plain-C version would be:

#include < stdio.h> 
void main() {printf("Hello, world!\n");}

But there do exist GUI programming languages, such as LabVIEW from National Instruments. One puts various operators into a window, and connects them with lines to indicate data flow. Thus, to indicate adding two numbers, one would drag two input operators, an addition operator, and an output operator into a window, and then connect the outputs of the input operator to the inputs of the addition operator, and the output of the addition operator to the input of the output operator. LabView recognizes several data types, including arrays, and one can write functions in it that can be called from other LabVIEW programs. Though I've seen some rather fancy software written in it, and it gets a lot of use in data acquisition, it has not caught on for general-purpose use. Another such GUI language to consider is ProGraph, from Pictorius. I once downloaded the 68K version (ProGraph Classic), but the documentation for it was inadequate for me to do very much with it.

There are some special-purpose GUI programming languages for dealing with specialized types of data, such as images. These include such packages as "Khoros" for image processing, from Khoral Research, for various Unixes, "Image Elements" and "Audio Elements" (Image and audio processing, respectively), from Adamation, for the BeOS, and "Batch-It" for image processing, from Gryphon Software, for the MacOS. However, they have such defects as being very expensive (Khoros), immature (Image Elements and Audio Elements), or even crash-prone (Batch-It).

I've also had experience with several text-formatting systems, which may also qualify as programming languages. Unlike WYSIWYG (What You See Is What You Get) word processors, such systems require one to create a source file that contains the text and formatting commands; the text formatter interprets these commands to do the formatting. Over the years, I've used a VM/CMS one (I forget its name; its input files had filetype "SCRIPT"), troff (a Unix one), TeX (Unix, VMS, etc.), and HTML (the World-Wide-Web formatting language). I remember once converting some documents made for troff into ones made for TeX, this required changing superscripts and subscripts from "a sup b" and "a sub b" to "a^b" and "a_b".

Although WYSIWYG systems do seem more technically up-to-date than the aforementioned text formatters, in the fashion of GUI's vs. CLI's, it is easier to create repeated sequences and "macros" with them (in analogy with CLI scripting). Thus, with TeX, one would have some command like \def\me{{Loren Petrich}} and everywhere it saw "\me", it would replace that string with my name. And if I wanted to change the name, I would have to do only one change, instead of having to search through the whole document.

Back to my computer-center page.