Re: [Fwd: Re: Wikipedia criticism about root]

From: Sebastien Binet <binet_at_cern.ch>
Date: Mon, 10 Jul 2006 19:49:57 -0700


Hi there,

> On Thu, 29 Jun 2006, Andy Buckley wrote:
> > I'm glad that bug fixes are being fed back into ROOT rather than fixed
> > "locally" on a per-user or per-experiment basis. At least I hope that's
> > what's happening! :) There are certain "bugs", however, like the class
> > design, UI etc. that cannot be fixed by outside parties: those will
> > require a design and development effort, at least by the core team who
> > (by definition) do have the time to work on it.
>
> Hi Andy and ROOTers,
> let me add a few words here. Since a few years I do data analysis with
> ROOT, so using trees, histogramming, statistics etc.
> 1)
> My experience with feed back is very positive - at least concerning
> bug fixes in TH-statistics.
> 2)
> But the inheritance tree of the histograms is really annoying. Many times
> I have to check the input of a routine:
>
> void MyMethod(TH1 *hist)
> {
> if(!hist || hist->GetDimension() > 1) {
> this->Error("MyMethod", "not implemented for %d-D hist",
> (hist ? hist->GetDimension() : 0));
> return;
> }
> // ...
> }
> which is really a bit ridiculous in a type safe lamnguage like C++.
I completely agree.
This is a good example of the bad THx inheritance tree. I guess that this inheritance tree is as it is for historical reasons (CINT?)...

I don't see the "is-a" relation between TH1 and TH2. To me a TH2 can't really be seen as a specialization of TH1. At best, from the mathematical point of view, it could be seen as a generalization (and hence TH1 should inherit from TH2: but it isn't satisfactory either...)

For a better explained example:
http://www.parashift.com/c++-faq-lite/proper-inheritance.html (Mostly from sections 21.6 to 21.9)

In this respect, I think it is fair to say that the AIDA::IHistogram inheritance tree is "better" (if we define better by: "does not allow user to do dumb things [or less dumb things] so the user won't be surprised by what her program actually does") Maybe not perfect (point me at the perfect software, please) but IMHO a better solution as far as histogram design is concerned.

Cheers,
Sebastien.

-- 
###################################
# Sebastien Binet                 #
# Lawrence Berkeley National Lab. #
# 1 Cyclotron Road                #
# Berkeley, CA 94720              #
###################################
Received on Tue Jul 11 2006 - 04:50:06 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:59 MET