Once upon a time, a company had several huge Delphi applications. These applications were pretty fundamental to company operations. And then those developers left, as they often do. Which means Darren has inherited multi-decade old Delphi code.
Most of the problems in the code are structural. The average procedure itself is usually pretty okay, but the way they get strung together is an obscene nightmare of kruft. But this little snippet gives us a picture of what life is like here:
try
if not Unzipper.CheckArchive then
begin
raise EBadZipFile.Create('Corrupt Zip file.');
end; {if}
except
raise EBadZipFile.Create('Corrupt Zip file.');
end;
If a zip archive isn't valid, we raise an exception, catch the exception, then raise the same kind of exception with the exact same message.
Why? Presumably once upon a time, this maybe did more? It has the aura of code that changed many times, with once useful segments becoming vestigial. And thus it sat, with probably several developers scrolling past it, perhaps thinking, "I should clean that up someday," but with no one doing anything about it.
<This post originally appeared on The Daily WTF.