[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: headings in sh-mode

From: Emanuel Berg
Subject: Re: headings in sh-mode
Date: Sat, 03 Jul 2021 01:11:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Yuri Khan wrote:

>> But honestly... you don't need a header hierarchy like this
>> for a shell script, they should be simple and short (well,
>> as short as possible, and long scripts aren't advanced,
>> really, they are just long).
> This. If your shell script is so long and/or nested that you
> want folding, then you’re much better served by rewriting in
> a proper programming language. My personal rule of thumb is,
> rewrite if you want to do any arithmetics, or arrays, or the
> script no longer fits in a single screenful.
> A similar point goes for other programming languages: If you
> want to fold parts of a function, the part you want to fold
> is a candidate for extraction. If you want to hide some
> functions while looking at others, maybe split your module.
> A working folding facility can be a painkiller when working
> with existing code. But don’t become addicted
> to painkillers.

In so many words, agreed.

underground experts united

reply via email to

[Prev in Thread] Current Thread [Next in Thread]