Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think it's a good idea to avoid "BEM" in such a mainstream project, since the naming pattern clearly puts some people off.

However, what about the problems that BEM tries to solve? Using a naming pattern to communicate structure (element E is a "child" of block B) is a good idea (instead of e.g. a descendant or a child selector) because of:

a) Performance: one class (e.g .blockB__elementE) will be faster to "match" by the browser than .blockB > .elementE /.blockB .elementE;

b) Less coupling to DOM structure: to have the desired style, element E doesn't necessarily have to a child of B.

Similar points can be applied to modifiers. A "btn--large" instead of "btn btn-large" seems like a good idea for performance and also to avoid conflicts (the latter class will override the first, but I wouldn't want to care with order).



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: