Editing Octave style guide
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 27: | Line 27: | ||
parentheses, like this: | parentheses, like this: | ||
<pre>x = max (sin (y + 3), 2);</pre> | <pre>x = max (sin (y+3), 2);</pre> | ||
An exception are matrix or cell constructors: | An exception are matrix or cell constructors: | ||
Line 65: | Line 65: | ||
44.04 55.05 6.06]; | 44.04 55.05 6.06]; | ||
</pre> | </pre> | ||
== Naming == | == Naming == | ||
Line 124: | Line 90: | ||
=== Variable names === | === Variable names === | ||
== ending blocks == | == ending blocks == | ||
Line 190: | Line 116: | ||
== ! operator == | == ! operator == | ||
The Octave operator {{codeline|!}} should be used for logical negation, rather than | |||
{{codeline|~}}. The negation operator is written with a space between the operator | |||
and its target, e.g., {{codeline|! A}}. | |||
== Comments == | == Comments == | ||
Line 207: | Line 134: | ||
Use a single {{codeline|#}} for inline comments. Use double {{codeline|##}} | Use a single {{codeline|#}} for inline comments. Use double {{codeline|##}} | ||
for block comments. | for block comments. | ||
=== Commenting out code === | === Commenting out code === | ||
Line 248: | Line 152: | ||
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. | ||