Today's lesson:
For any program you are writing, if you don't have a test for it, you may as well not have written it. By test, I mean an easy way to validate that the program is doing what you think it is doing, and especially that it is saving the information that you think it is saving. The test needs to be easy,so you can repeat it as often as possible after making changes.
If you're programming in Java, I recommend writing JUnit tests. I'll soon be looking into whether C# has an equivalent testing framework.
I also learned today that InputEventArgs.timestamp and Environment.TickCount are measured in milliseconds, while DateTime.Ticks and TimeSpan.Ticks are measured in hundreds of nanoseconds. That's a 10K difference in magnitude, approximately the same as the difference in magnitude between these two lessons. Therefore, this still counts as one (point oh-oh-oh-one) thing I learned today ;)
No comments:
Post a Comment