Hacker News new | ask | show | jobs
by hyperpape 3660 days ago
Java's stdlib is mindblowing in places.

My favorite is the treatment of iteration. You have immutable collections that support an iterator interface that allows modification and throws a runtime exception (so much for a type system...).

There is an interface that lets you iterate over the elements of something that supports it without allowing removal, but it's not recommended, and it doesn't enable the enhanced for loop that came with Java 1.5: https://docs.oracle.com/javase/7/docs/api/java/util/Enumerat....

It's as if someone said "how wrong can we get this?"