Underscores or dashes

Thinking whether I should use dashes or underscores on net names in a schematic – I’m starting to like dashes more. Here is a strong opinion:

So let’s get right to it, here’s what you need to know.

  1. Despise the spaces
  2. Avoid the underscores
  3. Embrace the dashes

This is in the context of file names and URIs.

Underscores are common for us old C programmers, and probably still appropriate there, but it seems for most other names, partnumbers, etc, dashes are nice.

Thoughts?

I think its good article. I have been using hyphens in OE patch filenames for years now. I have despised spaces forever but I do still use underscores sporadically, especially in C/C++ code. I wish there was a universal way for computers to make sense of them and present them in more readable format no matter what was used originally, one could choose a replacement character dynamically or some such.

100% agree - dashes are more visually appealing.

I usually use camelCase or PascalCase when programming (i.e. variable / method names) and dashes for filenames or URIs. One particularly annoying issue with camelCase is how users treat initialisms. I strongly prefer Go’s convention of keeping the case consistent for an initialism (i.e. HTTPServer is better than HttpServer; UserID is better than UserId).

The only time I still use underscores is when defining constants that are all uppercase (i.e. JavaScript convention): REFRESH_ITEMS_TIMEOUT

Although I am preferring giving these camelCase / PascalCase names nowadays, a convention that Go has adopted.

1 Like