Contributing to Sitecore Shared Source Projects Part II: Contribution Suggestions

The current edition of this post is at:

http://www.sitecore.net/Community/Technical-Blogs/John-West-Sitecore-Blog/Posts/2010/11/Contributing-to-Sitecore-Shared-Source-Projects.aspx

Here are the Sitecore Shared Source projects to which I have recently contributed:

Here are some suggestions for Sitecore shared source contributions:

  • Use C#.
  • Use Resharper, Stylecop, Agent Smith, and Agent Johnson as described in this post.
  • Resolve all code validtion issues before checking in any file.
  • Keep line length below 80 characters when possible.
  • Include the URL of the shared source project in each source code file.
  • To make your code easier for other developers to read, avoid ternary expressions.
  • To make your code easier for other developers to read, fully qualify classes in namespaces other than System, at least on the first use of each class in each method.
  • To make your code easier for other developers to read, avoid use of the var keyword.
  • Use protected instead of private where possible.
  • Use namespaces within the Sitecore.Sharedsource namespace that correspond to system and Sitecore namespaces, such as Sitecore.Sharedsource.Web.UI.WebControls.
  • Create directories as required to check in files from directories within the Subversion Trunk folder that correspond to the namespace, such as /Web/UI/WebControls for files in the Sitecore.Sharedsource.Web.UI.WebControls namespace.
  • Place extension methods in classes named after the method plus the word "Extension" in folders named after the original class. For example, to extend the Sitecore.Sites.SiteContext class with a method named GetSomething(), create /Sites/SiteContext/GetSomethingExtension.cs containing the class Sitecore.Sharedsource.Sites.SiteContext.GetSomethingExtension containing the GetSomething() method. Use namespaces such as Sitecore.Sharedsource.SystemString for extensions to system classes. For example, to extend System.String with a method named GetSomething, create /SystemString/GetSomething.cs containing the class Sitecore.Sharedsource.SystemString.GetSomethingExtension containing the GetSomething() method.

Also, I learned that to nest lists in the wiki, you indent with spacing. So:

 1. Item One.
  * Item One Bullet One.

This post has some other Wiki formatting and shared source contribution suggestions.

This entry was posted in Obsolete. Bookmark the permalink.

Leave a comment