On Fri, 26 Mar 2021 10:01:45 +0000, Adrian Caspersz wrote:
> Has anyone seen my straight jacket?
>
Yes, though something I've see recently (a 20,000 line script written
using the Bourne Shell) has left me reeling and gagging and wishing I'd
never see it.
That said, bash is fine for the relatively short scripts I write with it,
but the way that it tends to stop on finding the first error makes it
unsuitable for anything longer than a few tens of lines, in my opinion,
anyway, because the stop-on-error approach makes debugging a large script
very slow unless you writeand test incrementally, which is still slow
going.
The two best scripting languages I've used are the mainframe scripting
language implemented for VME/B the ICL 2900 operating system, and IBM's
OS/400 scripting language, which both have very similar abilities, in
particular:
- very consistent syntax and utility naming conventions: on both OSen you
can reliably guess the name of a utility you've not previously used
though OS/400 muddies this because all names are max 9 characters and it
doesn't use name extensions such as .txt or .html
- VME/B used two names for everything: a long name and and an
abbreviation and the abbreviation formats were equally consistent, so
the deletefile(myfile) command deleted 'myfile' and so did xf(myfile).
You tended to use long names when writing SCL procedures (i.e. shell
scripts) and short names when typing commands into a terminal.
- OS/400 was just carefilr with its horrid short names, but at least if
you knew that if crtcblpgm was the COBOL compiler, crtrpgpgm was the
RPG3 compiler, crtplipgm compoiled PL/1 and crtftnpgm compiled Fortran.
- both compiled their script equivalents (procedures) very fast and had
good error reporting while compiling them.
- both used typed parameters allowed each parameter to be given a type,
name, default value and a short description.
- both had the equivalent of -? or --help but it worked by flashing up
a full-screen display of the procedure name and parameters, showing
type, name default value and description so you just entered your
parameters and hit the 'do it' key.
- both had a well-thought-out equivalent to the Unix/Linux 'apropos'
tool for finding commands by name.
Something like that would be a huge improvement for Linux, especially if
it was somehow possible to agree a more rational set of command names,
but I cant see the latter happening before the heat death of the universe.