emacs-devel
[Top][All Lists]
Advanced

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

Re: Imports / inclusion of s.el into Emacs


From: Lars Ingebrigtsen
Subject: Re: Imports / inclusion of s.el into Emacs
Date: Sun, 03 May 2020 08:52:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> Renaming 'concat' seems also like spurious inconvenience in the name
>> of rigidity -- the Lisp equivalent of bureaucratese.
>
> Funny, I find `concat` a perfect example of a bad name because it
> doesn't say what it is that it's concatenating nor how.
>
> If I try to imagine myself a "fresh new Elisp programmer" I can't
> intuitively know which of `append` or `concat` does what I want.

After giving s.el a cursory look, it seems like it either comes from a
Javascript or a Clojure background, and provides names for common Emacs
Lisp functions that are easier to remember for people with those
backgrounds.

There's nothing wrong with that -- like most people, I hate learning
things, too.  And the number of Javascript/Clojure programmers eclipses
the number of Emacs Lisp programmers by several orders of magnitude, so
it's no wonder that it's a popular library.

But it leads to non-idiomatic Emacs Lisp code.  For instance, variadic
functions aren't common in those languages, so you end up with oddities
like s-prepend and s-append, and if that's what the user thinks is
available, then you end up with code like

  (s-append (s-append (s-append "foo" "bar") "zot") "gazonk")

instead of

  (concat "foo" "bar" "zot" "gazonk")

That is, s.el leads to bad Emacs Lisp code, and I don't think it's a
good idea to have something like that (even with less lodash-like name)
in Emacs.

And I think that, since Lisp is obviously better than Javascript, we
should just tell people to avoid writing Javascript-in-Lisp and instead,
unfortunately, learn some Lisp.  It's better in the long run for everybody.

As for the common "but just add aliases" to everything, I'm agin it.
Programming is 95% reading old code, and having to remember a number of
different names for common functions (and verify that they are really
equivalent) is not a good language culture to strive for.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

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