Free cookie consent management tool by TermsFeed Policy Generator

Changes between Version 8 and Version 9 of Documentation/DevelopmentCenter/DeveloperGuidelines


Ignore:
Timestamp:
11/26/09 18:00:02 (14 years ago)
Author:
gkronber
Comment:

Added a list of frequent mistakes that came to my mind.

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/DevelopmentCenter/DeveloperGuidelines

    v8 v9  
    211211
    212212----
     213
     214== Frequent Mistakes ==
     215
     216 * Use `Environment.NewLine` instead of the string constant "\n".
     217 * Use `Path.Combine()` instead of string concatenation (with `\` or `/`) to combine directory and file names.
     218 * Throw and catch specific exceptions, don't catch generic exceptions ~~`try { ... } catch(Exception ex) {}`~~
     219 * Use a finally block to make sure that the state of the program is consistent even when Exceptions are thrown.
     220 * Set the mouse pointer back to normal in a finally {... } block.
     221 * Use `string.Empty` instead of the string constant `""`;
     222 * Use `string.IsEmptyOrNull(a)` instead of `if(a!=null && a!="")`
     223 * Check for `InvokeRequired` in methods that manipulate GUI elements in controls.
     224 * Instantiate all objects of classes implementing `IDisposable` with the `using(...) { ... }` statement to make sure the object is disposed correctly.
     225 * When possible use LINQ syntax instead of extension methods for LINQ expressions.
     226
     227----
     228
     229== Final Remarks ==
     230Use your brain!