Document your code!

I recently worked for client who wanted their code written a particular way. Okay no problem...

So they let me take a look at a previous (but unrelated) project they had worked on. At which point, things became more complicated... The project was undocumented and the code was clever, terse, and completely un-commented...

The result being that I had to 'reverse engineer' their previous project, to get a handle on their methods. Something that, had there been a project document, wouldn't have been necessary!

So, for the sake of maintainability and sanity of the poor bugger parachuted in to help you with your code.... Please document your projects and comment your code!

Below is an example of commented and un-commented code. Imagine hundreds or thousands of lines of code without any documentation or comments!

 Code without comments

var contentService = Services.ContentService;
var eventNode = contentService.CreateContent(
eventName,1105, UmbracoConstants.DocumentTypeAlias.EventItem,0);

 

Commented code

//======== create a new classified node using doc type - EventItem ============
// Get the Umbraco Content Service
var contentService = Services.ContentService;
var eventNode = contentService.CreateContent(
eventName, // the name of the event from Soap Call
1105, // the parent id should be the id of the group node 
UmbracoConstants.DocumentTypeAlias.EventItem, // the alias of the product Document Type
0);

// We need to update properties (propertyType, content from Soap call)

 

 

Website content that is easy to modify and update!

About Us

WJP Media concentrates on creating responsive, high functionality websites using the 'friendly' op…

Umbraco Development

In today's online environment the ability to easily modify and update your website is crucial. Umbra…

Projects

WJP Media and it's founder Warren Palmer has been creating web applications for household names sinc…

Fees

'Pay as you go', or 'Contract'?  You choose.....

 £35 per hour - no contract. Just 'get on with it'…