Documentation fail



  • Working late on some code that requires me to draw lines connecting points on a map. The vertex data I've been handed is in meters, basically offsets from the origin point of the map (0, 0). No biggie, right?

    Well, the documentation for the network message I need to send for the line definition can only accept 29 vertices at a time, which isn't a huge problem as I can just subdivide everything. The bigger problem is that the documentation states this:
        lineRequest->AddVertex(latitude, longitude)


    So I spend a good amount of time converting my meters into real world latitude and longitude values. Not a trivial task, but thankfully there is a utility function that does it for me. However, there are some issues with linking and getting this utility configured, as the data I need for that isn't in the visual system, but instead in the collision system, and the two are running on different computers. Doh!

    So after figuring that out, and getting the latitude and longitude values, I fed them into the line request message and happily fired up the system.

    Huh
    Distinct lack of lines, here...
    Maybe I set the alpha to 0?
    No, it's right. Huh. Maybe the vertices aren't actually being sent?
    Nope. And the data looks good too, no crazy latitude/longitude numbers. Huh.

    Since it's late on a Sunday evening, and I'm the only one here, I can't go find the gentleman who added the line rendering functionality for his input. So, after a few hours of troubleshooting and re-reading the paragraph of pseudo-code that passes for documentation on this functionality, I feed the AddVertex function just raw meters for shits and giggles.

    Great googly-moogly, FREAKIN LINES! And they are in the right spot!

    At least it works now, but man...

    Of course, there's always the possibility that the next release of the renderer will suddenly flip-flop to using latitude and longitude, resulting in my lines breaking.



  • Better leave the code you already developed commented out so that it is easy to switch to it if someone bothers fixing the interface to obey the contract.



  • I liked this story because all the clues were in the first two sentences. It then becomes a tragedy because you can see the terrible conclusion coming.



  • @henke37 said:

    Better leave the code you already developed commented out so that it is easy to switch to it if someone bothers fixing the interface to obey the contract.
    Commented out code is evil, and unless it has only been done temporarily for a local test by a developer, it should be rooted out and destroyed.


  • Discourse touched me in a no-no place

    @OzPeter said:

    Commented out code is evil, and unless it has been done for a local test by a developer, it should be rooted out and destroyed.
    Provided it has been committed once, yes. You can always recover it from the VCS history.



  •  Adding lines to map is hard.  At least you didn't have to add in some sort of spatial reference to the map.  One time we were trying to add drawings to a map, and instead of being in the middle of Iowa, they wound up in northern alaska due to the wrong spatial reference, which there was no documentation saying it needed to be in a certain way.



  • @theBread said:

     Adding lines to map is hard.  At least you didn't have to add in some sort of spatial reference to the map.  One time we were trying to add drawings to a map, and instead of being in the middle of Iowa, they wound up in northern alaska due to the wrong spatial reference, which there was no documentation saying it needed to be in a certain way.

    I've been there. The last time I had to draw stuff on a map, they wanted it using MGRS. That was fun. Everything kept showing up in Denmark.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.