The only difference between the two is that the views one doesn't turn underscores into hyphens.
This helps prevent collisions between similarly named views:
View name: Foo Bar
Machine name: foo_bar
CSS class: view view-foo-bar view-id-foo_bar
View name: ID Foo Bar
Machine name: id_foo_bar
CSS class view view-id-foo-bar view-id-id_foo_bar
If those _ were changed to -, they'd both have view-id-foo-bar as a class.
One way to avoid that would be to use double underscores/hyphens, like core does.
So, view--foo-bar and view--id-foo-bar
Comments
Comment #1
tim.plunkettOh, I forgot to mention, while an underscore is 100% valid, no one uses them. It's all alphanumeric and '-'.
Comment #2
dawehnerI'm total in favour of using double -- as core does, though i just fear that people
might really need the underscore for these frameworks.
The only confusing parts are the custom css classes, why should we force people to not use underscores,
beside it is not common.
Comment #3
tim.plunkettFunny, we're already using drupal_clean_css_identifier() in 14 places and views_clean_css_identifier() in only 6.
I think we should just conform to core, and let the changes happen in #1109854: Overly aggressive transliteration in drupal_clean_css_identifier removes underscores from classes
Comment #4
aspilicious commentedWell I think this is rtbc (if it comes back green) but I'll leave the final call to dawehner
Comment #5
dawehnerLet's see whether noone complains and if they do, we have someone to blaim :p