The Daily WTF's summer rerun mines a classic: an interface that abandons abstraction for enumeration. Christian, a German developer, encounters ITableSelector in the codebase—a C# interface declaring 31 individual methods to select different tables. Rather than a parameterized approach (selectTable(int tableNumber)), the designer hardcoded selectTable1(), selectTable2()... all the way to selectTable31(), with some tables splitting into variants (selectTable4a, selectTable4b, selectTable14a through 14d).
The offense is textbook design failure: the interface locks in table names at compile time, eliminates type safety, and makes adding a 32nd table require a contract rewrite. It's the opposite of the Open/Closed Principle. The code screams for a single method accepting a table identifier—or better, a proper abstraction layer.
Christian's coined term, quäl-kot (torture-code), is apt: this is the kind of structure that makes maintenance a permanent hostage situation.
Comments
No comments yet — be the first.
Open the discussion
No account or password needed — just enter your e-mail and we’ll send you a one-time sign-in link. First time here? You’re set up automatically.
Your rating will be applied automatically after you sign in.
Check your inbox
We’ve sent a sign-in link to …. Open it on this device — this tab will sign you in automatically.
Nothing arrived? Check your spam folder — and mark the mail as "Not spam" so it lands in your inbox next time.