Re: [cssom] CSS Value API

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 UTC