Hacker News new | ask | show | jobs
by uriel 5523 days ago
> However, from wikipedia: "Of features found in C++ or Java, Go does not include type inheritance, generic programming, assertions, method overloading, or pointer arithmetic."

For many people (including me) the lack of all this "features" is a feature in itself. I certainly have not missed any of them.

2 comments

You don't miss generics? In my limited time working with Go, the lack of generics felt like a glaring hole in the language. That said, maybe that feeling goes away as you spend more time with Go, and perhaps learn to program it more idiomatically.
Go has generics, but only for the built-in chan, map, and slice types (and the associated operators). Since the majority of uses of generics (at least in my code) are from containers, this results in me not really feeling the lack too much. Interfaces and reflection cover most of the rest, though not ideally. After using Go for a while, I'm not yet sure if the lack of user-defined generics are a bug or a feature. It limits your expressive power a bit, yes, but it also makes the world so much simpler.
Between interfaces and the builtin generic types, I have never missed generics (specially since append() was added to the language), and that seems to be the experience of most people that have used Go for a while.

Still it probably would be nice to have them some day, but it is worth doing right and not worth sacrificing the current simplicity and elegance of the language.

I miss the occasional pointer arithmetic in string manipulations. But that's all I miss of the mentioned features.