3 ms·
I don't disagree but it is just one function call. On the other hand: foo1() stuff foo2() would be two function calls. If every function has a helpful name
by cJ0th 11y ago
I don't disagree but it is just one function call.
On the other hand:
foo1()
stuff
foo2()
would be two function calls. If every function has a helpful name then two function calls are more telling than one, no?
Of course the level of desired detail varies with what one does.
@logging might be enough of a hint if the function really does nothing else but write a log entry.
- icebraining 11y agoMore function calls can also clutter the function, rendering the intent harder to understand. The advantage of the decorator syntax is that it stays out of the main logic of the function, which is useful for "side" concerns (like logging, but also authorization, contracts, etc).