fiji / Colocalisation_Analysis

Fiji's plugin for colocalization analysis
http://imagej.net/Coloc_2
GNU General Public License v3.0
24 stars 18 forks source link

Results: simplify the Interface : ResultHandler #39

Open chalkie666 opened 9 years ago

chalkie666 commented 9 years ago

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

dscho commented 9 years ago

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()

chalkie666 commented 9 years ago

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.

dscho commented 8 years ago

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.

ctrueden commented 8 years ago

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.