Free cookie consent management tool by TermsFeed Policy Generator

Changes between Initial Version and Version 1 of Documentation/DevelopmentCenter/BestPractices


Ignore:
Timestamp:
03/17/11 16:59:31 (14 years ago)
Author:
abeham
Comment:

Started wiki page about development best practices

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/DevelopmentCenter/BestPractices

    v1 v1  
     1== General Coding Best Practices ==
     2 * use Environment.!NewLine instead of the string constant "\n"
     3 * use Path.Combine() instead of string concatenation (with \ or /) to combine directory and file names
     4 * throw and catch specific exceptions, don't catch generic exceptions try { ... } catch(Exception ex) {}
     5 * use a finally block to make sure that the state of the program is consistent even when Exceptions are thrown
     6 * if the mouse pointer was changed, set the mouse pointer back to normal in a finally {... } block
     7 * use string.Empty instead of the string constant ""
     8 * use string.!IsEmptyOrNull(a) instead of if(a!=null && a!="")
     9 * check for !InvokeRequired in methods that manipulate GUI elements in controls
     10 * instantiate all objects of classes implementing IDisposable with the using(...) { ... } statement to make sure the object is disposed correctly
     11
     12== Developing Operators ==
     13 * When defining !ValueParameters inside an operator also include a public property that allows get and set access to the parameter's `Value` property.