4 ms·
That's certainly a concern. The human brain can only track 7±3 things at once, which can make life very hard for some programmers if a function jumps away often
by kamray23 4y ago
That's certainly a concern. The human brain can only track 7±3 things at once, which can make life very hard for some programmers if a function jumps away often.
However, in a well designed functional system, this shouldn't be an issue. You're not supposed to jump into other functions, those functions should be labels for values. Reading `success_api_response(body)` should make you think "the API response for a successful request with `body`, not `{:ok, body}`. Checking the type should only reinforce this view. This is the very nature of good abstractions in a language such as Elixir.
In comparison, a badly designed system of abstractions is one in which you must jump to other functions to understand what they do. If `f` is used as anything but a general function parameter, naming a function `update` with no clear reference to what is being updated, other overly generic names such as `calculate` or `execute` with input types that arent `RPNString` or `Process`.