3 ms·
the purpose of the function should be clear from its name. if its too complex to convey this information it should have a docstring that clearly explains what i
by ikrenji 2y ago
the purpose of the function should be clear from its name. if its too complex to convey this information it should have a docstring that clearly explains what it does. it's not rocket science
- horsawlarway 2y agoNames are jargon. They are themselves their own form of complexity, and they require a similar timeline to become acquainted with. Further - the more of them you need (call depth) the worse this problem becomes.
- apelapan 2y agoIn the general case I fully agree. It is ideal that the name of anything clearly indicates whatever is important about that thing. But who is the viewer of that name? How much context can they be assumed to have? The name of the class? The name of of the module? The nature and terminology of the business that the function serves? The nature and terminology of the related subsystems, infrastructure and libraries? There is a context dependent local optimum for how to name something. There are conflicts of interest and trade-offs have to made.
- skydhash 2y ago> How much context can they be assumed to have? The name of the class? The name of of the module? The nature and terminology of the business that the function serves? The nature and terminology of the related subsystems, infrastructure and libraries? All of this.
- jajko 2y agoYeah, not disagreeing with what you write but parent is talking about different type of complexity which your description/approach doesn't magically fix, I'd call it spread of complexity