{
  "id": 22442484,
  "title": "Your JS README says \"// Foo-Ba-Rb\". The code says Foo-BA-Rb.",
  "url": "https://urgent.news/2026/11/28/your-js-readme-says-foo-ba-rb-the-code-says-foo-ba-rb",
  "topic": "culture",
  "section": "Culture",
  "published": "2026-11-28T20:34:08.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/szabolcskeri/your-js-readme-says-foo-ba-rb-the-code-says-foo-ba-rb-1ab1"
  },
  "original_language": null,
  "account": "The JavaScript README for scule, a tidy string-case utility from the UnJS ecosystem, contains a discrepancy between its code and comment. The convention suggests placing a call to a function, followed by the expected result in a comment on the next line. For instance, camelCase(\"foo-bar_baz\") is expected to return \"fooBarBaz\", but the actual output in the README shows \"FooBarBaz\". However, there is an inconsistency where trainCase(\"FooBARb\") is expected to return \"Foo-Ba-Rb\", but the code outputs \"Foo-BA-Rb\". This discrepancy, along with notes in the README, highlights how documentation can become outdated. The author suggests running automated tests for these examples in Continuous Integration (CI) to catch such issues early. Nevertheless, notes about setup instructions or prose claims cannot be verified automatically and require human or manual checks.",
  "summary": "JavaScript READMEs have a convention Python doesn't: show a call, then put the expected result in a comment on the next line. camelCase ( \"foo-bar_baz\" ) ; // fooBarBaz It reads nicely. It's also an untested claim, sitting right where every new user copies from. In a previous post I ran every >>> example in a Python library's README as a doctest. This time I wanted the same check for the JS…",
  "summary_source": "publisher",
  "key_points": [
    "README shows \"Foo-BA-Rb\" output, code outputs \"Foo-BA-Rb\"",
    "Inconsistency highlights outdated documentation",
    "Automated tests suggested to catch such issues early"
  ],
  "editors_take": null,
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}