I like ScopedChange the most out of all the names. It's a bit unfortunate that 
such a name doesn't work well in the context of having a ScopedChange as a 
member variable. I think TemporaryChange works much better as a name if the use 
is as a member variable.

My hunch would be the most frequent use of this class is as a scoped change. If 
almost all of the uses are indeed for this, my name preference would be:
1. ScopedChange
2. TemporaryChange

If there are a lot of uses where the class isn't used as a scoped change, my 
preference would be to revert to TemporaryChange.

- Saam

> On Dec 23, 2016, at 6:50 AM, Maciej Stachowiak <m...@apple.com> wrote:
> 
> 
> A few more coats of paint for the bike shed:
> 
> It's a little unusual to have a class name that's a verb phrase instead of a 
> noun phrase. And in this case if you interpret "Set" as a noun you'll get 
> entirely the wrong idea. Some alternatives that avoid this, but has the 
> better clarity of "Scope" instead of "Temporary" would be "ScopedChange or 
> "ScopedAssignment".
> 
> One additional thing to think about: the class doesn't just have the effect 
> of limiting the assignment to a scope. It will also undo any further 
> assignments to the reference it holds that happen until it is destroyed. 
> Save-restore semantics like this are common but often the names involved 
> highlight the restore rather than the setting. I can't think of a great name 
> off the top of my head but something like RestoreOnScopeExit seems more 
> technically accurate than SetForScope.
> 
> - Maciej
> 
>> On Dec 23, 2016, at 6:32 AM, Michael Catanzaro <mcatanz...@igalia.com> wrote:
>> 
>> On Fri, 2016-12-23 at 05:42 +0000, Yusuke SUZUKI wrote:
>>> Personally I like the name "SetForScope" since the name "scope"
>>> states that this value change is tied to C++ scope.
>> 
>> Me too. The name is pretty clear. The first time I saw TemporaryChange
>> I had to look at the implementation to see what it did.
>> 
>> Michael
>> _______________________________________________
>> webkit-dev mailing list
>> webkit-dev@lists.webkit.org
>> https://lists.webkit.org/mailman/listinfo/webkit-dev
> 
_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev

Reply via email to