ROOT::TSeq::GetSize() or ROOT::seq::size()?
(12 March 2015)Hi,
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?
- Offer both
GetSize()andsize(), one calling the other. - If a class is called
TWhateverit hasGetSize(). Call the classROOT::whateverto signal that is follows the standard library coding conventions, i.e.size(). TWhatever::size()is just fine and not a problem.
I’m leaning towards the second option. Others prefer the first. And you?
Cheers, Axel.