Scripting problem

Warren Block wblock at
Tue Oct 17 20:45:29 UTC 2017

On Tue, 17 Oct 2017, Frank Leonhardt (m) wrote:
> Interesting debate this. Personally I have always regarded sh as a Job Control Language. Probably showing my age.

I've noticed that job control languages try to fill in for weaknesses in 
the programming languages available on the same system.  Somtimes these 
are just perceived weaknesses.

> As such it's intended for controlling jobs written in 'C' (being Unix). All it had to do is put the data in the right place for input, and arrange for the output to end up where it should. In no way should it be used for implementing an algorithm.
> Now people are trying to write programs in it. Why? I suspect its because people haven't invested the time to learn a programming language, as it's quicker to find some cunning way of perverting the JCL one problem at a time.
> Do spreadsheet macros count as programming? I've seen complete business management systems written in Excel macros. Unmaintainable and flaky, but I'm in awe that anyone did it.
> And if I get too sniffy about the use of structured "proper" languages, I think back to the days of assembler and even machine code. Do the primitive building blocks of assembler count as programming? It's hard to argue otherwise, so therefore the
> primitive building blocks of sh have to count too.
> That said, I was really happy when I could start using 'C' in the early 1980's. The perfect blend of convenience and control of the CPU.
> You do need to invest the time to learn a compiled language like 'C'. Friendly interpreted languages are considered cheaper to use because the staff need less training - or assumed to be. I'm not so sure.

C is really just glorified macro assembler.  Look closely and you'll see 
the bytes.  Like any tool, it is built to do certain things.  It can 
sometimes be used for other things, but does not necessarily do those 
things well.

Writing a program is not that hard.  Modifying one, especially one you 
didn't write, can be a lot harder.  As maintenance can be, and most 
programs require ongoing maintenance.

Higher-level constructs make for less code, which generally makes it 
easier to see on a screen and understand.  And when it's easier to 
understand, it's easier to maintain.

There have been some efforts to polish off the roughest C warts. 
Google and Apple have done this lately, although it looked to me like 
they kept the ugliest parts and polished around them.

The sad thing is that we have a bunch of high-quality open-source 
languages available for free, and people should be picking the language 
based on the problem domain.

It's difficult to change mindspace to match radically different 
languages.  But it often leads to clearer expressions of the algorithm. 
That makes it easier to debug and maintain.  And it can also give the 
programmer different ways of looking at problems.  That is valuable no 
matter which language you end up using.

More information about the freebsd-questions mailing list