I'm not convinced about the semantic-ness of "sidebar". Still seems presentational to me, since on some devices you might not want it at the side. The problem is of course that the sidebar often contains a bag of bits, and while each bit may have a semantic name, the bag doesn't. It's impossible to suggest a better name without knowing what bits a given bag contains, but in many cases, referring to the element as an <aside> within the context of a given document element ancestry might work out better.
Front end developer specialising in JavaScript and React. Experienced in all aspects of modern front end development. Passionate about making accessible, secure and performant software.
Yeah perfectly good suggestion, thank you. You've got some good reasoning behind that.
At the end of the day you and your team will decide what makes the most sense to use.
There are two main motivations behind semantic class names:
The principle of least astonishment (the name is a useful, non-surprising label to the programmer).
Minimising future changes, because changing things is error-prone. A semantic name just happens to be the thing that is the least likely to change, compared to say color-red which could change all the time.
You've got the right idea to challenge the name. If you can find one that you think is most appropriate then by all means go for it :).
EDIT: Clarified about label being non-surprising.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'm not convinced about the semantic-ness of "sidebar". Still seems presentational to me, since on some devices you might not want it at the side. The problem is of course that the sidebar often contains a bag of bits, and while each bit may have a semantic name, the bag doesn't. It's impossible to suggest a better name without knowing what bits a given bag contains, but in many cases, referring to the element as an
<aside>
within the context of a given document element ancestry might work out better.Yeah perfectly good suggestion, thank you. You've got some good reasoning behind that.
At the end of the day you and your team will decide what makes the most sense to use.
There are two main motivations behind semantic class names:
color-red
which could change all the time.You've got the right idea to challenge the name. If you can find one that you think is most appropriate then by all means go for it :).
EDIT: Clarified about label being non-surprising.