[PATCH] D69764: [clang-format] Add East/West Const fixer capability

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 26 05:55:14 PDT 2020


sammccall added a comment.

Thanks @MyDeveloperDay for hammering on on these bugs and @steveire for finding them! There's still obviously some risk here but as long as this is opt-in for a major release or two (i.e. not turned on in built-in styles, any remaining bugs should get flushed out.

Regarding option naming, I did think East/West (only) was the way to go but have reluctantly changed my mind after rereading the discussion. My conclusions were:

- C++ people who have read discussions on this from 2018 on are likely familiar with "east const" terminology
- there are people who care about style who aren't familiar with it and wouldn't be happy to have to learn/adopt it (this was the main surprise for me)
- 5 years from now, this naming may have spread to ~everyone, may remain partially-adopted, or possibly even die out as a fad
- for people familiar with the terminology: "ConstStyle: East" is clearer than "ConstStyle: Right" (less ambiguous)
- for people unfamiliar with the terminology, the opposite is certainly true
- asymmetry 1: it's probably harder to work out east=right than to to work out that "ConstStyle: right" means const is written on the right of the type
- asymmetry 2: the new terminology is objectively better: terse, memorable, doesn't collide with other terms. Some dislike it, which is true of any distinctive name (I hate "namespace", for instance).
- there's clearly a cultural tension between reading like a meme-infested subreddit and like an IBM technical manual :-)

It's a tough call, but I'd propose a compromise: make Left/Right canonical as it's more accessible (don't have to learn new things) and in case East/West dies out.
But to have East/West as aliases: to let the community decide over time, and because I don't think we should be in the business of hindering adoption of better names.

("reluctantly" changed my mind because I do think east/west are better names. But meeting users where they are is important too - otherwise we'd just hardcode the One True Style :-))


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69764/new/

https://reviews.llvm.org/D69764





More information about the cfe-commits mailing list