On Jan 3, 2023, at 10:26 AM, Dan Cross
<crossd(a)gmail.com> wrote:
A few years ago, I was having lunch with some folks from the Go team
and one of them remarked, "you shouldn't write a shell script that's
longer than about 10 lines. Once you do, it's time to rewrite it in a
real programming language." I was a bit taken aback, but they had a
point. I'll note that Go standardized on using bash everywhere.
My number is larger than 10, but it's smaller than 100.
Lord knows I have plenty of things that started as a pipe and-or-for-loop at the command
line, that became a shell script, that grew some arguments, that got beefier, and that I
then rewrote in Perl or Python and cursed myself for not having done it that way from the
start.
The RSP Notebook I mentioned on COFF is about to have its installer--which is a hodgepodge
of shell scripts and Python scripts--rewritten as reasonable Python classes with typing
and test cases and everything, because it's grown enough that it's hard to
understand in its current form.
Adam