3 ms·
I'm sorry, but I fail to see what's wrong about that interface. It's perfectly in keeping with the rest of the Java language. Usin duck typing would be a horrib
by wlievens 16y ago
I'm sorry, but I fail to see what's wrong about that interface. It's perfectly in keeping with the rest of the Java language. Usin duck typing would be a horrible idea, since Java uses interfaces for type information on similar syntactic sugar constructs (the for-each comes to mind).
Sure, one may or may not like Java, but if you're going to add this construct, using an interface like that is the proper way.
- Tichy 16y agoSure, it just seems like horrible clutter. Yes, it is the spirit of Java - a good reason to dislike the language. This article actually made me realize Java is good if you have obsessive-compulsive disorder. Now you can go through your code base and replace all try/catch blocks with this pattern and neatly label your classes with another interface/category. Then everything is in order again - you haven't gained in productivity, but you have introduced more "system" into your world.
- wlievens 16y agoI disagree with the view that introducing more "system" in the code is a waste of time. I do agree with another poster in this thread, that it would be a lot better if these kinds of constructs weren't baked into the language, but were instead specified by macros.