Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Marco "Ocramius" Pivetta
@ocramius@mastodon.social  ·  activity timestamp 2 months ago

I'm really puzzled at some #GoLang "conventions":
https://github.com/mholt/archives/issues/3#issuecomment-3212123684

In this issue, a smaller-than-produced-value type is exposed on a factory API: this would make sense if coding defensively, to reduce the API surface, but not here, IMO.

Forcing consumers to do runtime upcasting because of a convention feels wrong, but I'm perhaps missing part of the picture somewhere.

To me, making something "fail at compile time, when wrong" is a massive value proposition for a compiled language.

  • Copy link
  • Flag this post
  • Block
Marco "Ocramius" Pivetta
@ocramius@mastodon.social replied  ·  activity timestamp 2 months ago

Also, perhaps somebody has references about this #GoLang convention, and its deeper reasoning? #go

  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0-rc.3.13 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login