[Libreoffice] Help concerning code style and documentation

Regina Henschel rb.henschel at t-online.de
Wed Nov 3 02:35:05 PDT 2010


Hi Kohei,

Kohei Yoshida schrieb:
> Hi Regina,
>
> On Sun, 2010-10-24 at 18:13 +0200, Regina Henschel wrote:
>> Hi all,
>>
>> I'm currently working on LINEST and have attached a draft to issue
>> http://www.openoffice.org/issues/show_bug.cgi?id=115189
>>
>> There is no mathematical problem, but I'm uncertain about coding style.
>> The algorithms work on matrices. They have a lot of parts which are
>> nearly identical but the matrices are transposed. How to handle that?
>
> If one algorithm traverses matrix row-wise, and another column-wise,
> then I would just leave them as-is.  There isn't much we could do to
> reduce code side in that situation, and I don't think it would be worth
> the effort.
>
> If we really wanted, we could try templates as Thorsten suggested, but
> we can try that after your initial code gets integrated with some test
> cases to verify calculations.

I have attached a true patch and some test cases to 
http://www.openoffice.org/issues/show_bug.cgi?id=115189

Do you have already any other test cases around?

>
>> And I do not know how much comments are needed for those, who have to
>> maintain the code later, and if a separate documentation is needed.
>
> As Michael said, your level of comments look just fine to me. :-)  The
> only thing I would change is to remove commenting of closing braces.
> For instance,
>
> if (nCase == 2)
> {
>      ...
> } // end of nCase == 2
>
> type of comment is a bit too much since most modern editors should
> detect the begin end brace pair.  I would consider this to be
> over-commenting.  But other than that, your code looks just fine.

I have removed those comments.

>
> FYI, I'm planning to integrate a major refactoring of the guts of
> ScMatrix, to push most of its implementation out to an external library
> and to allow different base values (numerical-0 vs empty elements).  It
> should not affect ScInterpreter code as the change should be transparent
> to the users of ScMatrix, but I thought I would mention.
>
> And I would probably be the one to maintain your code, unless you want
> to maintain it yourself. ;-)

You know, that I work on it in my spare time, so response time might be 
long. You should tell me, whether the mathematics I used are clear from 
the code or you want me to write a description.

Kind regards
Regina



More information about the LibreOffice mailing list