Leave a comment

Simple Tips To Help You Write Friendlier Code

Clean Code.

To paraphrase BJarne Stroustrop, Clean Code is elegant, simple and efficient and does one thing well. I particularly love this statement because it has always been a strong belief of mine. I will now attempt to go through a few simple every day checklist that can improve code readability and ultimately, maintainability.  

Tip #1: Identifiers

Identifiers, functions, classes/interface, should have names that are clear and concise. Most developers, including myself, love to write code late at night. This is when we can crank out our latest and greatest. But if you are like me, when you look at that same piece of art you cranked out a few weeks ago (or even the night before), you can hardly recognize what the variable call killSwitchForCat means. 

Below is a table of good and bad identifiers just to give an idea.

Bad Good
int w = dayOfMonth/7; // what is ‘w’ in the equation int week = dayOfMonth/7;  //Write what was intended
int l; // don’t know if this is 1 or lowercase L int length; // This is more easily identified and is even more searchable in Visual Studio
   

  Continue Reading »

Leave a comment

Another Code Blog!!

 

Hi, this is another blog about coding in the .Net Framework. Why another blog you might ask? Well I love learning and I even though I may read a lot, I only seem to remember about 60% of what I read.

If you are a fan of the .Net Framework you will agree that it requires a lot of effort to keep up with the many Microsoft releases. For example, Silverlight is now in Beta 4 and I haven’t even mastered Silverlight 3.0. The Microsoft community releases a lot of tools that can simplify development yet many like me only seem to know of them when you step into an interview or in a blog where the author assumes that you know the tool and flashes around the acronym.

The primary aim of this blog is to post simple code samples that demonstrate how to get the job done with minimal effort. I am not a writer so don’t expect to see award winning writing here. I will do my best to explain language features, methodologies, patterns and practices, etc. in the most basic of words in hopes that YOU will provide valuable feedback.

Follow

Get every new post delivered to your Inbox.