Nick started blogging about headshakers in his blog.
I have my own anecdotes of stories to share, so I'll start with one.
When I was working on the Vehicle Entry Permit (VEP / Toll / ERP) project, one of the things I did was to improve the performance.
And I came across the following segment of code.
Somewhere, a call to SomeProc was made with a string parameter, like so, SomeProc('ThisProcName');
SomeProc is declared as procedure SomeProc(Caller: string).
Inside SomeProc,
If Caller = 'ThisProcName' then // block of code
There were many calls to SomeProc, but only one procedure sets Caller to 'ThisProcName'. All other calls to SomeProc passes an empty string.
And I was thinking, what in the world is that developer thinking? It's basically one of the most amateurish piece of code I've ever seen.
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