all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Wiegley <jwiegley@gmail.com>
To: Drew Adams <drew.adams@oracle.com>
Cc: Eli Zaretskii <eliz@gnu.org>,
	tino.calancha@gmail.com, emacs-devel@gnu.org
Subject: Re: Ibuffer: w and B default to buffer at current line
Date: Sat, 17 Sep 2016 19:18:22 -0700	[thread overview]
Message-ID: <m2shsyj6hd.fsf@newartisans.com> (raw)
In-Reply-To: <c898f8c7-47e5-4870-adcb-f19ffe4b3855@default> (Drew Adams's message of "Sat, 17 Sep 2016 18:45:20 -0700 (PDT)")

>>>>> Drew Adams <drew.adams@oracle.com> writes:

> Trying to find out what you are really saying, and how it might apply to
> Emacs development. You have a strong belief that each function should do one
> thing and one thing well. It would be helpful, if that is to be a guideline
> or if we can learn from it, to flesh out what you mean by it.

> My guess is that what you prefer here is probably something I would prefer
> too, but I'm not sure. The devil, as well as interesting guidelines, are
> likely in the details.

I had expected (naively?) that everyone would want this, since the intent is
to make code easier to learn and to maintain. It's natural to assume that a
function called "string-append" just appends strings, for example. It would be
quite surprising if it had a special behavior when the arguments are both
numbers. I know that some languages applaud this sort of hidden behavior, but
I find it confusing.

But maybe you're right, and I should just wait until there are other, more
specific contexts for me to champion this idea.

The basic philosophy behind "do one thing, do it well" is that a function
named `plus' should just add numbers; and a function called `save-file' should
just save files. If a function were named "dwim-at-point", then it could do
whatever it thinks is appropriate at point.

Since we don't have types in Emacs Lisp to enforce function semantics, we rely
on naming and documentation to figure out what things mean. I find myself
surprised that a function advertising itself as acting on "marked-files",
under some circumstances acts on unmarked files...

I mean nothing beyond this, but this can wait until it becomes clearer over
time. Thank you for your patience, and your interest.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2



  reply	other threads:[~2016-09-18  2:18 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14  5:35 Ibuffer: w and B default to buffer at current line Tino Calancha
2016-09-14  6:41 ` John Wiegley
2016-09-14  7:21   ` Tino Calancha
2016-09-14 14:08     ` Drew Adams
2016-09-15 22:05     ` John Wiegley
2016-09-16  6:40       ` Eli Zaretskii
     [not found]       ` <<83intw5our.fsf@gnu.org>
2016-09-16 14:53         ` Drew Adams
2016-09-17 16:30           ` John Wiegley
2016-09-17 17:21             ` Eli Zaretskii
2016-09-17 21:35               ` John Wiegley
2016-09-17 23:26                 ` Drew Adams
2016-09-17 23:51                   ` John Wiegley
2016-09-18  1:45                     ` Drew Adams
2016-09-18  2:18                       ` John Wiegley [this message]
2016-09-18 14:26                 ` Eli Zaretskii
2016-09-18 19:35                   ` John Wiegley
     [not found]             ` <<83zin630i9.fsf@gnu.org>
2016-09-17 18:47               ` Drew Adams
2016-09-17 19:25                 ` Eli Zaretskii
     [not found]                 ` <<83vaxuib1p.fsf@gnu.org>
2016-09-17 19:33                   ` Drew Adams
2016-09-18 14:29                     ` Eli Zaretskii
     [not found]                   ` <<d33a60f5-b8b6-4637-b3e6-ea1b09d98f85@default>
     [not found]                     ` <<83poo1i8nf.fsf@gnu.org>
2016-09-18 17:55                       ` naming functions [was: Ibuffer: w and B default to buffer at current line] Drew Adams
2016-09-18 19:23                         ` John Wiegley
2016-09-18 23:24                           ` Drew Adams
2016-09-19 16:35                           ` Eli Zaretskii
2016-09-17 18:22   ` Ibuffer: w and B default to buffer at current line Tino Calancha
2016-09-26 12:08     ` Tino Calancha
2016-10-03 12:28       ` Tino Calancha

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=m2shsyj6hd.fsf@newartisans.com \
    --to=jwiegley@gmail.com \
    --cc=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=tino.calancha@gmail.com \
    /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.