[webkit-dev] Code Style: Opinion on returning void

Tim Horton timothy_horton at apple.com
Thu Feb 7 12:53:00 PST 2019



> On Feb 7, 2019, at 12:47 PM, Daniel Bates <dbates at webkit.org> wrote:
> 
> Hi all,
> 
> Something bothers me about code like:
> 
> void f();
> void g()
> {
>     if (...)
>         return f();
>     return f();
> }

⸘do people do this‽

> I prefer:
> 
> void g()
> {
>     if (...) {
>         f();
>         return
>     }
>     f();
> }
> 
> Does it bother you? For the former? For the latter? Update our style guide?

+1 to a style guide update

> Opinions, please.
> 
> Dan
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev



More information about the webkit-dev mailing list