Sunday, February 7, 2010

Becoming a Great Developer

Becoming a Great Developer

You are very good programmer, problem solver and algorithms writer.

If your code is not good enough to deliver your knowledge,however,your team and your company will suffer in logn run.It is crucial that as a great developer you are not passionate about code.

We talk consistantly about design patterns,refacotring and code readablity, but when it gets right down to it, we often ignore infromation due to constraints of time.

The fact remains that we must consider some important points begin to always right code in this manner.
Here are some techniques that I have learned,which we can include in our daily programming practice.

1. Use common template in whole code ,it shows your code consisitancy in whole proj/prod.

2. Repitative code should be in single method.
3. Try to use factory method where ever object creation is concern.
4. Variable name should be self descriptive.
if (HasInstantiationAwareBeanPostProcessors)
foreach (IObjectPostProcessor processor in ObjectPostProcessors)
IInstantiationAwareObjectPostProcessor inProc = processor as IInstantiationAwareObjectPostProcessor;
if (inProc != null)
if (!inProc.PostProcessAfterInstantiationwrapper.WrappedInstance,name))
continueWithPropertyPopulation = false;
} }
5. Use singleton on your Service and Dao layer, it creates a hell on each call of new object creation.
6. These objects are useless to create at every call.

7. Use at least one line summary of method in your comments area.
8. KIS principle.(Keep it Simple)Your method should contain single respoinsiblity don’t make your method monolithic.
/// Checks if a string has length.
/// if the string has length and is not
/// StringUtils.HasLength(null) = false
/// StringUtils.HasLength("") = false
/// StringUtils.HasLength(" ") = true
/// StringUtils.HasLength("Hello") = true

public static bool HasLength(string target)
return (target != null && target.Length > 0);
9. Your calss should be single responsible of your logic means userservice should have method of only related with user related.

10. Declare interface for your each layer’s object.Mean to say userservice should have IUserservice same with other service layer object either it is infrastructure,Dao,persistnance.

Writing software is not just one time activity as codes have to dealt with 90% of the time.It's a life time activity and I think that code maintanance should be a part of everyday.Code maintanance is understanding that the easier code is to write the easier it is to maintain.

No comments: