Deadron is a big proponent of writing unit tests and other forms of contract-based programming, so my recent policy was to write full examples and testing code for every possible procedure in my libraries.
My new library, jt_vectors, is your basic mathematical vector library that allows rotation, scaling, reversing, angle calculation, pitch calculation, distance calculation, etc. between coordinates and/or vectors on the map. It's perfect for pixel-based games (I included a section in the documentation on how to convert the library's coordinates into BYOND coordinates) and for accurate physics in BYOND games. Coordinates and vectors are 3D, though you can always ignore the Z coordinate (it defaults to 0), and I provide many convenience shortcuts for people who are only concerned with coordinates on the XY plane.
The library is finished. However, I didn't write testing code at first, being content to write the meat and potatoes of the library first and then write the documentation and tests later. So, I'm writing one great big massive unit test for the library, and it's a huge pain in the ass.
The library works just fine in all of the simple client programs I've used it for, so I think my strategy is going to be not to bother trying to graft in code that doesn't serve any useful purpose any more... this means I'm going to delete the testing code I've written and just finish up the last few lines of documentation before release.
Sorry, Deadron. =(
Feb 2 2007, 8:29 pm
|
|
Nice! =)
|