|
|
|
|
|
by NateDad
4293 days ago
|
|
People often ridicule what they don't understand. People who haven't written real code in Go don't understand why it's good. And what makes it good isn't that it has X feature, so it's hard to explain to people who haven't used it. Missing generics is not a major problem. Yes, it means you can't write a generic red black tree in the language that doesn't require type-casting. However, for real software solving real problems, you don't often actually need generics. I work on Juju, which is a couple hundred thousand lines of code, consisting of a client and networked servers deployed across an arbitrary number of machines in the cloud. The number of times we might have wanted to use generics in the codebase is approximately 2... and only one of those pieces of code is actually used by more than one type. Sure, some software really benefits from generics. But most of the time, generics just complicate the code with little to no benefit. Many things people do with generics can be accomplished with interfaces and just writing code that has fewer assumptions about the outside world. |
|