[webkit-dev] Style guide: enforce `while (true)` over `for (; ; )`

Kirsling, Ross Ross.Kirsling at sony.com
Wed Oct 5 21:03:58 PDT 2022


I've always kind of liked that `for (;;)` doesn't involve an explicit constant, but I too like consistency even more. :)
________________________________
From: Ryosuke Niwa via webkit-dev <webkit-dev at lists.webkit.org>
Sent: Thursday, October 6, 2022 1:01:01 PM
To: Yusuke Suzuki <ysuzuki at apple.com>; Tim Nguyen <tim_nguyen2 at apple.com>; WebKit Development <webkit-dev at lists.webkit.org>
Subject: Re: [webkit-dev] Style guide: enforce `while (true)` over `for (; ; )`

I do prefer for (;;) because of less typing but if the existing code mostly uses while (true) then we should go with it.

On Oct 5, 2022, at 8:58 PM, Yusuke Suzuki via webkit-dev <webkit-dev at lists.webkit.org<mailto:webkit-dev at lists.webkit.org>> wrote:

+1

-Yusuke

On Oct 5, 2022, at 5:07 PM, Tim Nguyen via webkit-dev <webkit-dev at lists.webkit.org<mailto:webkit-dev at lists.webkit.org>> wrote:

Hi everyone,

The WebKit codebase has an inconsistent mix of `while (true)` and `for (;;)`. Given 2/3 of the usages are `while (true)` and only 1/3 is `for (;;)` from code search, I would suggest enforcing `while (true)`. I also think it is generally more explicit and readable than `for (;;)`. If everyone agrees, I’ll enforce this via webkit-style, so we can end up in a consistent place.

What does everyone think?

Cheers,
Tim
_______________________________________________
webkit-dev mailing list
webkit-dev at lists.webkit.org<mailto:webkit-dev at lists.webkit.org>
https://lists.webkit.org/mailman/listinfo/webkit-dev<https://urldefense.com/v3/__https://lists.webkit.org/mailman/listinfo/webkit-dev__;!!JmoZiZGBv3RvKRSx!4WCSOJt1MtFCNuSmAbM5Z_gamOY-UKJhTnta8oNOb_bkTPtEPCCitN_RMEoAyUx2szuzvSZs61U5CR1_XjuSyiMId3o$>

_______________________________________________
webkit-dev mailing list
webkit-dev at lists.webkit.org<mailto:webkit-dev at lists.webkit.org>
https://lists.webkit.org/mailman/listinfo/webkit-dev<https://urldefense.com/v3/__https://lists.webkit.org/mailman/listinfo/webkit-dev__;!!JmoZiZGBv3RvKRSx!4WCSOJt1MtFCNuSmAbM5Z_gamOY-UKJhTnta8oNOb_bkTPtEPCCitN_RMEoAyUx2szuzvSZs61U5CR1_XjuSyiMId3o$>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20221006/acacd46b/attachment.htm>


More information about the webkit-dev mailing list