> Except that they don't, as the introduction of generics broke the casting
> operator. You can cast something to ArrayList<Foo>, and even if that
> succeeds, what is returned from its get method may not be a Foo. This kind
> of fuckup is typical for Java.
Java's generics do have a lot of weird corner cases. Things that, as a C++ coder, I would expect to succeed, do not. One example is trying to make a copy of an arbitrary type T using a copy constructor.
Java's generics are flawed. Java itself is flawed. But then, so are many other languages.
> What "big problems" are you talking about? I suspect these "problems" are
> merely something that is being made up by Java fanboys in order to defend
> their emasculated language, because I've never seen an actual problem that
> is fixed with Java's interface approach.
Honestly, I am just going to stop commenting or offering advice on programming languages at all. Even the most simple and basic advice always seems to touch off a flamewar.
Recently I advised someone to stop throwing raw "int"s as exceptions. Result: 15 minute discussion about maintainability, code clarity, stuff experts said, the difficulty of adding all the catch blocks you need to client code, etc. At the end of it: "well, I'm going to keep doing it anyway." Luckily I will never have to maintain, or even see, that code because it's closed source and I don't work at that organization.