Interesting Thread on CSS Tricks; Hyphens, Underscores, or CamelCaps?
"I was always a camelcase guy.. but in the last six months or so citing readability as a my reason i’ve migrated to hyphens. Underscores are simply an irritation to type repeatedly and quickly while coding."
This poll on CSS Tricks caught my eye - what's the best format to use for text strings when you can't use spaces; CamelCaps, Hyphens(-) or Underscores(_)?
I've generally always_underscored_strings_together but some of the comments pointed out that this can be a bit irritating if you have to repeatedly type this into your code. Hyphens certainly are quicker, but as I can see it there is one big advantage in using underscores - 'selectability' as Maggie Wolfe Riley calls it.
If you use underscores to chain text together, it's becomes very easy to select. A quick double click in Safari, Firefox or any code editor will select the whole phrase - ready to be moved, copied or whatever. Something that doesn't work with hyphens.
Anyway, vote in the poll on CSS Tricks or leave some comments; the discussion thread is a good read.


Comments [0]