`interface{}` isn't anything special, or something akin to `void*`. Interfaces are a core part of the language, and `interface{}` is just the literal form for an "interface with no methods", which happens to match anything since all types can fulfill an empty method set. It's no different than using this `Something` for exmaple:
type Something interface {
}It however does pass the type checking to run-time instead of compile-time, which is a trade-off that some feel is worth the language simplicity.
That's absolutely still loosing type safety. Reflections don't substitute type safety.
I also wouldn't consider Go type assertions to be in the same class as reflection. A type assertion is the way you extract and check the underlying type from an interface, and is quite common even when using more complex interfaces. There's also no way to make use of the underlying type from an interface without first asserting it as that type.
As a former C# developer I would agree that life got easier with the introduction of generics, but you can develop the exact same software with and without generics.
Generics can drastically reduce the time required to implement features because less time is spent on re-implementing (nearly) identical algorithms for different data structures and more on simply using them to write something that works.
The cost paid for this is usually in the form of minor efficiency hits because data-specific efficiencies aren't exploited.
Also, consider me complaining about C's lack of generics. It is in fact the primary reason I prefer C++. If C had robust generics with reasonable syntax I'd strongly consider using it instead of C++.
And as somebody who developed in Java and C# before generics, those languages were awful before those features were added.
For the kind of work we do in 2014, yes.
People who would complain already know not to bother using C.
Because generics are important.We're not talking about crazy C++ templates here but a more rigid feature that would still make Go language more expressive.
Or why expose this interface {} feature and allow people to use it in a statically typed language?
People who chose Go obviously want type checking (along with CSP that makes go so awesome), or they would be using something else.