Sitecore recommended practices for solution code:
- Sitecore highly recommends using C#. All of the Sitecore programming examples are in C# and C# is the language spoken by Sitecore Support.
- Use GUIDs where possible instead of path / name. This will improve performance, as well as prevent any breakage if you move content to a new location in the content tree.
- Use the Sitecore Search API instead of query or fast query. This allows querying based on indexes, rather than the content structure.
- Avoid //, descendant and descendant-or-self axis in XSL renderings.
- Use App_Config/Include files instead of directly modifying the web.config file.
- Don’t hardcode information in the code, use <settings> in a *.config file.
- Use parameters and properties when creating pipelines/events.
- Don’t hardcode labels and other static text information, consider modeling it with items, or create a dictionary in Sitecore.