Colocalisation_Analysis icon indicating copy to clipboard operation
Colocalisation_Analysis copied to clipboard

Results: simplify the Interface : ResultHandler

Open chalkie666 opened this issue 9 years ago • 4 comments

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...?

chalkie666 avatar Aug 24 '15 12:08 chalkie666

void handleWarning(Warning warning); could just be void warning(Warning warning); but maybe that's too little information as method names should be verbs...

warn()

dscho avatar Aug 24 '15 12:08 dscho

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.

chalkie666 avatar Aug 24 '15 18:08 chalkie666

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.

dscho avatar Aug 31 '15 14:08 dscho

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.

ctrueden avatar Aug 31 '15 17:08 ctrueden