18
A senior dev told me to stop naming my CSS classes like this
Honestly, I used to name my CSS classes like 'box1' or 'red-button' and thought it was fine. A guy at my last job pulled me aside and said stop doing that, it makes your code impossible to fix later. Now I use BEM naming with stuff like 'card__title' and 'btn - primary' and I can actually find things. Has anyone else had a naming habit they had to break?
2 comments
Log in to join the discussion
Log In2 Comments
lee_barnes707d ago
Started naming everything by its actual purpose instead of what it looked like and never looked back.
10
betty_fisher57d ago
lee_barnes70 you're actually onto something real here. Tbh I started doing that with my laundry baskets, one is called "clean clothes storage" and the other is "dirty clothes waiting" instead of "the blue one" and "the beige one" and it just makes life simpler. Same with my kitchen gadgets, the thing I thought was a "vegetable peeler" I now call "carrot stick maker" because that's genuinely all I use it for. Ngl it stops me from buying random junk too because if I can't think of a real purpose for it I don't grab it.
10