3 ms·
>there are 306 mentions of {}interface Would you be happy with a Java project with 306 mentions of Object?
by wyager 13y ago
>there are 306 mentions of {}interface
Would you be happy with a Java project with 306 mentions of Object?
- enneff 13y agoI wouldn't be happy with a Java project with 306 mentions of anything. Go's interface{} and Java's Object not the same thing, nor are they used for the same ends. Eyeballing the Camlistore code I am not distressed by its use of interface{}. It's fine.
- wyager 13y ago>I wouldn't be happy with a Java project with 306 mentions of anything. Please expand on this. >Go's interface{} and Java's Object not the same thing, Yes, they are. They are both the top type. >nor are they used for the same ends. Yes, they are. Did you ever use Java before they added Generics?
- dsymonds 13y agoGo does not have type inheritance, so there's no such thing as "the top type".
- friendly_chap 13y agowyager is right, empty interfaces in Go are exactly that - a type (set) which every value is a member of, search for Go/interface{}: http://en.wikipedia.org/wiki/Top_type http://en.wikipedia.org/wiki/Top_type Edit: the downvoter cares to explain?
- overcyn 13y ago"However, several languages have types in the second regard above (e.g. void * in C++, id in Objective-C, interface{} in Go), static types whose variables can accept any object value, but which do not reflect real runtime types that an object can have in the type system, so are not top types in the first regard." Do you consider void* the same as Java's Object?
- coldtea 13y agoWell, the "all encompassing" type. Or the "variant" type.