Consistent naming for returning the number of something

Issue #602 resolved
created an issue

Currently there is...

  • ParticleSystem:count
  • Channel:count
  • love.joystick.getNum*
  • SoundData:getSampleCount
  • Geometry:getVertexCount‎
  • get*Count in love.physics

Maybe it'd be nice if they were named consistently?

I think get*Count naming is better than getNum* because...

  • You don't have to create the plural of the word, which might not be as simple as adding an "s" to the end, such as with getNumAxes.
  • Not using "Num" means not having to use an abbreviated non-English word. Yay!
  • You don't have to say "num" in your head. It doesn't really have such positive connotations! :D

But I think getNum* is better than get*Count because...

  • It may be easier to visually identify because it's all at the beginning.
  • It may even read more naturally even though it's abbreviated?
  • There is one less character (this is including the "s" for the plural).

I'm kind of a fan of get*Count right now.

I think maybe ParticleSystem:count might be better named getParticleCount/getNumParticles, and Channel:count could be named getMessageCount/getNumMessages. I think these names are more descriptive, and more consistent with the rest of the API. Also names not starting in get/set/is seem to usually be "actions" on objects, at least outside of love.physics. That said, they're concise, and consistent with each other.