Wrap All The Things

01/11/2015

There are things one can do in code that may look pointless, but come in handy later for their author. Wrapping a variable in a function with a similiar name would be an example.

(defun artist-t-if-fill-char-set ()
  "Return the value of the variable `artist-fill-char-set'."
  artist-fill-char-set)

The excuse here is that an accessor makes up part of an API which must not be changed. Even if it’s debatable how much of an API artist-mode is. But let’s not sweat the small details and look at the abstruse examples instead:

(defun artist-t ()
  "Always return t."
  t)

(defun artist-nil ()
  "Always return nil."
  nil)

(defun artist-arrows ()
  "Say yes to arrows!"
  t)

(defun artist-no-arrows ()
  "Say no to arrows!"
  nil)

Please say no to wholly useless abstractions.