3 ms·
Calm and Rational Discussion of Java
- aggieben 19y agoThe money quote: Java is much like a 100-armed monster, who will put 3 of those arms to work to solve your problem if you very carefully tell it how to use the other 97 arms to masturbate itself.
- nostrademons 19y agoThe irony is that it sounds like he's working with fairly well-designed Java. Most of the problems he mentions have reasons behind them. Just guessing (I'm not familiar with his codebase), but: AbstractEditableTableModel extends AbstractTableModel because the TableModel interface contains lots of methods that you really don't want to have to implement from scratch each time, and AbstractTableModel provides defaults. It implements EditableTableModel because clients of an editable table need additional methods, eg. ones to edit the table. It exists in the first place to factor out duplication between GenericTableModel and MultiTableDataModel. Otherwise, if you discovered a bug in common TableModel code, you'd need to fix both of them yourself. actionPerformed is a method on the ActionListener interface, so you have to name it that if you want to conform to the interface. ActionListener's used all over Java, which may be why actionPerformed is all over his codebase. I'd bet that isHasDeletePrivilege is called from JSF or another framework that relies on JavaBeans conventions. Boolean accessors need to start with "is" to conform to the naming conventions, yet isDeletePrivilege is misleading. Hence isHasDeletePrivilege. Had it been named hasDeletePrivilege, the framework (which relies on reflection to find methods) wouldn't be able to find it. (Actually, I think they can also start with "get" in many frameworks, but then he'd just be complaining about getHasDeletePrivilege.) Personally, I'm very happy I left it all behind for Python, where we (generally) don't have this nonsense. But there's method behind the madness, for those experienced in Java.
- aggieben 19y agoMost of the problems he mentions have reasons behind them...there's method behind the madness, for those experienced in Java. Yup - and the reasons all have to do with fundamental paradigm flaws in Java itself (IMO). As someone who has been permanently scarred by designing and implementing a large J2EE application, his post made me nearly blow a gasket I was laughing so hard.