18
Can we talk about how bad beginners name CSS classes?
I was helping a friend debug his website last weekend and he had a class called "blue text" for a red heading. That is when it hit me that a LOT of new coders name things based on what they LOOK like instead of what they ARE. If you use a class like "left-align" and then later move that element to the center, your code makes NO sense anymore. Name your classes after the purpose of the element, like "product-title" or "nav-link" instead of "big-font" or "green-box". Has anyone else run into this naming mess when looking at beginner code?
4 comments