<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 17 September 2018 at 18:57, Nico Weber via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,<div><br></div><div>in <a href="https://reviews.llvm.org/D52143" target="_blank">https://reviews.llvm.org/<wbr>D52143</a> there's some uncertainty if LLVM code prefers</div><div><br></div><div>  if (!Function())</div><div>    // Call to function failed, deal with it</div><div><br></div><div>or</div><div><br></div><div><div>  if (Function())</div><div>    // Call to function failed, deal with it</div></div><div><br></div><div>(Note that this is about functions returning bool, not int.)<br></div><div><br></div><div>Folks on that review feel that returning true on success is probably what we want, but it's not documented anywhere and we do have both forms in the codebase.</div><div><br>True on success seems more common:</div><div><a href="http://llvm-cs.pcc.me.uk/?q=true+on+success" target="_blank">http://llvm-cs.pcc.me.uk/?q=<wbr>true+on+success</a><br></div><div><a href="http://llvm-cs.pcc.me.uk/?q=true+on+error" target="_blank">http://llvm-cs.pcc.me.uk/?q=<wbr>true+on+error</a><br></div><div><br></div><div>Does anyone have a pointer to previous on-list discussion on this? If not, this thread could be the place where we sort this out once and for all :-)</div><div><br></div><div>Apologies for the bike-sheddy topic.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Nico</div></font></span></div></div></div></div></div><br></blockquote></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">I would take the opinion that the code should be self documenting.</div><div class="gmail_extra">So, based on the function name, it should be obvious which it is.</div><div class="gmail_extra">e.g. Calling the function things like</div><div class="gmail_extra">isDigit()    the result is fairly obvious, it returns true if the item is a digit.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Kind Regards</div><div class="gmail_extra"><br></div><div class="gmail_extra">James</div><div class="gmail_extra"><br></div></div>