Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The old Java collection APIs were hampered by a lack of generics, so they tend to work in terms of the Object class (basically Java’s equivalent to Go’s interface{} except nominally rather than structurally typed). This means that the type system can’t encode and propagate constraints on the types of objects in collections, forcing casting and other things that lead to runtime errors. I’ve never personally seen a usable collections API in a statically-typed language without generics.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: