Foundcraft

Rebuilding a Ten-Year-Old Site

What survives a decade, and what quietly rots.

What survives a decade, and what quietly rots.

This is seed content. It is long enough to exercise the excerpt, the reading time, the contents list and the list views without pretending to be real writing.

Where it started#

Every project has a moment where the shortcut stops paying for itself. Ours arrived with a query nobody could explain, in a file nobody had opened in a year.

The cheapest code to maintain is the code you can read at a glance.

What we changed#

Three decisions, in the order we made them.

  • One decision
  • Another decision
  • The thing we reverted

The part that mattered#

Writing it out by hand meant we could see the cost. See the approach for the longer version, or the PDO manual for the mechanics.

SELECT c.title, COUNT(*) AS comments
  FROM content c
  JOIN comments m ON m.content_id = c.id
 GROUP BY c.id
 ORDER BY comments DESC;

What it cost#

ApproachLinesQueries
Before24018
After963

Would we do it again#

Yes, and sooner.

Chris Lever

Chris Lever

Foundcraft

I help small businesses get found and look like they mean it. If something here raised a question about your own site, tell me about it.

0 comments