XML and CSS…Both are absolutely incomprehensible phenomena to me.
I don’t really have a lot of experience with XML, so I’m not really qualified to have an opinion. But at a glance:
1. Particularly in web development, page loading time is a critical factor. Minimize your image sizes, strip your JS framework to the core, reduce any unnecessary bloat. Smaller and faster. Amazing algorithms squeeze as many drips of redundant data out of media files as they can, before deteriorating quality TOO much.
2. Great, so we have some extra bandwidth floating around. What shall we do with it?
3. I know! Let’s put data into a computer-unfriendly, space inefficient form for transfer and storage. Let’s use a bloated string-processing, CPU and space intensive format, so humans can read files in their raw form! RAM is cheap these days.
I would like to know, actually, who has ever read through a… say… AutoCAD xml file. “Oh, THERE’S that circle! On line 4,394! Yes, that must be it, because the <center> is at “465.829584781983462…..
I mean really, what is the point making raw data HUMAN readable? Or easier to understand? A protocol doesn’t have to be human readable to be widely standardized or usable. The whole POINT of computers is to convert human information to machine-friendly form, for processing, then redisplay in human form. Now we have:
IN -> data in human-friendly form ->
conversion to computer-friendly form ->
processing ->
conversion to human-friendly form ->
transfer and storage ->
conversion to computer-friendly form ->
processing ->
conversion to human-friendly form -> OUT
Huh?
But right now, CSS is the one I REALLY have the beef with. CSS is great for managing look and feel of elements. But trying to use it for layout? It’s like going out of one’s way to find a more complicated system, when one has a perfectly good system.
The only “benefit” that I can see is that it is possible to change the visual presentation of information without modifying the structural data the information is embedded in, by modifying the protocol itself. If you want four rows instead of four columns, then you just change a few heights, maybe a couple of float settings, and your “cells” reorient. You never got close to the actual data.
But so what? I do could the same with tables very easily by using JavaScript to take a four row table, and due to the perfectly logical structure of tables, write a very simple function to swap those rows to columns.
And here’s the fun part – restricting this point to CSS layout – it can makes pages slower just as easily as it can make them faster. It increases the amount of information required to create the structure, because now you don’t have elements, you have elements AND classes AND a style sheet. What is the point of using:
<div class=”row”>
<span class=”label”>Some Label</span>
<span class=”formElement”><input name…></span>
</div>
?
What’s wrong with my beloved <tr> and <td>?!
Who cares if my JavaScript row/column swapper gets close to the data. That’s what computers are for.
But here’s the kicker.
How many sites and blogs are there about “zen”, or otherwise very clever (and peaceful, I guess?) CSS use?
WHY are there so many sites?
BECAUSE IT’S SO BLOODY HARD! CSS is a MESS. A catastrophe.
It is not robust in the slightest.
Another tell-tale sign of it’s complexity and ambiguity is the inconsistent treatment across the range of browsers. I feel sorry for those programmers, trying to detangle the CSS specs.
Anyway, this is a bit of a rant, I realize. See, I just spent an hour “debugging” a form layout via CSS that was not behaving.
I was using this:
<div class=”rsFooter”>
<input name=”aName” type=”button” id=”aName” value=”A Value” />
</div>
Apparently I was supposed to be using this:
<div class=”rsFooter”>
<input name=”aName” type=”button” id=”aName” value=”A Value” />
</div>
Suddenly everything in my huge pile of nested div’s snapped to their correct widths.
Back to it though. Apparently it’s …
The future.