Hacker News new | ask | show | jobs
by sanderjd 3022 days ago
> You can do that in Go, too--just use interface{}.

This is what I mean by switching back and forth between type-world and no-type-world. If you implement a data type this way, I need to convert your no-type-world (interface{}) data to type-world data at some point after it pops out of your library.

> If you used arrays in PHP, or Ruby, or Python, you can get those--with static typing!--in Go, either with slices for sequential arrays, or maps for associative arrays. I think that satisfies the vast majority of collection use-cases that arise in practical applications of those three languages.

You do often (though not always) see "primitive obsession" in those languages, and Go encourages it even more so due to its only generic containers being the primitives provided by the language.

I don't mean to come off as a Go hater at all. I think it takes the pragmatic side of a ton of trade offs. But I do think that results in some weaknesses that people should be aware of.

1 comments

Can you expand on what you mean by "primitive obsession"?
Here's an article on C2: http://wiki.c2.com/?PrimitiveObsession. There's a bunch more stuff out there too, if you search for it.