3 ms·
If you believe that verbosity has a cost and that only the most complex functions should have the privilege if being verbose, it's easy to see a point. Here's
by ParetoOptimal 3y ago
If you believe that verbosity has a cost and that only the most complex functions should have the privilege if being verbose, it's easy to see a point.
Here's a Haskell example:
(+) <$> Just 1 <*> Just 2
Versus:
do x <- Just 1
y <- Just 2
Just (x + y)
I would always prefer the first for something of this complexity because the latter example implies something more complex is happening to me because it takes more space.
If I had something more complex, I'd prefer to factor that operation into functions small enough that the first variation makes sense over using the second.
This does trade "beginner+ can read this quickly" for "some beginners can read this".
I'm of the opinion you shouldn't optimize for "some beginners can read this" because of very diminishing returns.
Instead I aim for "beginner+ can read this" or in some cases "intermediate+ can read this".