1,847
edits
(→Variable names: initial variable naming guidelines) |
(Add Category:Development.) |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 125: | Line 125: | ||
=== Variable names === | === Variable names === | ||
Avoid reusing the names of other functions as local variable names. For | Avoid reusing the names of other functions as local variable names. For | ||
example, try to avoid naming local variables | example, try to avoid naming local variables {{codeline|abs}}, | ||
These functions may be used in a later change and may lead to confusing | {{codeline|log}}, or {{codeline|pow}}. These functions may be used in a | ||
errors. | later change and may lead to confusing errors. | ||
An exception is the use of | An exception is the use of {{codeline|i}} and {{codeline|j}} as loop indices. | ||
has nothing to do with complex arithmetic, it is common and acceptable to | If a function has nothing to do with complex arithmetic, it is common and | ||
use | acceptable to use {{codeline|i}} and {{codeline|j}} as local variables in | ||
for loops. | |||
== Quoted Strings == | == Quoted Strings == | ||
Line 189: | Line 190: | ||
== ! operator == | == ! operator == | ||
The Octave operator | * The Octave operator <code>!</code> should be used for logical negation, rather than <code>~</code>. | ||
* The negation operator is written with a space between the operator and its target, e.g., <code>! A</code>. | |||
and its target, e.g., | * For comparisons use <code>!=</code> instead of <code>~=</code>. | ||
== Comments == | == Comments == | ||
Line 248: | Line 248: | ||
The preferred comment mark for places that may need further attention is | The preferred comment mark for places that may need further attention is | ||
with {{codeline|FIXME:}} comments. | with {{codeline|FIXME:}} comments. | ||
[[Category:Development]] |