ping-python icon indicating copy to clipboard operation
ping-python copied to clipboard

API is not consistent, there is snake cases and camel case functions

Open patrickelectric opened this issue 5 years ago • 2 comments

transmitAngle vs transmit_frequency

patrickelectric avatar Mar 20 '20 13:03 patrickelectric

The pattern that I have been using is that variables or functions from ping-protocol messages are done with snake case to match the ping-protocol docs and definitions, this also helps simplify templates. Other things that include extra logic like helper functions to form the api are done with camel case (according to our guidelines). I think it is the same pattern in ping viewer?

here is a link for quick ref https://docs.bluerobotics.com/ping-python/classbrping_1_1ping360_1_1Ping360.html

I agree it's a strange situation, but I don't know if it's a problem.

jaxxzer avatar Apr 14 '20 01:04 jaxxzer

We've decided that language conventions are worth following over a blanket style across all languages, so this can get changed to consistently use snake_case as per PEP8. Breaking APIs is still bad, so unless this is paired with a non-style-based major breaking change it should likely maintain the old calling code as well (perhaps with a deprecation warning).

ES-Alexander avatar Apr 15 '22 13:04 ES-Alexander