help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: headings in sh-mode


From: Yuri Khan
Subject: Re: headings in sh-mode
Date: Sat, 3 Jul 2021 03:02:57 +0700

On Sat, 3 Jul 2021 at 01:34, Emanuel Berg via Users list for the GNU
Emacs text editor <help-gnu-emacs@gnu.org> 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.



reply via email to

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