ROOT::TSeq::GetSize() or ROOT::seq::size()?

(12 March 2015)


It’s time to resume this blog - on what the ROOT team is up to; what happens at the C++ meetings; and a bit of behind-the-scenes of cling and ROOT.

We have started to develop towards ROOT 7 and its new interfaces. We will have bi-weekly meetings to discuss some of items relevant for our users - we’d love to have you involved as much as possible! If you are curious then please subscribe to the root7-discussion egroup.

Already now, before the first meeting, we have an interesting case: new interfaces should nicely interoperate with the standard library; as such we want them to have members called empty() and size(). On the other hand they are ROOT classes - and you are used to IsEmpty() and GetSize(). And inconsistent interfaces are the worst.

Which of these options do you prefer, and why?

  1. Offer both GetSize() and size(), one calling the other.
  2. If a class is called TWhatever it has GetSize(). Call the class ROOT::whatever to signal that is follows the standard library coding conventions, i.e. size().
  3. TWhatever::size() is just fine and not a problem.

I’m leaning towards the second option. Others prefer the first. And you?

Cheers, Axel.