That makes sense. The problem is that we never got anything close to that.
That makes sense. The problem is that we never got anything close to that.
Or rather, it only makes sense if you accept the technical debt inherited from HTML, which is itself the simplified stepchild of SGML, which was a 1960s idea and firmly rooted in paper publishing.
Separating content and presentation isn't a bad idea. The badness happened because JavaScript - or some other web programming language - didn't appear until HTML was established. So instead of a generic object model, with tagged content containers linked to an updatable library of presentation and layout code that could be standardised and refined continuously, some semi-standard version of a sort-of-working layout library was pre-compiled into browsers and accessed through a not very coherent DSL.
This made it fast enough to be usable - a very good thing, given 1990s processing speeds - but it also made it much harder to develop and fix.
In 2015 CSS shouldn't really be necessary. So much layout and presentation is done with JavaScript anyway that it would make just as much sense to get rid of CSS and extend and standardise on something like jQuery-but-better to create an evolving cacheable layout library that bypasses browser quirks and uses exactly one common versioned codebase.
This might seem ambitious, but writing good code that works across all common browsers now is such a nightmare for everyone that too many devs are either not bothering, or their bosses are telling them not to bother because it's too expensive.
As a user, I keep finding sites that simply don't work in Chrome or Safari or IE or whatever. That's not good, especially when there's a business at the other end trying to sell things.
I don't doubt the web will creak along, and some people will do amazing things. But it's still frustrating when it could be simpler, more standardised, more consistent, and much more reliable.
I don't know what web sites you visit where you have such issues but I haven't seen them in years except for the occasional goofball site.
For contrast I now support IE8 and IE9. Without jQuery. It's bad. Really, really bad. Like, there isn't indexOf on Array and asking for polyfill is forbidden.
It's great if you never had to deal with them, but that doesn't mean it won't happen.
Note: It wasn't a one-off job either. There were multiple jobs, government sector.
Us programmers often get this wrong.
Good luck arguing with customers that will only pay when you achieve pixel perfect layouts across all browsers.
Or are able to replicate certain UI behaviors from native platforms.
Doing native stuff again, and I don't miss this type of arguments.
The concept of executing untrusted code is entirely antithetical to security. Javascript, or any Turing complete language, or perhaps that even is too precise a constraint, is a remarkably bad idea for setting the style of anything that is otherwise static. There's no good reason that text and images need be stylized via a proper language rather than static, non-executable statements.
> As a user, I keep finding sites that simply don't work in Chrome or Safari or IE or whatever.
I keep finding sites that simply don't work at all in Firefox with NoScript. Many of those sites are primarily just text and images which don't display otherwise. It's completely insane from a security point of view.
I speculate that it's because these languages are better at certain things, just like having a non-executable language for data, helps keep the data, data only (cue angry lispers), and facilitates easier writing of prose in a mark-up language than a real programming language could facilitate. Just look at markdown.
More over, we invented JSON, rather than just sending JS files between browser and server.
I prefer writing queries using Django's ORM even though it is underpowered.