I have four variable in a program: xPos, yPos, xVel, yVel
Each one of them should have a setter/getter, but it will be awkward to say:
setXpos()
getXpos()
getXvel()
setXvel()
Is there a naming convention for these variables that is short and efficient?
What you’ve listed in your code snippet is the naming convention.
The more important question is, how can they be reframed for readability? As someone who hasn’t seen your program, the four functions you listed seem perfectly clear to me. I’m having a hard time coming up with something clearer.
Any time you abandon a convention, even if the convention makes things icky, you lose readability/clarity (as people expect those conventions to be fulfilled). You have to weigh the advantage of abandoning an icky convention-result for something better against that loss of abandoning the convention.
All this to say, you have my permission to use ‘getXvel()’. Godspeed. =)