Octave style guide: Difference between revisions

m
→‎Variable names: fix formatting
(→‎Variable names: initial variable naming guidelines)
m (→‎Variable names: fix formatting)
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 ''abs'', ''log'', or ''pow''.
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 ''i'' and ''j'' as loop indices. If a function
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 ''i'' and ''j'' as local variables in for loops.
acceptable to use {{codeline|i}} and {{codeline|j}} as local variables in
for loops.


== Quoted Strings ==
== Quoted Strings ==
296

edits