Page 1 of 1

getNWhatever() vs. getNumWhatever() in API

Posted: Mon Dec 08, 2008 3:49 pm
by sherm
Currently the SimTK API uses both "N" and "Num" in method names which return a count of something. I would like to propose that we standardize on "Num" in the next release. That is, we should have getNumBodies() rather than getNBodies().

Does anyone object? If not I propose to rename the offending routines and fix all calls within SimTK Core, but leave the old names as private methods re-implemented to call the new names the way Paul Mitiguy did when he made changes to the Rotation API. That made for easy conversion since the resulting compiler errors lead right to the replacement code.

RE: getNWhatever() vs. getNumWhatever() in API

Posted: Mon Dec 08, 2008 6:21 pm
by peastman
Sounds fine to me.

Peter

RE: getNWhatever() vs. getNumWhatever() in API

Posted: Tue Dec 23, 2008 2:27 pm
by sherm
I've heard no objections, so this change is going in to SimTK 2.0. I'll try to get the new names in earlier as preferred alternates, but the old ones have to stay around for SimTK 1.6 for compatibiliy.

RE: getNWhatever() vs. getNumWhatever() in API

Posted: Tue Dec 23, 2008 2:29 pm
by sherm
P.S. This is now a SimTK coding standard: when we need to return a count of something, we use getNumBlahs() always rather than getNBlahs(). Please tell your friends!