On naming (in software)

CategoriesHomepage, Software Development
This is a piece of a conversation that took place elsewhere, a commentary that I think people might find generally useful – therefore, I’m posting it here.

Just for the record, the reason `withassets` is one word (I understand it’s not very English) is because (1) “with” is one syllable, and (2) it’s a single token.

On counting syllables: I prefer names that are short, while still being descriptive. Previously, I named something “more notes” when some reviewers favored “additional notes”. Generally, I think 2-3 syllables is a good length for a name. Good examples: facebook, instagram, google, sprokets. Bad examples: wikipedia, asset pipeline.

On lack of underscores: an underscore is safer than a dash (which is a mathematical operation), but it’s still a special character that separates tokens. I saw a client database where table names were just a-z letters, no capitalization, no other chars. While other readers ridiculed that choice, I found it interesting. `withassets` is a sub-environment so to say, and it’s one thing. It’s not separable into “with” and “assets”. If there is ever a need to have `development_withcache`, `development_withssl`, splitting environment name by underscore clearly gives you the major and minor parts. Introducing an underscore in the middle of a token may require more complex parsing.