apotheotic(she/they)

  • 0 Posts
  • 16 Comments
Joined 1 year ago
cake
Cake day: July 11th, 2023

help-circle














  • Depends on the environment you’re working in. If you’re doing a lot of collaboration, it might be that you want to choose whichever of the two is more legible (almost always the loop, but perhaps the recursion). If you are in an environment where the most efficient approach is prioritised over readability, perhaps recursion would have a strong case in some circumstances.

    But I think, generally, you need to answer the underlying question, not “recursion or loop”. Can I improve code readability? Is this problem well suited to recursion? Am I just using recursion because it’s elegant? The correct approach will reveal itsself!