News for hackers. Stuff that matters.
Re:Sum Types in Go by TheHydroImpulse on Friday December 26, 2014 @01:29AM (#8798262)
While I'm not a Go programmer, the reason it should be a code smell is because you lose type safety and incur a run-time penalty cost for using reflections. Perhaps the things people build in Go will make the later point moot, but the former shouldn't.
Re:Sum Types in Go by TheDong on Friday December 26, 2014 @02:38AM (#8798368)
Oh, I absolutely agree it's bad to lose type safety, but you have to realize that go does not give you another option. When you want to do something that takes a "generic" slice, you don't have generics. If you're using reflection, you're already so far out in left field in terms of safety that you might as well just give up on your type safety because you don't have any other safety either.

I fully agree that this is bad, but sicne Go is not a good language it's what you do and thus this is not a code smell in Go, but rather an artifact of Go lacking generics.