|
From: | Doug Stewart |
Subject: | Re: odepkg: odeset profile tests |
Date: | Wed, 3 Dec 2014 08:22:49 -0500 |
On 2 Dec 2014, at 18:29, Carlo De Falco <address@hidden> wrote:
> Furthermore, it seems fuzzy_compare would need to go into Octave core as well, but as it is now
> it is absolutely not acceptable, formatting, documentation and comments
> (too many useless and annoyingly verbose comments don't make the code more readable)
> all need a lot of improvement.
looking at other functions that should maybe go into core, there still lots
of style fixes to be done, for example:
- '%#' as comment should be '##' for indented comments at beginning of line,
'#' for inline comments
- remove reduntant and annoyingle verbose comments.
for example in <https://bitbucket.org/robs88/octave-odepkg/src/df11f2a32e4bc192ca6f2a3d22bead4085cbbfc7/inst/ode23.m?at=default#cl-330> :
if (vmassdependence) %# constant mass matrices have already
...
else %# if (vmassdependence == false)
...
endif
the comments beside 'if' and 'else' are not really required nor helpful.
If the code is not clear enough, either make the code clearer or add the required
info in the documentation.
Only use inline comments when you are doing something very nonstandard or to point
out something that should be fixed later.
- single- and double-quoted strings have different meaning in Octave, unless you really
want to use single-quoted for a specific reason, prefer using double-quoted.
- use "!" instead of "~" for negation, leave a space between the negation operator and
the negated quantity.
- break long lines
- leave a space before and after arithmetic operators
- leave a space after a ',' in argument lists.
HTH,
c.
[Prev in Thread] | Current Thread | [Next in Thread] |