-
-
Save onealexharms/8570e4237705608e209d to your computer and use it in GitHub Desktop.
| (cond | |
| (includes-failure-message? | |
| (set! message (car args)) | |
| (set! condition (cadr args))) | |
| (else | |
| (set! condition (car args)))) | |
| (cond | |
| (includes-failure-message? | |
| (set! message (car args)) | |
| (set! condition (cadr args)) | |
| ) | |
| (else | |
| (set! condition (car args)) | |
| ) | |
| ) |
The first is more traditional and easier to read for a long-time lisper. IMHO.
To me, the first one is more readable, and I think there's a reason why it should be preferred. If you make your code so complex that the whitespace in the second one is valuable then it needs simplification. To me, that means that the first example provides a back-pressure on complexity that's useful.
I lean toward concision as long as people pay attention to semantics enough to keep code understandable.
In well-written Lisp, you don't have to think about or look at the parens.
The problem with the second example is that it implies that you do.
I'll take the first one, but with consistently-used 2-space indentation. :) I find the almost-blank lines in the second version distracting. I find it easier to clean the structure of the first one.
Taken by itself, I'd give a different answer than if this was a part of a larger body of code.
It's an overall effect that I am usually looking for.