Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index


On 2010-09-30, nthiebaud@gmail.com wrote:
     if(rSel.A() == rSel.B() &&
-        !rSel.A() || rSel.A() == nTextLen )
+       (!rSel.A() || rSel.A() == nTextLen ))

While we change such code, would it be acceptable to also specify the
purpose of the conditions in prose as to be able to understand what it
actually happening?

sth like

if (...) {
  // Selected 0 chars and not from the beginning of the text 
  // and not the whole text document
  ...
}

Or is that bloat that simply states the obvious? I don't mean to
necessarily "prosify" the if conditions, but to actually state the
intend of the if.

I find code without comments horribly hard to read. Functions that don't
state what their purpose is, code branches where it is non-obvious why
they exist, etc...

Sebastian

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.