logoalt Hacker News

HappMacDonaldyesterday at 1:08 AM0 repliesview on HN

I won't badmouth your preference of one form of iteration over another, but I don't follow what you're trying to say about what functions do.

It's not clear if you mean "the functions that you write" or "the functions that other people (library providers? Colleagues? Juniors?) write.

The functions you write do what you tell them to do. If you don't tell them to recurse, then they don't. If you do tell them to recurse, then that has whatever frame optimization or boundedness guarantees that you bake into it (which is the same responsibilities you take on writing a loop just packaged in a slightly different form).

The functions black-boxed by a library aren't something you have a lot of control over, nor in most cases are those black boxed by colleagues. Your concerns sound as though they target these cases, though your preferences really have no traction here.