So, I found two friends who are willing to test “My RSS Reader” for me.
Thanks to Jeremy North and David Clegg are due here.
In designing “My RSS Reader”, I've written a new Delphi module (aka unit) that converts between various date/time formats found in blogs.
Due to these diverse formats, and the fact that the date/time routines in Delphi can't handle them properly, I've written my own date/time conversion routines.
In order to ensure that my date/time conversion routines are correct, during runtime, I convert between a few formats, and using Delphi's Assert statement, ensured that my assumptions are correct and will not be violated.
Jeremy and David got “My RSS Reader” from me, and when they ran it...
KABOOM!
The program blew up. My assumptions were wrong. Within minutes of receiving feedback, I fixed the problem. The problem turns out to be a comparison between two TDateTime values. I did a comparison like so: DT1=DT2. Internally, TDateTime is actually a typed alias to the Double type. Julian Bucknall actually wrote something about this (precision arithmetic), and I was going to refer to it via a link, unfortunately, I can't find his article and link right now.
And the solution is simple: Instead of comparing using DT1=DT2, I changed the comparison to SameDateTime(DT1, DT2) which solved the problem Jeremy and David faced.
Thanks, guys!
Article brought to you courtesy of a Solaris 10 x86 workstation
In 2017, with the release of Delphi 10.2 Tokyo, Embarcadero introduced a specialized implementation of the Observer pattern into the System.Classes unit. While it has been in the wild for 9 years, it remains a "hidden" architecture for many, primarily because it serves as the invisible engine behind LiveBindings. Other than live bindings, you can also use the Observer pattern as a way to update component settings to the Windows registry, an .ini file, or persist it elsewhere.
System.Classes