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

I believe Mr. Yager's point was not so much about Java generics as it was that determining the type of a container's contents was impossible without manual type checking. I am not he so take that with a grain of salt.

What makes opaque containers a particular form of debug hell is when working in a non-trivial code base. Lobotomizing the one assistant which never tires (the compiler) puts the onus on people to "just know" what is in there (for whatever definition of "there" is at the moment).

Call me cynical, but people are horrible at keeping these kinds of concerns straight.



The built-in types slice and map are type-safe and cover 90% of container needs. If you want to use a non-builtin container such as container/heap and you find yourself casting too often, write one or two little wrapper functions for your use case, which encapsulate your casts. This is also an opportunity to make the wrapper represent the problem domain better.




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

Search: