The purpose of this article is to encourage all of us to follow some basic principles.
The following are the basic principles to follow.
1. Avoid the "Is Not nothing" Pattern. I will illustrate what I mean with this simple conditional:
- if ( variable != false)
- {
- DoSomething();
- }
2. Avoid Writing Unnecessary Code. This is something I see a lot in professional API's. Developers love to provide more constructor and method overloads than needed. Yes, it is true that some things should be flexible, but in reality, it is more code that one must read; not to mention it is somewhat pointless. Let's provide at least two or three overloads only; no more, no less.
3. Avoid Abbreviations. One cannot deny that production source files contain things such as "fu," "temp" and the annoying "numScores." This would be understandable if we didn't have tools such as code completion in our beloved IDE's, but we do. This means that we should utilize this to our advantage. Now, let's notice that I didn't say that we should not keep variable names short. I said that we should not have abbreviations included in variable names. For example, instead of naming our variable "numScores," why don't we name it "total," or "scores?"
I do believe that if we were to avoid the three things mentioned above, we could spend more time worrying about semantics and other aspects of our code, rather than having to battle with these little details that could slow down the development process. Your code should be self-documented and should be read elegantly.
If your code is elegant, you will stand out and you will shine as a developer.
Who knows; you might leave a legacy in your company if your code stands out.

Ibrahim RashidPosted Dec 19, 2014, 3:01 AM
Good points to follow..
Manish Kumar ChoudharyPosted Dec 18, 2014, 11:36 PM
nice..
Vithal WadjePosted Dec 18, 2014, 11:32 PM
good one
Guest UserPosted Dec 18, 2014, 8:14 PM
Hi Jesus, my take away is Is Not nothing pattern. But sometimes, we tend to do that if API doesn't have the true option, e.g., string.isNullOrEmpty() . In this case, if I want to check that string is not null or empty then I may use, if(!string.isNullOrEmpty())
Dinesh BeniwalPosted Dec 18, 2014, 9:55 AM
Good start Jesus, welcome to C# Corner.
Lakshmanan Sethu SankaranarayanPosted Dec 18, 2014, 12:44 AM
Excellent one
Chao HuPosted Dec 18, 2014, 12:29 AM
cool