Contents

Measuring and improving the quality of my notes

This blog started as a text file. For more than ten years I kept short notes in one file, Index.txt, in a Git repository: a title, a link, sometimes a line or two about why it mattered. Later came notes from the repositories I star on GitHub, from issues I open as reminders, and from articles. Today there are 1,432 of them on this site, and more are coming: I have more than 20 other data sources still to process and include, such as bookmarks, podcast notes, notes on my favorite blogs and the books I read.

Short notes are easy to write and easy to forget. This post is about the next step: finding out which notes are good, which ones people actually read, and improving the rest.

Where the notes come from

The 1,432 notes come from four sources, each with its own page:

SourceNotesSinceWhat a note is
Commit Notes5352013the text a commit added to Index.txt in My-Notes, the original text file
Star Notes6762013a repository I starred on GitHub: its description, language and stars
Issue Notes2192020an issue I opened as a reminder in commitit
Article Notes22024an article I published on dev.to

Every note ends with a link to where it came from: the commit, the starred repository, the issue or the article.

What “quality” means today

Every note is graded with five checks, one point each, from 0 to 5:

CheckPasses when
Titlethe note starts with a title, not a bare link
Linkit has at least one well-formed link
Descriptionit has at least 80 characters saying what the thing is or why it matters
Taggedit has its own tags
Cleanno leftover merge-conflict markers, no credential-like lines, no broken links

Today 1,056 notes score 5/5, 310 score 4/5, 65 score 3/5 and one scores 2/5. The check that fails most is the description (216 notes), then tags (203).

Those numbers look good, but they measure form, not value. A note passes when its description is 80 characters long, whatever it says. Notes made from starred repositories pass almost by construction, because their description comes from the repository itself. And nothing in the score says whether anyone looks for the subject, finds the note, or reads it.

Measuring what readers do

So the first change was to start measuring, with two tools that don’t follow anyone around:

  • Google Search Console shows how often each page appears in search results, how often it is clicked, at what position, and for which searches. Nothing runs in the reader’s browser.
  • GoatCounter counts visits per page, including those coming from social sites and chats that search never sees. It sets no cookies, and the numbers stay private: no “N views” under the notes.

Both started counting this week, so for now there is little to see. In two or three months there will be enough to compare with.

All the notes in one table

To look at the notes as data, every note now goes into one table in DuckDB: its title, date, kind, categories, tags, text, links, length and its grade. A small script rebuilds the table from the notes in about a second, so it is never out of date, and SQL does the rest.

That is where the list of notes worth improving comes from.

Improving a Commit Note without losing its history

A note’s text is what its commit added to Index.txt, so improving a note is, again, a commit. The subject says which note it improves:

[update 72621e8]
[update 72621e8] New title [android] -[mobile]

The first improves only the text. The second also gives the note a new title, adds the tag android and removes mobile.

The site then shows the improved text, title and tags. The note keeps its date and its address, so links to it keep working, and the original stays in the history. This also works for the oldest notes, whose text left the file long ago: the update simply brings it back.

The first three notes I improved this way are a 2013 note about an HTC lock-screen sample and a dual-SIM adapter, a 2016 note with two versions of the Agile Landscape poster, and a 2019 one-liner about python -m idlelib.idle. All three were missing a description; two had no tags; one had no link. Now all three score 5/5.

The model behind it

Grades, improvements, links, search results and visits all hang on one thing: the note. This is the data model that holds it together:

flowchart LR N[(notes)] --> U[note_updates] N --> Q[quality_history] N --> L[links] N --> S[signals] N --> P[search_pages] N --> V[visits] N --> A[actions]
  • notes: what each note is and says, and its grade today.
  • note_updates: every improvement, with its new title and the tags it added or removed.
  • quality_history: the grade over time, so improvements show up.
  • links: every link, when it was last checked, and when it was first seen gone.
  • signals: a potential score from what the notes already tell: demand (a starred repository’s stars), content, findability and decay.
  • search_pages and visits: what Search Console and GoatCounter report, per page.
  • actions: the notes to improve, why, and when it was done.

The question I really want answered is a simple join: did improving a note bring readers?

What comes next: finding the leftovers

The plan from here is simple: find the notes with leftovers, the checks they fail, and improve them one by one. 376 notes fail at least one check, so the first job is to ask the table the right questions. My very first question already taught me something about DuckDB.

A list is not a value

I wanted the notes that fail the link check. The failed checks are stored as a list per note, like ['D', 'G'], so, thinking of the IN operator from Oracle and reusing the brackets and parentheses, I wrote:

SELECT id, kind, "source", "ref", "date",
       title, quality, quality_failed
FROM notes
WHERE quality_failed IN ['L'] -- I tried ('L') too
ORDER BY "date";

DuckDB refused it:

Binder Error: Cannot deduce template type 'T' in function:
'contains(T[], T) -> BOOLEAN'

IN asks whether a value is one of the items in a list. Here the value on the left is itself a list, so DuckDB would be comparing a whole list with the letter L. What I meant was the other way around: does this note’s list contain L? That is list_contains:

SELECT id, kind, "source", "ref", "date",
       title, quality, quality_failed
FROM notes
WHERE list_contains(quality_failed, 'L')
ORDER BY "date";

That was my TIL1 of the day: IN looks for a value among the items of a list, and list_contains looks inside a list for a value.

The questions, and how many notes each one finds

Once that was clear, each question about leftovers became one line in the WHERE clause:

I want the notes that…ConditionNotes
fail anythinglen(quality_failed) > 0376
fail the link check, maybe others toolist_contains(quality_failed, 'L')7
fail only the link checkquality_failed = ['L']2
fail the link check, but are not plain noteslist_contains(quality_failed, 'L') AND kind <> 'note'2
fail the link check or the descriptionlist_has_any(quality_failed, ['L', 'D'])223
fail bothlist_has_all(quality_failed, ['L', 'D'])0

The plan

  1. Small lists first: the notes that fail only one check (two of them lack only a link) are the quickest wins: one update commit each.
  2. Then by check: the 216 notes without a real description are the biggest group, and the one that matters most for readers and search results; the notes without tags come next.
  3. Improve with update commits, and rebuild the table: the grades move as soon as a note is improved, and quality_history keeps the before and after.
  4. Check against readers: in a few months, compare the improved notes’ visits and search clicks with what they had before, and see whether the potential score predicts anything at all.

My guess is that the list of notes to improve will be worth more than any prediction. I will write about what the numbers say.


  1. TIL stands for “today I learned”, from the Reddit community r/todayilearned. ↩︎