Last Updated: February 25, 2016
·
556
· hanzo

underscore vs. hyphen

When choosing how to replace spaces in the name of files, variables and code in general, prefer the underscore character over a hyphen. The reason? The regular expression character class for a word boundary (/w) includes letters, numbers, and the underscore...but not the hyphen.