4 ms·
@something is a function call and if it is properly named, it should give you a hint as to what it does without scrolling through the source code.
by chucksmash 11y ago
@something is a function call and if it is properly named, it should give you a hint as to what it does without scrolling through the source code.
- cJ0th 11y agoI 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).