hainguyen.dev · Permanent collection

Museum of Legacy Code

Six works that have outlived their authors, their tickets and at least two rewrites. All are still running in production. Please do not touch the exhibits.

Refactors attempted by visitors today: 0 · Successful: 0
// TODO: temporary. remove after launch.
if (customer.id === 4471) {
  return legacyPriceV2(order) * 1.07;
}
Exhibit 01

Temporary Fix

Anonymous, since departed. 2014. JavaScript on production.

The launch it refers to happened more than a decade ago. Customer 4471 has never complained, so nobody dares find out what happens without it.

Refactor attempts: 6 · Successful: 0
time.sleep(3)  # do not remove. nobody knows why.
               # it breaks without it.
Exhibit 02

Untitled (Race Condition)

Unknown artist. 2016. Python, one line.

A minimalist piece. Scholars agree the three seconds are doing something. They disagree on what. It was once reduced to two and restored the same afternoon.

Refactor attempts: 11 · Successful: 0
if (isEnabled && !isNotDisabled || forceLegacyMode2) {
    doTheThing(true, false, true, null, false);
}
Exhibit 03

Four Booleans and a Null

Committee work. 2012 to 2019. Java.

Each argument was added by a different team in a different year. The null is believed to be structural. There is no forceLegacyMode1.

Refactor attempts: 4 · Successful: 0
utils.js
utils_new.js
utils_new2.js
utils_final.js
utils_final_v2_REAL.js
utils_old_DO_NOT_USE.js   ← imported by 214 files
Exhibit 04

Still Life with Utilities

Various hands. 2011 to present. Directory listing.

A study in optimism. Every file was meant to replace the one above it. The only one in active use is the one asking not to be used.

Refactor attempts: 9 · Successful: 0
try {
    ProcessPayment(order);
} catch (Exception) {
    // should never happen
}
Exhibit 05

Should Never Happen

Anonymous. 2015. C#, empty catch block.

It happens about forty times a day. There used to be a log line here. It was removed in 2017 for being too noisy.

Refactor attempts: 3 · Successful: 0
#define TIMEOUT 86399  /* NOT 86400. see ticket #312 */
Exhibit 06

The Missing Second

Attributed to a contractor. 2009. C preprocessor.

Ticket #312 was lost in the migration to the current tracker, and was already missing in the tracker before that. The second has never been recovered.

Refactor attempts: 2 · Successful: 0