It happened that at that same company there was a single really sharp programmer named Haim Zamir who was so religious about writing correct C++ code that he coded an algorithm that got better results if it could use more memory (this was on a Mac where programs run in fixed memory allocations and might not have virtual memory), but the memory usage depended in a very complicated way on some input parameters so it really wasn't possible to predict ahead of time how much memory would be used.
So he implemented his algorithm so that it could throw exceptions anywhere without leaking, and just kept retrying repeatedly, starting with the "highest quality" setting, catching exceptions, turning down the quality and retrying until he could run all the way through. Can your code do that? Mine can't, not yet, but I'm determined to get there.
[I found this posted on a former colleague's web site. Thanks for kind comments, Mike.]
And elsewhere on the same site:
Thanks to Haim Zamir of Live Picture for pointing this out to me - I've lost touch with Haim over the years but anyone who should happen to encounter him should tell him I think he's one of the best programmers I've met.
Your code was EXTREMELY helpful.
It actually works better than what I wrote using while loops and even after I condensed it using the pointer model you gave me, yours still has a certain CACHET - that I could not hope to match.
I am a little jealous that you can rip this stuff off so fast when I already spent 2 days on the thing.
Rob: I've got to hand it to you, Haim, you did a great job. You shipped on time. But did your team enjoy it?
Haim: I'm sure everyone shares in the satisfaction of a job well done. Besides, was that in the spec?
Great catch, Haim!
[He actually said that when he threw me his wallet. I'll have to ask him for something more substantive.]
One day, he'll be dangerous.
[Context: This was actually meant as a compliment, and it referred strictly to the power of my code. I had just written an object oriented windowing system, an advanced user interface framework, and a high-end broadcast video paint system.]