[css-variables] Hidden costs.

Let's consider any simple CSS property.

For example 'text-align' that is an enumeration of 6 values (in CSS 2.1).
Therefore theoretical minimal storage for the 'text-align' is 3 bits.

CSS Variables if accepted will require any CSS property to occupy at least
33 bits on 32-bit system and at least 64 bits on 64-bit CPU. No matter will
they be used or not *all* Internet users will start paying the price next 
day
they will be introduced/implemented.

I understand that for some existing sub-optimal (in regard to memory 
consumption)
UA implementations all above is probably not the case already but even for
them CSS Variables will cost some additional CPU cycles on each computation
of property value.  But not all UA/platforms have a luxury of unlimited 
memory.

I am not saying that we should stop adding any new features to CSS.
Just a reminder that we should think about hidden costs, etc.

The problem is that no one of Web designers actually asked about exactly CSS 
Variables
(run-time interpretable entities). Except of authors of this bright idea - 
Daniel Glazman et al.
of course. But there are a lot of requests for CSS Constants (parse time 
macro variables).
Just note various existing CSS macro/preprocessors and absence of anything
even close to CSS variables (they can be modeled in principle by JS means).

I think that 33bit versus 3bit is a bit high price for the spherical horse 
in
a vacuum[1], no?

Just for the record: CSS Constants do not introduce any new requirements
to memory storage and have zero cost in runtime and implementation is very
simple and unobtrusive.

[1] 
http://www.fortunecity.co.uk/meltingpot/jinx/399/jokes/Education/Physicists.html

-- 
Andrew Fedoniouk.

http://terrainformatica.com 

Received on Wednesday, 16 February 2011 04:26:34 UTC