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

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

Re: if vs. when vs. and: style question


From: Thien-Thi Nguyen
Subject: Re: if vs. when vs. and: style question
Date: Tue, 24 Mar 2015 08:21:16 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

() Marcin Borkowski <address@hidden>
() Mon, 23 Mar 2015 23:53:02 +0100

   Notice: by “better” I mean “more idiomatic”, or
   “easier/faster to read for a human”, or “more likely
   to be used by an experienced Elisp hacker”, etc.

Personally, i loathe 1-armed-‘if’ expressions; they are a blight
on the smoothness, equivalent to "umm", "err" in a formal talk.
When i inherit code (e.g., EDB), i early-on put effort into
killing those abominations.  (This has the predictable side
effect of introducing bugs, but is anyway useful for
familiarizing myself w/ the code, which in the long run is
better -- especially if those bugs can be recognized and fixed!)

For ‘or’ and ‘and’, i use those very much in Scheme and very
little in Emacs Lisp, and preferentially for pure expressions.
I like (and use) ‘when’ and ‘unless’ for their implicit ‘progn’.

(Insert quote on aesthetics vs principles, here.  :-D)

-- 
Thien-Thi Nguyen -----------------------------------------------
  (if you're human and you know it) read my lisp:
    (defun responsep (type via)
      (case type
        (technical (eq 'mailing-list via))
        ...))
---------------------------------------------- GPG key: 4C807502

Attachment: signature.asc
Description: PGP signature


reply via email to

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