
How to think when programming in Lisp? - tosh
https://www.reddit.com/r/Clojure/comments/ckha6h/how_to_think_when_programming_in_lisp/
======
taylodl
I see _(if ( < (_* _a b) c)))_ and think why didn't you use _cond_?! :)

~~~
kazinator
(if a b c) translates to, for instance in Common Lisp, (cond (a b) (t c)):
four more parentheses and an extra symbol.

 _cond_ came first; _if_ was invented later for less verbiage in the common
case of testing a single condition, where the consequent and alternative are
single expressions.

 _cond_ is better than _if_ when you find yourself stuffing _progn_ bodies
into the _if_. (if a (progn b c) (progn d e)) -> (cond (a b c) (t d e)).

~~~
taylodl
I'm sorry, I was attempting humor! You're absolutely right though - use _if_
for if-then-else type logic, use _cond_ for testing multiple conditions.
_cond_ corresponds more to _switch_ from the c family of languages.

