re: Go Outta Here VIEW POST

FULL DISCUSSION
 

The first few times I looked at Go, I felt almost exactly the same way. Then I changed job and there was quite a lot of existing Go code, with more to come. So I tried to get into it more and I like it well enough nowadays, at least for our given use case (small networked services with very little business logic).

That said, most of your criticisms have merit, and I'd be happy to see generics, higher-order collection methods and other things that one came to expect from programming languages since the 1990s.

Maybe the only point I'd like to argue is that interface{} makes Go less statically typed. Unless of course you'd say the same about Haskell due to the existence of unsafeCoerce, which apart from having a better name has the same problem, i.e. "if you use this function, it is your responsibility to ensure that the old and new types have identical internal representations, in order to prevent runtime corruption." But maybe that just tells us more about the usefulness of static type systems outside the theoretical realm... ¯\(ツ)

Anyway, not trying to convince anyone to use Go, it does have its problem. It just also happens to be a reasonably good hammer for the particular nails I'm dealing with at the moment, so it was easier to overcome my own preferences than to change the minds of many people around me.

 

maybe that just tells us more about the usefulness of static type systems outside the theoretical realm... ¯(ツ)/¯

Oh yes. I even explicitly made this a separate comment. Oh yes.

There is literally nothing more overvalued for no reason than the static reach type systems outside the theoretical realm.

 

It just also happens to be a reasonably good hammer for the particular nails [...]

Well, it’s Turing-complete (thank God :)

I can actually write the code in almost any language without whining and blaming the language—and I do sometimes. The main point is there are many blatant design mistakes that could have been avoided even in the frames of the chosen paradigm.

unsafeCoerce

I disagree. unsafeCoerce explicitly tells “I know this type should be used here instead of that type.” That is not the same as “ok guys, here we accept whatever crap.”
Also, the help on it starts with wording “highly unsafe.”

 

I can actually write the code in almost any language without whining and blaming the language—and I do sometimes.

A sign of maturity. Or resignation. ;-)

there are many blatant design mistakes that could have been avoided even in the frames of the chosen paradigm.

Maybe from their perspective it's a feature and not a bug? I believe — and of course I have no proof for that — that Go was mostly designed around ease of language/runtime implementation.

unsafeCoerce explicitly tells “I know this type should be used here instead of that type.” That is not the same as “ok guys, here we accept whatever crap.”

Fair point. If we ever have the need for an interface {} in our code base I'll make sure to give it the appropriate alias: play.golang.org/p/016kenwRi6K

code of conduct - report abuse