Let's start a war in here

@LukeAlmighty Would I be right in saying for loops can be optimised since the number of iterations can be known beforehand whereas while loops cannot?

@thatbrickster
I'm not sure about that. I believe, that you can change the iterated variable from inside the for loop.

@LukeAlmighty Disgusting. I instead vote for a third option, recursion.
Follow

@thatbrickster @LukeAlmighty Compilers often do tail calls to "unwrap" it into whats basically a for loop anyway if your function doesnt require any added stack space, and if it does, good luck

· · Web · 0 · 0 · 0
Sign in to participate in the conversation
Game Liberty Mastodon

Mainly gaming/nerd instance for people who value free speech. Everyone is welcome.