4 ms·
Why not allow call-by-name parameters to functions? That would enable library authors to build whatever error handling conveniences they wanted. This feature da
by willtim 7y ago
Why not allow call-by-name parameters to functions? That would enable library authors to build whatever error handling conveniences they wanted. This feature dates all the way back to ALGOL-60.
- Cthulhu_ 7y agoI think you're answering your own question there: > That would enable library authors to build whatever error handling conveniences they wanted What I want from a language - especially if it's, like Go, aimed at really big project - is for it to be opinionated and narrowed in options. That's Bill Kennedy's point as well, they're adding a language level feature so now there's one more way to do a very common thing. And when there's multiple ways to do something, they will all get used. "But what about conventions and code reviews?", you might ask; that's cognitive overload that, if there was only one way, would never be a thing. I mean another feature of Go is that it enforces a certain standard (with tooling and formatters), so that as a development team you should never have to waste time and energy on discussing or arguing about formatting. I'm not against changing how errors are handled now, as long as they're standardized and the One Way to do things.
- willtim 7y agoI respect this position, but we must also recognise that it makes Go less of a general purpose language (as is often claimed) and more a domain-specific language (with the domain being systems/network programming).