I like conventions. I like having pointers for all the minor decisions, like "what do I name my test folder?" so that I don't have to think about it each time. I also want to match what others would expect the test folder to be named. Conventions are a great way to satisfy these two criteria. But where are those conventions written down? They often aren't. This is my personal log of all the times I've asked "what do I name something?" or "what's the preferred way to do something?" and found an answer that I want to remember.

Is it rust-toolchain or rust-toolchain.toml?

  • rust-toolchain.toml 8.6k
  • rust-toolchain 2.6k

What name for my WASM repository that needs disambiguation?

What name for my Go repository that needs disambiguation?

What name for my C++ repository that needs disambiguation?

What name for my Rust repository that needs disambigation?

What name for my JavaScript repository that needs disambiguation?

What name for my test code folder in a JavaScript (not TypeScript) project?

Note that this is a different convention (test/) from TypeScript projects (tests/).

What name for my test code folder in a TypeScript (not JavaScript) project?

Note that this is a different convention (tests/) from non-TypeScript JavaScript projects (test/).

What suffix for my test code files in a JavaScript project?

  • *.test.[jt]{sx,x} 4.6M
  • *_test.[jt]{sx,x} 293k

What name for my test code folder in a C++ project?

.yaml or .yml for GitHub actions workflows?

.yaml or .yml in general?

.Equal() or .Equals() in Go?

.equal() or .equals() in JavaScript?

.equal() or .equals() in general?

What file extension for C++?

What file extension for C++ modules?

What name for the Go method that turns a Go object into a js.Value?

  • .JSValue() 538
  • .ToJS() 47

Is it camelCase, kebab-case, snake_case, or alloneword for GitHub repository names?

This is all hearsay. I haven't done the data digging to back this up with stats.

Prefer ⭐ kebab-case since - is treated as a word separator by search engines like Google. The repository name appears in the GitHub.com URL github.com/octocat/my-awesome-project and should thus be URL-friendly if you have no other constraints.

Is it camelCase, kebab-case, snake_case, alloneword, or "with spaces" for file names?

There isn't really any data for this that isn't skewed towards repository-tracked data files on GitHub or published PDF files on WordPress sites from a Google search. This is all anecdotal from me.

  • ⭐ If it's a data file name, prefer kebab-case or snake_case depending on the conventions of the consuming software. If it's tracked in Git, make it match your project's file name style.
  • Avoid case-sensitive naming. Prefer all lowercase. (Remember Windows is case-insensitive.)
  • Prefer avoiding spaces in programming contexts. *nix-related scripting in shells is made more difficult by spaces in file names.
  • Prefer regular "with spaces" title-style naming for .docx, .pdf, .jpg, etc. files that are meant to be shared or viewed by a human. Like Google Drive: think of the file name as the document title.

What's the preferred npm registry subdomain?

Couldn't find an easy way to get stats on this

npm.example.org. Example: https://npm.jsr.io/.

npmjs.com gets away with https://registry.npmjs.com because it's unambiguous.

What's the preferred OCI registry subdomain?

  • docker.example.org 718
  • cr.example.org 438 note that cr is an ISO 639-1 language code and an ISO 3166 country code
  • containers.example.org 142
  • oci.example.org 59

Sometimes container registries use a *cr.io TLD. Ex: gcr.io and ghcr.io. I couldn't think of a good way to filter for just *cr.io domains that happen to serve an OCI registry. Let me know if you have one.

What's the preferred Go module subdomain?

If your domain is related to Go, then none; use Go module <meta> tags in your main website's HTML to point to your module source. https://rsc.io does this. Otherwise, go.example.org. Example: https://go.bytecodealliance.org/, https://go.uber.org/.

  • go.example.org 910
  • git.example.org 28
  • (gitlab|forgejo|gitea|gogs|cgit).example.org 14

What's the preferred Git code host subdomain?

  • git.example.org 2.8k
  • code.example.org 520
  • (github|gitlab|forgejo|gogs|gitea|cgit).example.org 295