[MonoTODO]
int MyFunction ()
{
- throw new Exception ("Unimplemented");
+ throw new NotImplementedException ();
}
* Tagging buggy code
A few guidelines:
* Use a space before an opening parenthesis when calling
- functions, like this:
+ functions, or indexing, like this:
method (a);
+ b [10];
* Do not put a space after the opening parenthesis and the
closing one, ie:
- good: method (a);
+ good: method (a); array [10];
- bad: method ( a );
+ bad: method ( a ); array[ 10 ];
* Inside a code block, put the opening brace on the same line
as the statement:
void Method () {
}
- * Properties are an exception, keep the brace on the same line
- as the property declaration. Rationale: this makes it visually
+ * Properties and indexers are an exception, keep the
+ brace on the same line as the property declaration.
+ Rationale: this makes it visually
simple to distinguish them.
good:
Notice how the accessor "get" also keeps its brace on the same
line.
+ For very small properties, you can compress things:
+
+ ok:
+ int Property {
+ get { return value; }
+ set { x = value; }
+ }
+
* Use white space in expressions liberally, except in the presence
of parenthesis:
* If you are modyfing someone else's code, and your contribution
is significant, please add yourself to the Authors list.
+ * Switch statements have the case at the same indentation as the
+ switch:
+
+ switch (x) {
+ case 'a':
+ ...
+ case 'b':
+ ...
+ }
+
+ * Argument names should use the camel casing for
+ identifiers, like this:
+
+ good:
+ void Method (string myArgument)
+
+ bad:
+ void Method (string lpstrArgument)
+ void Method (string my_string)
+
Here are a couple of examples:
class X : Y {