Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » Development   (RSS)
I've always had mixed feelings for exceptions. First of all exceptions should only be used for exceptional things, not things that are expected. For example if you open a file it may fail for several reasons; it does not exists, you do not have rights Read More...
I've been sitting in a lot of code reviews and code inspections where somebody suggests a change to optimize something. The response from the author is almost always; but that's premature optimization! End of argument... But I almost never hear somebody Read More...
This is my favorite rule. I think it's a forgotten guideline in OO design to tell objects what to do with their state rather than asking for their state. Applying this rule to code changed the way I had to write code most of all rules. Keeping classes Read More...
Yet another rule to keep your objects focused at a single responsibility. Any class with an instance variable that is a collection should have no other instance variables. When I first tried object calisthenics this was actually easier said than done. Read More...
This is another aspect of keeping your entities small I think. Classes with a lot of instance variables tend to have more than one responsibility. This rule may also help you create a more generic design if used correctly. For example consider you want Read More...
This is a funny rule when exercising this. No class should be more than 50 lines long and no package should have more than 10 files. I guess package is a java-ism and converting to .Net I's say no more than 10 classes in each name-space. This is the rule Read More...
This rule has a weird name I think. What it means is that whenever you abbreviate in a class or method name you should think about why you do that. The assumption is that if you feel you need to abbreviate something it means you're using it too much. Read More...
Not only is a long line with a lot of dots harder to understand. It usually means that your object is using not only the objects it knows but the objects their "friends" know too. Having only one dot per line does not only make your code more readable. Read More...
This rule states that no parameters should be a of a primitive type (e.g. int, double) nor a string. Instead new objects should be created to represent what the parameters are. Is the integer really representing money or a coordinate. This small classes Read More...
Some people think that the if branch should be the every thing is good branch and the else branch being the error case. Others think the if branch should be as short as possible since it makes it easier to understand what would bring us into the else Read More...
First of all a method with a lot of different indentation is harder to understand than a method with less indentation. I also think that each level of indentation typically means you're doing another thing. Look at this code: 1: public void Format() 2: Read More...
A few weeks ago I was introduced the the object calisthenics described by Jeff Bay in the book The ThoughtWorks Anthology . The object calisthenics is a way to practice writing object oriented code. The nine rules of are not intended to be used in your Read More...
Have you ever found yourself fixing a bug or adding a simple feature to some code that have no tests and since you usually do things test driven you know you should get the code under test but you decide not to because the change only takes a few minutes Read More...
INVEST is an acronym to help you remember how to write good user stories. Independent - avoid dependencies between user stories. Negotiable - is there a possibility to implement both basic and advanced versions of the story? Valuable - can the story deliver Read More...
You've probably heard a thousand times that a good variable name describes what it is. Some people also thinks that the shorter the scope of the variable, the shorter should the name be. That was maybe true if you write the name out by hand but I think Read More...
More Posts Next page »
 
Page view tracker