4 ms·
Yes totally agree and I want to add that it enables us to add docstring or similar where we document the function and expectations of inputs, which can be very
by im3w1l 8y ago
Yes totally agree and I want to add that it enables us to add docstring or similar where we document the function and expectations of inputs, which can be very helpful.
As an extreme case, one time I made a function with a single line that just delegated to a builtin function. But it had 5 lines of docstring explaining what it was doing in terms of business requirements and 5 lines of comments explaining how the builtin function accomplished that.
Before a few changes like this, the mixture of abstraction levels (what I was doing vs how I was doing it) was a big impediment for me. I would stare at the code for hours trying to figure out if it was correct or not and only being able to hold all the complexity in my head at the very peaks of concentration.
But yeah that was an unusual case.