• 0 Posts
  • 32 Comments
Joined 1 year ago
cake
Cake day: August 14th, 2023

help-circle







  • IMO factory functions are totally fine – I hesitate to even give them a special name b/c functions that can return an object are not special.

    However I think good use cases for Factory classes (and long-lived stateful instances of) are scarce, often being better served using other constructs.













  • wanted to add something to the end of a for-loop, but had too little indentation

    To address this, I prefer reducing length & depth of nested code, so the for/while is rarely ever not visible along with everything inside it. Others have success with editors that draw indentation lines.

    opening up new/anonymous scopes

    I occasionally use Python nested functions for this purpose