Hacker News new | ask | show | jobs
by yencabulator 1099 days ago
> "but WHY is it like this?"

Because, historically, it's been like that all over, it's not just Go. For example, Python has the same loop variable reuse.

Probably comes from a time when compilers were a lot simpler, and all local variables were allocated stack space for the whole duration of the function call.