proomt

Search

Search posts, papers, and topics

All posts

The Daily WTFRemy Porter1 min readintro

CodeSOD: The John Cage Variable

Summary

This article showcases a C++ code snippet with an extremely unreadable variable name, `length4_3_3`, which is a hardcoded range expression. It serves as a cautionary tale against writing "disposable" code with poor naming conventions, as such code often ends up being reused.

  • Even "write-and-run-once" code often gets pulled into future projects, making initial quality important.
  • Packing parameters into arrays and using indices instead of named variables leads to unreadable code.
  • Variable names should describe content, not how to derive it, like `length4_3_3` which is an expression.
  • Poor naming conventions severely hinder code comprehension and maintainability.

This piece is a reminder for all engineers that even seemingly disposable code benefits from good practices, as shortcuts often lead to future technical debt.

4/10

Related reading

  1. CodeSOD: Extremely One Line

    The article spotlights a legacy ASP.NET page where the Page_PreInit method is crammed onto one line, mixing user‑agent sniffing and magic strings, illustrating how such code hurts readability and maintainability.

    The Daily WTFthedailywtf.com1 min
  2. CodeSOD: Vintage 2013

    A tongue‑in‑cheek post highlighting an absurd GPL header that repeats "2013" dozens of times, questioning the reliability of the surrounding code.

    The Daily WTFthedailywtf.com10 min
  3. Jev-Leftpad

    A joke npm package that pads strings by calling a TypeSafe LLM model, essentially replicating `padStart()` with unnecessary API calls. Not production‑ready and offers no real engineering insight.

    Hacker News front pagegithub.com1 minreleaseHN22987