W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2014

Re: Conventions for composed words in enum

From: David Dorwin <ddorwin@google.com>
Date: Wed, 12 Nov 2014 10:29:37 -0800
Message-ID: <CAHD2rsj4Z1_+qpLWFuCThctbjzA-xVKKb1GeeLV4tp0_YxiJ=w@mail.gmail.com>
To: Anne van Kesteren <annevk@annevk.nl>
Cc: Harald Alvestrand <harald@alvestrand.no>, Dominique Hazael-Massieux <dom@w3.org>, public-script-coord@w3.org, Stefan HÃ¥kansson LK <stefan.lk.hakansson@ericsson.com>
>
> On Tue, Oct 22, 2013 at 8:29 AM, Harald Alvestrand <harald@alvestrand.no <harald@alvestrand.no?Subject=Re%3A%20Conventions%20for%20composed%20words%20in%20enum&In-Reply-To=%3CCADnb78gKPEpzkUcp4rj-Nxhitr%3DefjEFHkik7%2BuxdANHhGEUcA%40mail.gmail.com%3E&References=%3CCADnb78gKPEpzkUcp4rj-Nxhitr%3DefjEFHkik7%2BuxdANHhGEUcA%40mail.gmail.com%3E>> wrote:
> > On 10/21/2013 02:57 PM, Anne van Kesteren wrote:
> >> Yeah, lowercase, no separators.
> >>
> > not to be a pain, but why is the answer here "lowercase" and not "camelCase"
> > or "CamelCase"?
> >
> > trying to understand why this case (identifiers represented as strings) is
> > different from other identifiers.
>
> Just ended up being the convention we use. This is also the convention
> we use for HTML element and attribute names, for what it's worth. It's
> not completely unique.
>
> Is "lowercasewords" still the preferred style? Would it be possible to add
naming guidelines to http://heycam.github.io/webidl/#idl-enums? Absent any
other guidance, the current note implies use of dashes.
http://www.w3.org/TR/api-design/#enums says nothing about naming.

FYI, here are a couple counterexamples in active specs:

   - Fetch is using a mix of concatenation and dashes:
   https://fetch.spec.whatwg.org/#requestcontext
   - Screen Orientation is using dashes:
   https://w3c.github.io/screen-orientation/#orientationtype-enum
Received on Wednesday, 12 November 2014 18:31:05 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:23 UTC