4 ms·
They mix content and presentation. If you separate content from presentation, then you can have a presentation for desktop an another for mobile. Also, you can
by sanbor 7y ago
They mix content and presentation. If you separate content from presentation, then you can have a presentation for desktop an another for mobile. Also, you can totally change the layout without the need to change your HTML, as showcased in http://www.csszengarden.com/ http://www.csszengarden.com/
- sheeshkebab 7y agoThe whole concept of separated “content” form “presentation” in UI is a bunch of nonsense. Maybe it works somewhere in some very limited sense, but I’ve yet to see anything complex that separates these things.
- kickopotomus 7y agoThe separation of content from presentation is one of the primary purposes of MVC frameworks. The model (content) is separated from the view (presentation) by an abstraction layer (controller).
- the_other 7y agoIt’s really not nonsense. Make a text file with line breaks to force a line length, and then make a non-trivial edit to the content. You’ll have to move all the line-breaks too. It’s awful. If you’d instead left presentation to the display tool, you’d only need to change the content. The HTML presentation/content argument is this scaled up.
- yellowapple 7y ago> Make a text file with line breaks to force a line length, and then make a non-trivial edit to the content. You’ll have to move all the line-breaks too. It’s awful. But Emacs does that for me if I press M-q.
- the_other 7y agoExactly! Your editor is also your presentation tool here, and it knows where all the line breaks should be, so it can do the edits for you. It works those around the content. If you hadn't included the line-breaks in the first place, it wouldn't even have needed to do that (well, ok, it would to "soft-wrap"). If you passed/copied the file to someone who prefers a 78 character line to your 100 character line (or uses a machine from the early 80s for retro-cyberpunk chic), when they render the file, several things could happen: - their viewer/wditor might add temporary line-breaks to soft-wrap, in which case they'll see some short and some long lines - their viewer/editor might add hard-wrap line-breaks at 78 chars. This would remove all your 100 char ones, and could potentially break your content because it might not see the difference between a "wrap" and a "new paragraph". In the second case, when you get the file back later on, the content wont suit your preference for 100 character lines. When the presentation is kept out of the content, none of this happens. My point was that even in something as simple as a text file, adding presentation commands (line breaks), adds work, or hinders accessibility. Scale that up to HTML and the wider range of possible presentation options. Say you used the old-school inline colouring options. Maybe you find green text on red backgrounds really fun to read. You encode that into the content (the markup). Pass this file on to someone with red-green colourblindness (c7% of XY-chromosome carrying humans[0]) and they wont be able to read your file at all. [0]: https://www.colour-blindness.com/general/prevalence/ https://www.colour-blindness.com/general/prevalence/
- wongarsu 7y agoIn the specific case of html and css I agree that it rarely works. There are a few examples like subreddit css, but in general html does to much layout to meaningfully separate content from layout. Xml and XSLT is a much better separation, with Xml containing pure content and Xslt transforming that into XHTML with CSS for presentation. But that never got much adoption. In other domains separating content from presentation works well. But in web development the incentives don't align with that idea.
- kjeetgill 7y agoAgreed. The real answer, as you noted, is that presentation really is HTML+CSS. You can join it with content in JSON (or XML if you want) via client or server side templating. It actually gets you pretty close to MVC or whatever MVVC is maybe? Is that still a thing?
- _ZeD_ 7y agoI really need to tell you... html is already only presentation. The content is in the backend system