| ▲ | codemonkey-zeta 4 days ago | |
I find that Lisps encourage this behavior more than other languages. Many (most?) of the lisp functions I read have the exact same structure:
I find that this makes skimming lisp code much easier, because I can usually skip reading the bindings and just read the function name and ultimate expression and usually get the gist very quickly.You might wonder how this is different than the example you provided, and the answer is because you could sneakily intersperse anything you wanted between your imperative bindings (like a conditional return statement), so I actually have to read every line of your code, vs in a lisp `let` I know for a fact there is nothing sneaky going on. | ||
| ▲ | ivanjermakov 4 days ago | parent [-] | |
It's the same for many FP/pure languages, where function is a single expression. | ||