| ▲ | mike_ivanov an hour ago | |
There is plumbing code and there is porcelain code. There is nothing wrong with being clever in the plumbing area, even with other people peeking under the hood. The porcelain side is more nuanced though - it takes a special kind of cleverness to deliver intent with clarity. A personal anecdote - not long ago I saw a beautiful piece of code (not mine) using the Result monad being rewritten as a chain of nested if statements - all because it was "too clever to understand". Go figure. | ||
| ▲ | phoe-krk an hour ago | parent [-] | |
> There is nothing wrong with being clever in the plumbing area, even with other people peeking under the hood. Sure, with proper documentation and comments and enough modularity to refactor this code as necessary - your example of moving between Result and an if-chain is an example of this. | ||