Changes between Version 16 and Version 17 of Documentation/DevelopmentCenter/DeveloperGuidelines


Ignore:
Timestamp:
03/17/11 17:03:43 (11 years ago)
Author:
abeham
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/DevelopmentCenter/DeveloperGuidelines

    v16 v17  
    189189Additionally, each type (class, enum, struct, etc.) and each public or protected method, property, or variable has to be documented using a C# XML comment. These comments are used to generate the API documentated using the tools [http://www.codeplex.com/Sandcastle Sandcastle] and [http://www.codeplex.com/SHFB Sandcastle Help File Builder]. A description of XML comments and several examples can be found at [http://msdn.microsoft.com/en-us/library/b2s063f7.aspx XML Documentation Comments] of the [http://msdn.microsoft.com/en-us/library/67ef8sbd.aspx C# Programming Guide].
    190190
    191 == 7. Coding Recommendations ==
     191== 7. Best Practices
    192192
    193  * use `Environment.NewLine` instead of the string constant `"\n"`
    194  * use `Path.Combine()` instead of string concatenation (with `\` or `/`) to combine directory and file names
    195  * throw and catch specific exceptions, don't catch generic exceptions ~~`try { ... } catch(Exception ex) {}`~~
    196  * use a finally block to make sure that the state of the program is consistent even when Exceptions are thrown
    197  * if the mouse pointer was changed, set the mouse pointer back to normal in a finally {... } block
    198  * use `string.Empty` instead of the string constant `""`
    199  * use `string.IsEmptyOrNull(a)` instead of `if(a!=null && a!="")`
    200  * check for `InvokeRequired` in methods that manipulate GUI elements in controls
    201  * instantiate all objects of classes implementing `IDisposable` with the `using(...) { ... }` statement to make sure the object is disposed correctly
     193Check out the wiki page containing the [DevelopersBestPractices best practices].
    202194
    203195== 8. Final Remarks ==