Is separation of Content, presentation and behavior possible every time ?
Many time through javascript we add classes to html and we use in CSS visibility:hidden inline
.
Should we always invest time ti keep all separate?
Is separation of Content, presentation and behavior possible every time ?
Many time through javascript we add classes to html and we use in CSS visibility:hidden inline
.
Should we always invest time ti keep all separate?
Your question is quite too general for us to give you a definite answer.
But, as nothing is impossible, I would say that, yes, it is possible.
In the same time, I would say that :
While it is usually possible, it is often not practical. As you say yourself, it costs time. Whether you are willing to invest that time is subject to many factors, of which purism is only one.
In fact, it can be argued (and I've witnessed it being argued first-hand) that since tags such as div
or span
don't carry any semantical meaning in and on themselves, but have been invented specifically for styling, the moment you use a single one of them on your page, you are already mixing content and presentation. This is a nice philosophical discussion to have, but in business context it leads nowhere.
So, while you should always try to separate content, presentation and behavior as much as possible, you will always have to stop somewhere, if only to get other things done.