W3C home > Mailing lists > Public > www-style@w3.org > April 2010

Re: [cssom] CSS Value API

From: Linss, Peter <peter.linss@hp.com>
Date: Thu, 22 Apr 2010 20:17:05 +0000
To: Brad Kemper <brad.kemper@gmail.com>
CC: Tab Atkins Jr. <jackalmage@gmail.com>, Estelle Weyl <estelle@weyl.org>, Anne van Kesteren <annevk@opera.com>, Boris Zbarsky <bzbarsky@mit.edu>, Ojan Vafai <ojan@chromium.org>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <18F8D30D-8E26-49B8-9EDF-0F5ABDEF0EB7@hp.com>
On Apr 22, 2010, at 12:02 PM, Brad Kemper wrote:

> On Apr 22, 2010, at 11:30 AM, "Tab Atkins Jr." <jackalmage@gmail.com>  
> wrote:
> 
>> This brings up an interesting point.  Are we sure that (1) colors are
>> the only things that will be using single-letter accessors and (2)
>> that no color types we define will ever have overlapping accessor
>> names?  hsl has an overlapping "l" name with the proposed list
>> accessor, and cmyk() (introduced in GCPM, iirc) has an overlapping "m"
>> name with the proposed map accessor.  So far none of the colors
>> overlap with eachother, if you consider rgb() and hsl() just shortcuts
>> for rgba() and hsla().
> 
> I'm not a fan of using single letters to access anything. I prefer  
> ".list" to ".l", and ".red" to ".r". It just makes it so much more  
> clear. I guess this could be a problem with something like .length  
> though. 
> 

Agreed, the cost a few bytes and keystrokes is more than made up for in the clarity of the code. It also helps prevent name collisions.

About the only single letter variable or accessor names I ever use are x, y & z, and then only for coordinates. One could also argue for .pixel vs .px, but at those are very well established unit names in CSS I'm OK with the short versions there.

Peter
Received on Thursday, 22 April 2010 20:20:06 GMT

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