Raph wrote: 1. Not checking error codes. Virtually all invocations of functions or commands should be of the form of: status = invocation(...); if (status) { cleanup() }
UGH! In some ways I agree with you about code reuse, but after reading comments like that it makes me remember why I never use C anymore, in favor of Java. I could live without almost all of its features, but I can't imagine writing code without exceptions anymore. You can still be lazy and write bad code - just catch and discard all exceptions at the top level - but you have to work at it. And instead of having every useful line of code be followed by 3 lines of checking status, you can put it all in the exception handler.
I wish that it were possible to do real work in Java without resorting to non-free software, though... For my day job, I'll settle, but not for hacking. I look forward to the day when Kaffe, Classpath or libgcj are really up to the level of Sun's implementations and I can ditch that proprietary bulls**t. Unless Sun follow their StarOffice announcement with another one...
I don't think the other aspects of Java are completely useless, but I do agree that they're no kind of silver bullet. I find that (implementation) inheritance is most useful within a single project - making inheritability a part of your public interface is much harder than it looks. Even Sun's collections API, with its Abstract* objects which are designed to be inherited from, has problems here... you need to know altogether too much about the implementation of each method to know exactly what functionality you must override for your specific implementation. For example, if you override add(Object), will addAll(Collection) know to use your version, or is addAll implemented its own way? What about delete(Object) versus clear()? The issue is compounded by the way they handle threadsafety, which is far too complex to explain here, but isn't documented nearly well enough to understand exactly what you need to do if, for example, you can provide an optimized addAll().
Generics (real generics, not bloat-inducing templates) would really help java too, and a complete rethink from scratch of all of the core APIs. But the language itself is pretty nice for avoiding the more basic kind of quality pitfalls, and some of the APIs are too.
