3 ms·
> Go does help prevent errors in untested context-free code > snippets... by being really really simple, and not trying > to mash a ton of logic into a si
by kibwen 12y ago
> Go does help prevent errors in untested context-free code
> snippets... by being really really simple, and not trying
> to mash a ton of logic into a single line for no reason.
But there is an example in this very thread of a manually-implemented map-via-a-for-loop from a well-meaning Go user that accidentally underflows into an infinite loop.
This isn't an attack on Go (which I respect as a language for having the temerity to be opinionated, a facet that more languages need to emulate), merely bafflement at your claim that implementing everything anew via bespoke loops is somehow effective at reducing errors.
- NateDad 12y agoYes and that was a carefully constructed example explicitly to show problems with loops.... But underflows in loops are just not a common occurrence, which is why the example works in the first place.
- kibwen 12y agoLikewise, forgetting a `.collect()` call in Rust code doesn't happen, because the compiler will tell you without fail when it's given an iterator but expects an array.
- pcwalton 12y ago> Yes and that was a carefully constructed example explicitly to show problems with loops No, it was an example from my experience and a bug I have had to fix multiple times, as I mentioned. I didn't make it up.
- NateDad 12y agoSorry, yes you mentioned that. Anyway, this is a stupid thing to argue about and I apologize for my part in it.