• solrize@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    11 months ago

    Do you have a concrete example to ask about? Are you thinking of a particular language?

    Basically, do whatever is most idiomatic in your language. It also depends on what the control flow really looks like. General recursion translates to a while loop where you put stuff on a stack, and the recursive form may make more sense. Tail recursion translates to a jump or a for loop, and the loop is often more idiomatic.