By "loss of readability" you mean that "this is uncommon, and so I'm not
used to reading it and it's harder to understand", right? And not "using
initializers is less readable than not using initializers in general"?

If you followed the first argument, then you would never be able to evolve
the codebase to start using new features, so I don't think we should use
that as a hard and fast rule.

But, I do think it's reasonable to have a broader discussion (perhaps this
one) to raise awareness of the feature.

I think the purpose of cxx@ is "is using initializers less readable in
general, so should we ban them" (or do they have other problems)? Once cxx@
has said that they're okay (and it seems they have), then you have the
discussion that says "hey, we're going to be using these in Blink now", etc.

-- Dirk

On Tue, Aug 12, 2025 at 1:24 PM Matt Menke <mme...@chromium.org> wrote:

> The question wasn't so much whether it's allowed, but whether it's a
> reasonable style choice, due to the loss in readability. If there was a
> widespread shift to prefer the pattern, that's one thing, but if one or two
> developers introduce it only in their corners of the code, that's
> potentially a significant loss in readability when other Chrome devs work
> on that corner of the world.
>
> On Tue, Aug 12, 2025 at 4:20 PM Daniel Cheng <dch...@chromium.org> wrote:
>
>> It's been allowed in Chrome C++ for some time now, so it's allowed in
>> Blink.
>>
>> In general,
>> https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++-features.md
>> tries to default allow features in older C++ versions, with specific
>> callouts to things that are banned.
>>
>> Daniel
>>
>> On Tue, 12 Aug 2025 at 13:13, 'Stefano Duo' via blink-dev <
>> blink-dev@chromium.org> wrote:
>>
>>> Hi blink-dev,
>>>
>>> Matt gave me advice to mail this list.
>>>
>>> We are discussing
>>> <https://crrev.com/c/6830059/3..10/components/cronet/cronet_proxy_delegate.cc#b95>
>>>  a
>>> C++ 17 feature: if statements with initializers
>>> <https://abseil.io/tips/165>. It is recommended when a variable is used
>>> within the if statement, but not outside of it.
>>>
>>> Pros: reduced variables scope.
>>> Cons: new syntax, currently not common in Chromium.
>>>
>>> How does the community feel about this? Should its usage be allowed?
>>>
>>> Thank you,
>>> Stefano
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "blink-dev" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to blink-dev+unsubscr...@chromium.org.
>>> To view this discussion visit
>>> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/f8f46d20-0fe9-4a8d-b8a8-30d99a39a635n%40chromium.org
>>> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/f8f46d20-0fe9-4a8d-b8a8-30d99a39a635n%40chromium.org?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "blink-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to blink-dev+unsubscr...@chromium.org.
> To view this discussion visit
> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAEK7mvpS054nM4bsd%2BUzZ7trefV13MmJeF22YTHw0j%3DLco5Y4g%40mail.gmail.com
> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAEK7mvpS054nM4bsd%2BUzZ7trefV13MmJeF22YTHw0j%3DLco5Y4g%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to blink-dev+unsubscr...@chromium.org.
To view this discussion visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CALyq149duhH35XLxo%2BVRVM0dXTyDOabHBc7hAcHjQqM5vum5Vg%40mail.gmail.com.

Reply via email to