Tom Ramcigam (magicmarmot) wrote,
Tom Ramcigam

Guffaw (nerdy)

One of the customer complaints about the previous product was round-off error, where the user would enter a value (say 30 km/h) that would later be displayed slightly differently (say 29.997 km/h) because of round-off error.

Very early on in the project, I mentioned that this error was because the old product used integer math, and we could avoid this problem by internally converting to millimeters (for linear units) and using 64-bit floating point representation to handle the values. This is not only built in to the language, there is a 64-bit floating point coprocessor in hardware, so it's very fast.

Well, they didn't listen to little old me. They spent something like four months and several developers (figure 1.5 man-years) coming up with this complex units system with something like 11 derivative objects with a total of over 200 methods to handle the conversion of data from one unit to another. It still isn't done, and it has been holding up development because it is a core piece that everybody is supposed to use across the system.

I consider this to be a problem. For one, it's holding up the development of the rest of the code. And when I had to cancel my trip to the Bahamas because they aren't letting anybody go on vacation because the project is behind schedule, I get a little frosty.
For another, when I want to do a comparison on a measurement, I have to not only get the measurement (which is a long involved process in and of itself involving data objects, factories, keys, and readers), I have to call the overhead of this whole units system. And considering that several of these measurements are changing at a rate of 200 milliseconds, this is not an insignificant thing.

Yesterday, I argued that it isn't necessary. For my purposes, I don't care whether the distance is measured in inches, meters, or frog butts. As long as the distance is consistent, my code does what it supposed to do. (Yes, I actually had to argue this point with a senior developer on the project.)

Today I wrote a program in half an hour that shows that the 64-bit conversions have no rounding error within the limitations of the system.

Of course, since they have spent so much time and effort developing this units system, it would be a shame not to use it.


I changed my code. I'm not using it.

Shame, shame.

  • (no subject)

    It finally happened. It had to, really. I was in the bottom two cut from LJ-Idol this week. I made it to the top 50, from some rather larger…

  • Mayville

    "Too many bats in the belfry, eh?" The question came from a small man in the scrubs-and-robe garb of an inmate. He looked a little like a garden…

  • LJ-Idol

    Another batch of entries. Consistently amazed at how good the writing is. Voting is open for…

  • 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.