Comments are the part of a codebase nobody measures, because the measurement sounds like it would be used to make an argument about whether comments are good. That is not the argument I am interested in. I wanted to know what the comments in Nakodo actually are: how many, where, in what shape, and whether the shape was a decision or an accident.

582 TypeScript files, 72,683 lines. Here is what is in there.

8.7 per cent, and the tests are the exception

6,307 comment lines of 72,683 = 8.7% 6,058 single line // 101 block comments, every one of them opening /** 67,809 words of comment prose 

Split by what the file is:

Files Lines Comment lines Share
Everything else 520 68,546 6,166 9.0%
Test files 62 4,137 141 3.4%

The test files are a third as commented as the rest, and that is the correct ratio rather than a gap. A test name is a sentence, an assertion is an example, and the only thing left to explain is why a case exists at all, which is what those 141 lines are for.

Distribution across files is lumpy in the way everything in a codebase is lumpy:

134 of 582 files have no comment at all 34 files open with one on line 1 2,581 separate comment runs median run: 2 lines 1,063 runs are a single line 

The most commented files by share are the ones where the code is short and the reason is long:

46.5% src/lib/stripe/managed-payments.ts 101 lines, 47 of them comment 43.6% src/lib/publisher.ts 172 lines, 75 of them comment 22.0% src/db/schema.ts 1,266 lines, 278 of them comment 

The first of those is 26 continuous lines explaining what a merchant of record is, which tax rules make it necessary and where it is switched on, sitting above about fifteen lines that do it. I wrote the comment first and the code second, and if I deleted the comment the code would be indefensible rather than merely terse.

The second one is checkable from outside, which is rare for a comment. publisher.ts is 172 lines of which 75 are a block explaining that the file holds the company and the sibling apps, that the data is identical in five repositories apart from one constant, and that the agreement between those copies is the entire point. Its output is rendered on our about page, so you can read the claim and then read the page it produces and see whether they match.

67,809 words, which is a number worth sitting with

A separate measurement of this project counted 124,795 words of visible prose across all 76 pages of the public website: every guide, every glossary entry, the privacy notice, the lot.

So the comments in the source are 54 per cent as long as the entire published website.

I did not expect that and I am not sure how to feel about it. The defence is that they are not the same kind of writing: the website explains a product to someone deciding whether to use it, and the comments explain decisions to whoever next has to change one. The other way to read it is that a project has one total writing budget and I have been spending half of it on an audience of one.

The top of the first-word distribution says which kind it is:

546 The 294 A 134 ---------- (a section banner, more below) 95 What 60 One 49 How 43 Every 

The and A lead because the overwhelming shape is a noun phrase describing a thing: "The branch Alcy perches on", "A website shared by more than three places". Only 39 comments in the whole repository contain the word "because", which surprised me, because explaining why is supposedly the only legitimate use of a comment. What they do instead of saying "because" is state the constraint as a fact and let the code underneath be the consequence.

One TODO

$ grep -rnE '\b(TODO|FIXME|XXX|HACK)\b' src | wc -l 1 

In 88 commits and 72,683 lines. This is the statistic in the census I would defend hardest, and it is not discipline. It is that a TODO in a solo repository is a lie: there is no backlog grooming meeting, nobody else is going to find it, and a note to yourself inside a file you may not open for six months is strictly worse than a line in a list you read every week. So the things that would have been TODOs are somewhere else, and the comments are left to describe what the code does do.

If you want one cheap signal for whether a codebase's comments are maintained, count the TODOs and compare it to the age of the project. A high number is not laziness, it is a sign that comments are being used as a task tracker, and task trackers that nobody reads rot in a way that prose does not.

101 block comments, zero tags

Every block comment in the repository opens /**, which is JSDoc syntax. The number of JSDoc tags in the repository is zero:

$ grep -rnE '@(param|returns|throws|see|deprecated|typedef)\b' src | wc -l 0 

That looks like cargo culting until you see what the blocks are attached to:

/** Centre of the head circle; poses tilt the head around this point. */ export const HEAD_X = 41; export const HEAD_Y = 29; /** * How Alcy's ochre areas (breast and cheek stripe) are drawn. They are the * spot in every pose except when a prop owns the spot; then they turn to * hatching, as they would in a one-colour print. */ export type Plumage = "spot" | "hatch"; 

They are not documenting functions. They are documenting constants and types, where there are no parameters and no return value to tag. 40 of the 101 are in the illustration components, where the exported values are coordinates on a drawing grid and the comment is the only thing that says what a number means. 27 more are in the content registry's types.

The reason to use /** rather than // for those is purely editorial in the literal sense: a /** block is picked up by the language server, so hovering Plumage anywhere in the project shows the paragraph, and hovering HEAD_X shows why 41 is 41. A // comment on the line above gets you nothing in the hover. That is the whole benefit, it is a real one, and it has nothing to do with generating documentation, which we do not do.

So the rule that emerged without being written down is: // for explaining code to a reader who is looking at it, /** for explaining a name to a reader who is somewhere else. I have now written it down.

134 section banners

// ---------- Campaigns ---------- // ---------- Skipping ---------- // ---------- Fit notes ---------- // ---------- Outreach ---------- 

134 of these, in 48 files. They appear when a file passes roughly 300 lines and stops being a thing, becoming a place: the biggest server action file has four of them, and so does the schema.

They are the comment type I am least comfortable with, because a banner is almost always a file asking to be split. The counter-argument I keep accepting is that some of these files are groups by necessity (every Server Action for one screen has to be in one module), and in those cases a banner is genuine navigation.

The compromise I have landed on is that a banner is allowed when the file cannot be split and is a warning when it can. 48 files is more than I would like, and the honest answer is I have not been through them to decide which is which.

Seven em dashes

A rule we hold on this project is that no em dash appears in any text a customer reads, on the site or in an email, because it is the clearest single tell of machine-written prose in 2026. A test enforces it over the content registry, as one entry in a list of banned patterns, and you can check the result on any content page, for instance the engagement rate guide:

const BANNED = [/\u2014/, /\u2013/, /\bsupercharg/i, /\bseamless/i, /\beffortless/i, /game-changing/i, /\bAI-powered\b/i, /!/]; 

In the source itself there are 21, and the split is instructive:

 7 inside comments 14 inside JSX, every one of them a placeholder in an admin table cell 

The 14 are {value ?? "\u2014"}, written as the literal character, which is a typographic choice for "this account has no name", in a screen only I can open. The 7 in comments are me writing prose in the register I write prose in when nobody is enforcing anything.

That is a tiny finding and it is the one I like most, because it shows exactly where the rule's boundary is: the ban is a rule about published text, it is enforced by a test over published text, and it stops at the edge of the thing the test can see. The right answer is not to extend the ban into comments. It is to notice that an unenforced rule gets obeyed about a third of the time even by the person who wrote it.

What I am changing

  • Write the // versus /** rule into the project's conventions, since it already exists in behaviour.
  • Go through the 48 banner files and split the ones that can be split.
  • Leave the single TODO. It has a date in it.
  • Nothing about the ratio. 8.7 per cent is not a target I set and I would not know what to set it to, and the only files I have ever regretted the comments in are the ones that had none.

If you want the census for your own project, the whole thing is about forty lines of Python: walk the files, track whether you are inside a block, and count. The two numbers I would look at first are the TODO count against the project's age, and the comment share of your test files against everything else. Both told me something about how the project is actually worked on that no amount of reading the code would have.