Hacker News new | ask | show | jobs
by int_19h 1347 days ago
What's interesting is that C# 5 release (which made the breaking change) was back in 2012, and both the change and the reasons for it were very widely discussed at the time. This is right around the time when Go shipped its 1.0, and it's kinda surprising that they either didn't look closely at "near-peer" languages, or if they did, couldn't see how this problem was fully applicable to their PL design, as well.

(Note that C# at least had the excuse of not having closures in the first version, which makes scoping of "foreach" moot - the problem only showed up in C# 2.0. But Go had lambdas from the get-go, so this interaction between loops and closures was always there.)

1 comments

Well, this isn't the only language feature where Go designers ignored the path trailed by other languages.

Still looking forward to the day they will discover Pascal enumerations.