pavelmachek (pavelmachek) wrote,

Units madness

These days I'm playing with Rana openstreetmap navigation. Even while hacking the kernel, I was wondering why programming languages have so bad support for physical units. In kernel, we have long jiffies, long time_in_msec, long time_in_usec, long time_in_nsec... while I always feld we should have jiffies time, msec_t time, usec_t time, nsec_t time; preferably with compiler support to warn and possibly automatically convert...

But situation in rana is much crazier than that. Data comes from location module. Horizontal speed in km/h, vertical in m/s. Ouch. Then it gets converted to knots... because that's what gpsd uses. Double ouch. Rana was written in U.K. .. so it uses mph. But max speed in openstreetmap is... back in km/h. Triple ouch.
  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 1 comment