W3C home > Mailing lists > Public > www-style@w3.org > February 2013

RE: [css-variables] Last call comments

From: François REMY <francois.remy.dev@outlook.com>
Date: Mon, 11 Feb 2013 22:06:07 +0100
Message-ID: <DUB002-W50C10A9D92E5A53BD30F6DA50A0@phx.gbl>
To: Tab Atkins Jr. <jackalmage@gmail.com>, Brian Kardell <bkardell@gmail.com>
CC: "www-style@w3.org" <www-style@w3.org>
> The only thing called "variables" is the var() syntax, which is used
> like a variable in any other language, with its value substituted in
> its place.
Not at all. The var() notation is a *reference* or a *data binding* to a custom property, in no case a "variable". In the programming language world, a variable is a box referencable statically via a memory address relative to the stack. When you reference something dynamically this is not a variable, this is a property, because it's relative to a heap address, the address of the object where the data belong.
I maintain that calling var() a variable is a mistake.

> Given that I think the primary use of custom properties will be to
> define variables.
A property cannot define a variable, this is simply illogical, isn't it? A variable is a compile-time concept, not a runtime one. When you change the value of a variable, it doesn't trigger any update, because a variable is just a memory space in the call stack. A property, on the other hand, is something that can have a getter & a setter, and that can trigger updates in chain because it can be bound to at runtime via observers. This kind of dynamic process is called a data binding.
In SASS, they can talk about variables because this is exactly what they have: a compile-time concept which can be effectively substituted by their value by something as simple as Push Down Automaton. In CSS, we have to talk about data binding and references. 
The fact that you aim to solve the same use case doesn't mean you have to use the same name. A pizza and an apple both solve the same use case (we're hungry) but they don't have the same name. When you lost your email password, you can use your phone number or a secret question to retrieve it, you wouldn't call a secret question a phone, would you? 		 	   		  
Received on Monday, 11 February 2013 21:06:39 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:05 GMT