Jason Knight
1 min readJan 18, 2022

--

I always laugh -- and cringe -- when people talk about "Clean code" when it comes to BEM. How code bloat, slopping pointless classes at things that are oft redundant to the proper semantic markup,

The "benefits" you list all being things that proper semantics, using classes or ID's as grouping mechanisms, and properly leveraging selectors and combinators provide without duping you into writing two to ten times the HTML needed to do the job.

Then you're not writing silly wasteful code with DIV doing SECTION or ARTICLE's job, DIV for nothing around your image, DIV for nothing around a perfectly good paragraph, and might actually have lists around your anchors so it's not treated as a single entity "Success Back" by devices like braille readers since anchors provide ZERO semantic breaks or meaning to the content they wrap.

BEM -- like pre-processors and frameworks -- only provide the ILLUSION of benefits when one is insufficiently versed in HTML or CSS to recognize flim-flam huckster nonsense made popular via propaganda, and not actual merit.

--

--

Jason Knight
Jason Knight

Written by Jason Knight

Accessibility and Efficiency Consultant, Web Developer, Musician, and just general pain in the arse

No responses yet