Article 6C7Z8 CodeSOD: Double Toss

CodeSOD: Double Toss

by
Remy Porter
from The Daily WTF on (#6C7Z8)

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.

<otter-icon.png [Advertisement] Continuously monitor your servers for configuration changes, and report when there's configuration drift. Get started with Otter today!
External Content
Source RSS or Atom Feed
Feed Location http://syndication.thedailywtf.com/TheDailyWtf
Feed Title The Daily WTF
Feed Link http://thedailywtf.com/
Reply 0 comments