{
  "id": 5150932,
  "title": "I read my own code from two years ago, here's what embarrassed me",
  "url": "https://urgent.news/2026/09/02/i-read-my-own-code-from-two-years-ago-heres-what-embarrassed-me",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-02T19:11:51.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/ethanpkg/i-read-my-own-code-from-two-years-ago-heres-what-embarrassed-me-51oa"
  },
  "original_language": "en",
  "account": "Last week, the author needed to extract a small utility from an old project they had worked on during their first side product attempt. Upon opening the repository, they spent two hours reading their own code as if it belonged to someone else, and found several instances that embarrassed them. The author presents these embarrassing moments in the order they were found.\n\nFirst, they discovered a function called `validateUser` that performed multiple tasks - validating the user, hitting the database twice, sending an email, writing a log entry, and silently mutating an object passed in from three layers up. None of these actions were mentioned in the function name or comments, as past self believed comments were for others.\n\nNext, they came across a convoluted `processOrder` function with twelve arguments, no types, and no clear naming conventions. The author struggled to understand the purpose of `flag1` and `flag2`, having to open multiple call sites to decipher their usage. They attributed this to the function's gradual accumulation of features, each added to handle a specific edge case.\n\nThe author then encountered a stale comment `// only runs once` alongside a line `setInterval(checkStatus, 5000)`, which ran every five seconds indefinitely. They questioned whether this comment was initially a false hope or a true statement that remained unchanged despite code modifications. Lastly, they found an empty catch block that silently swallowed errors without logging or rethrowing, erasing any evidence of failed database saves during its operation in production.",
  "summary": "Last week I needed to pull a small utility out of an old project, something I built during my first real attempt at a side product. I opened the repo expecting a quick copy paste job. Instead I spent two hours reading my own code from two years ago like it belonged to a stranger, and honestly, some of it did. Here's what actually embarrassed me, in the order I found it. The function that did five…",
  "key_points": [
    "Author found embarrassing code moments from two years ago",
    "validateUser function performed multiple tasks without clear naming",
    "Stale comment // only runs once with infinite setInterval"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}