| « Prev | Page 1 | Next » |
|
This is what happens when you don't have proper callback function pointers.
|
|
This is what happens when you develop the Golden Hammer.
|
Re: Classic WTF: Implements ISwissArmyKnife
2007-12-31 08:29
•
by
Andrew
(unregistered)
|
|
Looks like UI code - in which case, it's not so bad. It's a *bold* attempt to try to get Java to behave at least somewhat nicely. henke37 has the right answer.
Not to turn this into a language war, but C# gets it right with delegates and events. |
Re: Classic WTF: Implements ISwissArmyKnife
2007-12-31 08:54
•
by
Mark
(unregistered)
|
|
The real WTF is that there is no real WTF with this post.
|
Re: Classic WTF: Implements ISwissArmyKnife
2007-12-31 08:56
•
by
JonF
(unregistered)
|
|
implements Listener?
|
|
The fake WTF is that it's not using VB.
|
Re: Classic WTF: Implements ISwissArmyKnife
2007-12-31 09:37
•
by
dude
(unregistered)
|
|
The non-sequiter WTF is a dolphin eating cake.
|
Re: Classic WTF: Implements ISwissArmyKnife
2007-12-31 09:56
•
by
sweet
(unregistered)
|
|
The cake is a lie.
|
|
The surreal WTF is a bathtub full of power tools painted orange.
|
Re: Classic WTF: Implements ISwissArmyKnife
2007-12-31 10:09
•
by
dsp
(unregistered)
|
|
The REAL WTF here is that the title of the WTF reads "Classic WTF: Implements ISwissArmyKnife". I see two problems with this title.
First: You've got a syntax error here. "Implements" should be "implements" (no capital i). Second: Prepending an 'I' or any other prefix to indicate a type to a class name or interface is considered bad practice in Java and violates the Sun Java naming conventions. So the real title should be "Classic WTF: implements SwissArmyKnife". |
Re: Classic WTF: Implements ISwissArmyKnife
2007-12-31 10:09
•
by
dsp
(unregistered)
|
|
The REAL WTF here is that the title of the WTF reads "Classic WTF: Implements ISwissArmyKnife". I see two problems with this title.
First: You've got a syntax error here. "Implements" should be "implements" (no capital i). Second: Prepending an 'I' or any other prefix to indicate a type to a class name or interface is considered bad practice in Java and violates the Sun Java naming conventions. So the real title should be "Classic WTF: implements SwissArmyKnife". |
Re: Classic WTF: Implements ISwissArmyKnife
2007-12-31 10:22
•
by
clively
|
The Boring WTF is that someone thinks a different language would have made a difference in the code. |
Re: Classic WTF: Implements ISwissArmyKnife
2007-12-31 10:26
•
by
Tigger
(unregistered)
|
|
Knives not knifes
|
Re: Classic WTF: Implements ISwissArmyKnife
2007-12-31 10:48
•
by
Lars Vargas
|
|
Two problems. Two identical posts. A WTF about the WTF. Makes sense to me! :)
|
Re: Classic WTF: Implements ISwissArmyKnife
2007-12-31 10:50
•
by
Dan Krüsi
(unregistered)
|
|
I have this strong feeling that the implemented interfaces all look something like this:
public interface MessageListener { public void messageRecieved(Message msg); } |
Re: Classic WTF: Implements ISwissArmyKnife
2007-12-31 12:19
•
by
Rob
(unregistered)
|
|
...
How would that make it any better? The problem is clearly that this object has far too much responsibility than it should. 'Proper callback function pointers' won't fix that - only better design will fix that. |
Re: Classic WTF: Implements ISwissArmyKnife
2007-12-31 12:31
•
by
werdan
|
And there is no quack. |
Re: Classic WTF: Implements ISwissArmyKnife
2007-12-31 13:32
•
by
James
(unregistered)
|
|
Still not seeing the problem -- like another poster said, sounds like UI code. You've got your main window in your application waiting for input, like a secretary with 14 phones at her desk. Maybe the design should be split up with multiple secretaries answering smaller groups of phones, but maybe the phones don't ring that often and the 14-line receptionist is the best answer to the problem. Without a bit more body in the "//snip", I can't accept this one as a WTF (yet).
|
Re: Classic WTF: Implements ISwissArmyKnife
2007-12-31 14:10
•
by
A raptor
(unregistered)
|
|
All these listeners and nobody's going to make a joke about women?
Also, the real WTF is that global warming will kill us all and nobody's doing anything about it. |
Re: Classic WTF: Implements ISwissArmyKnife
2007-12-31 15:37
•
by
nwbrown
|
The problem isn't that the developer wrote it this way, its that Java requires it to be written this way. And the fact that people seem to think there couldn't be a better way is one of the best arguments that closures need to be implemented in Java. |
Re: Classic WTF: Implements ISwissArmyKnife
2007-12-31 16:01
•
by
G
(unregistered)
|
|
looks like a very good companion - listens alot and talks nothing
|
Re: Classic WTF: Implements ISwissArmyKnife
2007-12-31 18:40
•
by
Franz Kafka
(unregistered)
|
My minimal fix would involve a bunch of private classes that implement various interfaces and talk to the object in question. But yeah, you gotta split that up a bit. |
Re: Classic WTF: Implements ISwissArmyKnife
2007-12-31 22:35
•
by
Quicksilver
|
|
neither can Java afford the complexity costs of closures currently ...
nor forces Java you to program like this. |
Re: Classic WTF: Implements ISwissArmyKnife
2008-01-01 06:20
•
by
Fatal_Exception
(unregistered)
|
|
Holy responsibility, Batman!
|
Re: Classic WTF: Implements ISwissArmyKnife
2008-01-01 09:55
•
by
Mario
(unregistered)
|
I think the title is in VB.Net ... |
Re: Classic WTF: Implements ISwissArmyKnife
2008-01-01 18:38
•
by
Kerin
(unregistered)
|
|
The REAL wtf is that I'm pretty sure at least a few of you miserable jerks has been with a woman.
|
Re: Classic WTF: Implements ISwissArmyKnife
2008-01-01 22:06
•
by
BillyBob
(unregistered)
|
What's the problem? We're all going to die anyway... |
Re: Classic WTF: Implements ISwissArmyKnife
2008-01-01 22:08
•
by
BillyBob
(unregistered)
|
What's the problem? We're all going to die anyway... |
|
No WTF: radio!
|
Re: Classic WTF: Implements ISwissArmyKnife
2008-01-03 09:57
•
by
Neomojo
(unregistered)
|
(emphasis added) WTF? |
Re: Classic WTF: Implements ISwissArmyKnife
2008-01-03 12:19
•
by
A
(unregistered)
|
|
Am I the only one here who thinks that this looks like Mediator Pattern. Nothing in GoF can ever be a WTF.
|
Re: Classic WTF: Implements ISwissArmyKnife
2008-01-03 13:20
•
by
Patrick
(unregistered)
|
I used that as an attempt to provide some constructive criticism of a coworker's class, and he took it as a compliment. I said to him, "That class does quite alot, isn' that a little bit of a golden hammer?" He goes, "Yeah, isn't it neat!" |
Re: Classic WTF: Implements ISwissArmyKnife
2008-01-03 17:46
•
by
john
(unregistered)
|
...in Soviet Russia Java forces YOU to program!! |
Re: Classic WTF: Implements ISwissArmyKnife
2008-01-04 02:32
•
by
ounos
(unregistered)
|
|
The (small) WTF is that the coder seems to feel obliged to pass "this" wherever a callback is required. Could use anonymous class instances that call back into private methods, not exposed on the api.
|
| « Prev | Page 1 | Next » |