by kf6nux · 4y ago · 0 comments
Discouraged doesn't mean banned. It means avoided.
Regarding why, the article speaks to that.
You are right, in some cases, your best option will be cgo. That's fine. That's why it exists. It just shouldn't be someone's go-to anymore than goto is your go-to for flow control. Will you find circumstances for it? Sure. Do you want people to use it unnecessarily?
For HN comment readers that skip citations (I'm not saying you did, just helping the conversation):
First paragraph
> cgo is an amazing technology which allows Go programs to interoperate with C libraries. It’s a tremendously useful feature without which Go would not be in the position it is today. cgo is key to ability to run Go programs on Android and iOS.
Last paragraph
> To be clear, I am not saying that you should not use cgo. But before you make that Faustian bargain, please consider carefully the qualities of Go that you’ll be giving up in return.
I don't see this as devaluing.