all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuri Khan <yuri.v.khan@gmail.com>
To: Emanuel Berg <moasenwood@zoho.eu>,
	help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: headings in sh-mode
Date: Sat, 3 Jul 2021 03:02:57 +0700	[thread overview]
Message-ID: <CAP_d_8U34BzR+JocYPG+Fb1f+_5mufyN3mEEQvb-_8Vva4KmPA@mail.gmail.com> (raw)
In-Reply-To: <875yxsefab.fsf@zoho.eu>

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.



  parent reply	other threads:[~2021-07-02 20:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-02  1:46 headings in sh-mode lisa-asket
2021-07-02  2:07 ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-07-02  3:13   ` lisa-asket
2021-07-02 13:52     ` Stefan Monnier
2021-07-02 17:54       ` lisa-asket
2021-07-02 18:34         ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-02 19:58           ` lisa-asket
2021-07-02 20:44             ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-07-02 20:56               ` lisa-asket
2021-07-03  1:08                 ` Stefan Monnier
2021-07-02 20:02           ` Yuri Khan [this message]
2021-07-02 20:32             ` lisa-asket
2021-07-02 23:11             ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-02 20:43           ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-07-02 20:53             ` lisa-asket
2021-07-02 23:14               ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-08 20:56               ` Nick Dokos
2021-07-02 23:13             ` Emanuel Berg via Users list for the GNU Emacs text editor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAP_d_8U34BzR+JocYPG+Fb1f+_5mufyN3mEEQvb-_8Vva4KmPA@mail.gmail.com \
    --to=yuri.v.khan@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=moasenwood@zoho.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.