Next: , Previous: , Up: SEL Coding Standards   [Contents][Index]


D.10 Don’t use superfluous let or let* bindings

Any let* which can be changed to a let should be changed to a let.

Typically, if a let-bound variable is only used once it should not be bound but instead its definition should replace its sole use. This is suggested because each variable binding forces every subsequent reader to perform a dereference. For example, this

(let* ((subject (quick brown fox))
       (object (lazy dog))
       (sentence (The subject jumps over the object.)))
  sentence)

is harder to read than this.

(The quick brown fox jumps over the lazy dog)

There are some exceptions to this rule.