Colocalisation_Analysis
Colocalisation_Analysis copied to clipboard
Results: simplify the Interface : ResultHandler
An idea from Dscho: "Continue the (good!) idea of ResultHandler, but simplify it first. eg: Why does every method in ResultHandler repeat that it handles something?"
I see what he means: void handleWarning(Warning warning); could just be void warning(Warning warning); but maybe that's too little information as method names should be verbs...
so maybe this one is just a matter of taste... processWarning dealWithWarning showWarning useWarning
or maybe I miss the point...?
void handleWarning(Warning warning);
could just bevoid warning(Warning warning);
but maybe that's too little information as method names should be verbs...
warn()
And, to think, I thought you might not be watching @dscho !!!
Warn() Certainly makes 100% sense! But what about handleResult() ? Why is it so bad to have methods called handle in handler Interface? Does it go against some code style or logical way of thinking? Seems reasonable to me... But then again, I'm no object oriented design boffin.
I thought you might not be watching @dscho
lurking is the more appropriate word here... If I were actually active in this project, your concerns would all be addressed by now :smirk:
Why is it so bad to have methods called handle in handler Interface?
It is a bad habit to acquire. Repetition makes for bugs. Or even tyops. Guess how thrilled I am when I spend about 25% of my bug fix time on completing German-style names? Anyway, I'm going back to lurking mode.
Code should be as easy to understand as possible, so that we can all contribute together. The biggest keys to that are consistency and conciseness. And in this situation, warn
is clearly the best name along those lines.