getNWhatever() vs. getNumWhatever() in API

SimTKcore exists as a separate project to provide 'one stop shopping' for SimTK Core software and support, although the software is actually developed as a set of interdependent projects. SimTK 1.0 was released in March 2008, SimTK 2.0 in December, 2009.
POST REPLY
User avatar
Michael Sherman
Posts: 806
Joined: Fri Apr 01, 2005 6:05 pm

getNWhatever() vs. getNumWhatever() in API

Post by Michael Sherman » Mon Dec 08, 2008 3:49 pm

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.

User avatar
Peter Eastman
Posts: 2564
Joined: Thu Aug 09, 2007 1:25 pm

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

Post by Peter Eastman » Mon Dec 08, 2008 6:21 pm

Sounds fine to me.

Peter

User avatar
Michael Sherman
Posts: 806
Joined: Fri Apr 01, 2005 6:05 pm

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

Post by Michael Sherman » Tue Dec 23, 2008 2:27 pm

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.

User avatar
Michael Sherman
Posts: 806
Joined: Fri Apr 01, 2005 6:05 pm

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

Post by Michael Sherman » Tue Dec 23, 2008 2:29 pm

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!

POST REPLY