James Michael Hare

...hare-brained ideas from the realm of software development...
posts - 137 , comments - 1099 , trackbacks - 0

My Links

News

Welcome to my blog! I'm a Sr. Software Development Engineer in Seattle, WA. I've been doing C++/C#/Java development for over 18 years, but have definitely learned that there is always more to learn!

All thoughts and opinions expressed in my blog and my comments are my own and do not represent the thoughts of my employer.

Blogs I Read

MCC Logo MVP Logo

Follow BlkRabbitCoder on Twitter

Tag Cloud

Archives

Post Categories

C#/.NET Five Little Wonders That Make Code Better (1 of 3)

We all have those little wonders in our .NET code, those small tips and tricks that make code just that much more concise, maintainable, or performant.  Many of you probably already know of some of these, but many folks either overlook them or just don't know about them, so this article is a refresher.

I'm planning on making this a three-part series encompassing 15 little wonders that I had thought of, though I'm very curious to hear the little wonders you can think of as well. 

Update: Part 2 is now available here.

Update: Part 3 is now available here.

1.  The Null Coalescing Operator (??)

This one is such an elegant little operator that can be extremely useful in some situations.  How often do you have a variable that you want to use the value of, but if that value is null you want to substitute a default value?  For example, say you wanted to assign a string to a variable, but if that string is null you want the empty string instead?

You could, of course, write an if statement:

   1: string name = value;
   2:  
   3: if (value == null)
   4: {
   5:     name = string.Empty;
   6: }

Or better yet, you could use a ternary operator (?:):

   1: string name = (value != null) ? value : string.Empty;

Ah, that's much more concise, but we can get even better!  C# adds a null-coalescing operator (??) that is a short-cut for the ternary operator (?:) checking against a null:

   1: string name = value ?? string.Empty;

Very nice and concise!  You can even write a helper method to trim a string and return null if string is all whitespace so that it can be used with "??".

   1: public static class StringUtility
   2: {
   3:     public static string TrimToNull(string source)
   4:     {
   5:         return string.IsNullOrWhiteSpace(source) ? null : source.Trim();
   6:     }
   7: }

Then the null-coalescing operator can be used to turn completely empty strings into defaults.

   1: string name = StringUtility.TrimToNull(value) ?? "None Specified";

2.  The As Cast

How many times have you seen code like this:

   1: if (employee is SalariedEmployee)
   2: {
   3:     var salEmp = (SalariedEmployee)employee;
   4:  
   5:     pay = salEmp.WeeklySalary;
   6:  
   7:     // ...
   8: }

This is redundant because you are checking the type twice.  Once in the is check and once in the cast.  Whenever you find yourself going down this path, prefer the as cast.  This handy cast will cast the type if the types are compatible, or return null if not:

   1: var salEmployee = employee as SalariedEmployee;
   2:  
   3: if (salEmployee != null)
   4: {
   5:     pay = salEmployee.WeeklySalary;
   6:  
   7:     // ...
   8: }

The code reads better without the ugly cast, and you avoid double-checking the type.

3.  Auto-Properties

We all know about C# properties, and most of us know about auto properties.  They turn code like these two typical properties with backing fields:

   1: public class Point
   2: {
   3:     private int _x, _y;
   4:  
   5:     public int X 
   6:     {
   7:         get { return _x; }
   8:         set { _x = value; }
   9:     }
  10:  
  11:     public int Y
  12:     {
  13:         get { return _y; }
  14:         set { _y = value; }
  15:     }
  16: }

Into a much more concise and maintainable piece of code:

   1: public class Point
   2: {
   3:     public int X { get; set; }
   4:     public int Y { get; set; }
   5: }

Much shorter!  Whenever you have a simple property that just gets/sets a backing field, you should favor the auto-properties if nothing else for saving a lot of typing!  All you need is write the properties with no get/set body and the C# compiler will automatically generate a field for you behind the scenes.

To make things even more fun, you can make auto-properties with asymmetrical access levels!  That is, you can make an auto-property "read-only" or "write-only".  That is, you can make the get public and the set private or vice versa.

   1: public class Asymetrical
   2: {
   3:     public string ThisIsReadOnly { get; private set; }
   4:  
   5:     public double ThisIsWriteOnly { private get; set; }
   6: }

This makes it easy to make auto-properties that can be set only by the class itself but read publically and vice-versa (though, in practice write-only properties are rarely useful).

4.  The Stopwatch Class

How many times have you wished to log how long a particular piece of code took to execute?  Maybe you are trying to track average request time or some such metric, or maybe send a warning message when a stored procedure takes longer than 1 second to execute.

Well, you could do it with DateTime like so:

   1: DateTime start = DateTime.Now;
   2: SomeCodeToTime();
   3: DateTime end = DateTime.Now;
   4: Console.WriteLine("Method took {0} ms", (end - start).TotalMilliseconds);

But DateTime is imprecise for this sort of metric.  You could also query the high resolution timer using Win32 API calls via PInvoke, but this is also very messy and more error prone.

So what’s a C# developer to do?  Enter the Stopwatch class which is in the System.Diagnostics namespace.  The Stopwatch class makes it clean and easy to use the high resolution timer through the convenience of a C# class:

   1: var timer = Stopwatch.StartNew();
   2: SomeCodeToTime();
   3: timer.Stop();
   4: Console.WriteLine("Method took {0} ms", timer.ElapsedMilliseconds);

Much more precise and very clean.  Note there is a static factory method to create a Stopwatch and immediately start it.  You also have the option of creating using new and then starting manually as you choose.

TimeSpan factory methods

How many time have you seen a piece of code like this and wondered how long the Sleep was going to before?

   1: Thread.Sleep(50);

Now, is that 50 seconds? Milliseconds?  It is milliseconds, actually, but what if you ran across something like this in someone’s code:

   1: void PerformRemoteWork(int timeout) { ... }

What is this timeout?  Seconds?  Minutes?  Milliseconds?  It all depends on the developer!  I’ve seen timeouts and intervals in both the BCL and custom code written as either seconds or milliseconds.  It’s almost always better to use TimeSpan since it makes it far less ambiguous:

   1: void PerformRemoteWork(TimeSpan timeout) { ... }

Now, we don’t need to worry about units because that’s specified when the user constructs the TimeSpan:

   1: PerformRemoteWork(new TimeSpan(0, 0, 0, 0, 50));

The disambiguates things from the standpoint of the method itself, but not for the caller!  Is the caller passing 50 seconds?  Milliseconds?  It seems we have a similar issue!  This is somewhat confused further by the fact that there are 5 constructs for TimeSpan and they are not all consistent:

   1: TimeSpan();
   2: TimeSpan(long ticks);
   3: TimeSpan(int hours, int minutes, int seconds);
   4: TimeSpan(int days, int hours, int minutes, int seconds);
   5: TimeSpan(int days, int hours, int minutes, int seconds, int milliseconds);

Notice how the 3-int constructor is hours minutes seconds, and the 4-int constructor adds days?  If you want to specify milliseconds, you need the 5-int constructor.  This can be confusing because reading a 4-int constructor may look like hours/seconds/minutes/milliseconds but it’s not.

Enter the TimeSpan static factory methods.  These allow you to construct TimeSpans unambiguously:

   1: PerformRemoteWork(TimeSpan.FromMilliseconds(50));

Now there’s no ambiguity and it’s perfectly readable!  No chance of misconstruing the parameters.  There’s also:

   1: TimeSpan.FromDays(double days);
   2: TimeSpan.FromHours(double hours);
   3: TimeSpan.FromMinutes(double minutes);
   4: TimeSpan.FromSeconds(double seconds);

So you can easily specify an interval in an unambiguous way.  It even works with static readonly fields:

   1: public sealed class MessageProducer
   2: {
   3:         private static readonly _defaultTimeout = TimeSpan.FromSeconds(30);
   4:         . . .
   5: }

Summary

I hope you enjoyed these five little wonders, I have a stack more to introduce next week.  Hopefully you found one you didn’t know about or had forgotten about and can put it to good use!

Print | posted on Thursday, August 26, 2010 6:32 PM | Filed Under [ My Blog C# Software .NET Fundamentals Little Wonders ]

Feedback

Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Great post! These kinds of articles are very helpful. I know I somehow missed the null coalescing operator when it was introduced. I eventually saw it used in a code sample and picked it up, but that's one of those tricks that I wish I had known about sooner to use on past projects.

FYI, you're missing the #5 for the TimeSpan section.
8/26/2010 7:52 PM | Dan Martin
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Loving the subject!

Never used the TimeSpan factory methods, but now I will.

8/27/2010 3:29 AM | Jef Claes
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Good code projection...i have been using most of the above stuff but the clear reason i got now..
thanks alot...
pawan
8/27/2010 4:26 AM | Pawam
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Thanks for the comments! I've got several more to roll out.
8/27/2010 8:50 AM | James Michael Hare
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Good post. I already used most of these tips but its a great reminder and i will foward this article to my team for a refresh!

thank you.
8/27/2010 9:46 AM | Alex
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

I love the stopwatch class so much, I made mine portable. ;)

http://gist.github.com/553684
8/27/2010 11:31 AM | Chris Martin
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Nice article, James (or do you go by "Jim"?). I look forward to parts 2-3.

Coincidentally, DevCurry.com had an article today about the null coalescing operator. They pointed out that you can "chain" it, e.g.:

string address = homeAddress1 ?? homeAddress2 ?? officeAddress ?? "No Address";
8/27/2010 6:46 PM | Brian Schroer
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Great point @Brian. Great point on the null coalescing op! Thanks to all for the positive comments so far! Feel free to mention your own "little wonders" too.

Typically I go be Jim but I use my full formal name on the blog since apparently there are a surprising number of Jim and James Hares out there...
8/28/2010 8:44 AM | James Michael Hare
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

very nice post !. thanks for this great post.
8/29/2010 5:20 AM | anirudha
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Nice post...

TrimToNull could be converted to an extension method on string or .Net 4 has string.IsNullOrWhitespace()
8/29/2010 6:16 PM | Simon Fox
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Great post.

Thanks.
8/29/2010 6:32 PM | Tarik Guney
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

This is one of those gems that will have a great impact on our coding standards in order to improve the efficiency of our C# developers across our projects. Thank you.
8/29/2010 8:49 PM | Andrew Beeson
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

StopWatch class and TimeSpan factory methods are going on my utility belt, thanks!
8/29/2010 8:54 PM | Ricardo Diaz
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Tip #4: The Stopwatch class is just a gem!
Thank You James!
8/29/2010 9:38 PM | Arthur Zubarev
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

If I change a method parameter from int to TimeSpan, how can I set a default value so that it is an optional parameter?
8/29/2010 10:44 PM | David White
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

@David White; I believe this is what you want:

public void PerformRemoteWork() {
PerformRemoteWork(TimeSpan.FromMilliseconds(50)); //some default-value
}

public void PerformRemoteWork(int delay) {
PerformRemoteWork(TimeSpan.FromMilliseconds(delay));
}

public void PerformRemoteWork(TimeSpan delay) {
//do the real work here
}
8/30/2010 1:38 AM | Erik Karlsson
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Tip top on the stopwatch class usage
8/30/2010 3:10 AM | g
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Great collection of tips there. I've been using the Null Coalescing Operator for a while on my projects and it really helps with reducing code and making code easier to read.

I never knew about the StopWatch functionality though. Very handy. Thanks for the tips. Can't wait for the next list!
8/30/2010 4:34 AM | Richard Reddy
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

As most of the other commenters have, I've been using the majority of these features already. However, adding even just one to my repertoire as a result of this article is great and means I'm looking forward to the other two installments!
8/30/2010 8:29 AM | Robert Glynn
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

@Simon Fox

True, though many people would object to an extension method being called on a null reference because it's not quite proper OO behavior, so I avoided that leap in the blog :-)
8/30/2010 12:18 PM | james michael hare
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

agreed... as you might have noticed from other comments, the features are already known. But the hint here is to realize how they can be used to write cleaner code and getting them into one's habit...

I'd like to add a comment about the as operator: I've seen people use it too many times instead of a plain cast. If there is no type check, and the types are not compatible, a cast is better than using the as operator, since you get an invalid cast exception in the correct place, and not a null reference exception elsewhere. The code of your second wonder is instead the right place for the as operator.

Looking forward to reating the other 10 wonders!
8/30/2010 3:06 PM | blurredbytes
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Nice, i like it!
8/30/2010 7:31 PM | Jack
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Very nice post,I like it.
I'm looking forward for the other 10 wonders!
8/31/2010 2:13 AM | alaa9jo
Gravatar

# ndscard

Using NintendoDSTT ds R4i DS console, consumers can enjoy movies, enjoy and conserve pictures, evaluate e-books, hold out tunes and numerous more. amid the good skills of Nintendo ds r4 DSTTis it consume reduced power. It is accessible in industry with quite sensible worth in which consumers can effortlessly choose buy. The product is not just compatible with Nintendo ds and ds lite however it also provide good compatibility with Nintendo dsi. It is essentially a 3rd celebration product which allows its consumers to hold back again up their ds gaming library producing utilization of one cartridge. The Nintendo ds r4 help to custom made developed functions as well.
8/31/2010 3:25 AM | baijuns
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

I wasn't aware of some the above items - thx for sharing!!!
8/31/2010 9:15 AM | Ryan Lowdermilk
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

How about I want wait for 1 hour 10 minutes and 5 seconds?
8/31/2010 9:31 AM | kevin luan
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Another point on the "as" operator - it doesn't work for value types, since the result cannot be null. So, for example:

object o = 123;
if (o is int) DoSomething((int)o);
// int i = o as int; <= Compiler error
8/31/2010 1:05 PM | Richard
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

"How about I want wait for 1 hour 10 minutes and 5 seconds? "

var x = TimeSpan.FromHours (1)
.Add (TimeSpan.FromMinutes (10))
.Add (TimeSpan.FromSeconds (5));

Or just use a regular constructor, it's up to you ;)
9/2/2010 7:19 AM | Alan
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Richard:
Regarding usage of as on value-types:
Value-types can't be null, but you can in that case nullable value-types ;-)

In your case:
object o = 123;
if (o is int) DoSomething((int)o);
int? i = o as int?; //<= No compile error
9/2/2010 9:04 AM | SteinarH
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

@Richard: good point, as cast isn't a silver bullet, but it beats double checking many times.

@Alan: Yeah, I'd go with a regular constructor, or, you can use named parameters (new in C# 4) and remove the ambiguity by actually uing the parameter names:

var x = new TimeSpan(hours:1, minutes:10, seconds:5);
9/2/2010 1:01 PM | James Michael Hare
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Very much informative, I am especially impressed with stop watch.

Thanks
9/3/2010 1:08 AM | Abdul Rauf
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Using Nintendo ds EZFlashR4i DS console, consumers can enjoy movies, enjoy and conserve pictures, evaluate e-books, hold out tunes and numerous more. amid the good skills of Nintendo ds r4PS3 games is it consume reduced power. It is accessible in industry with quite sensible worth in which consumers can effortlessly choose buy. The product is not just compatible with Nintendo ds and ds lite however it also provide good compatibility with Nintendo dsi. It is essentially a 3rd celebration product which allows its consumers to hold back again up their ds gaming library producing utilization of one cartridge. The Nintendo ds r4 help to custom made developed functions as well.
9/3/2010 5:44 AM | baijuns
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Great series. Thanks for pointing out the stopwatch. I'll use that in place of writing my own
9/3/2010 3:49 PM | Derek
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

I like null coalescing op, but how often do you really return a single variable? I find I do more things like:

return Person.Address

And then I need to check if Person is null first. I wish I could do:

return Person.Address ?? "N/A";

Or even (in case of objects):

return Person.Skill ?? null;

So if Person is null, it will return null. In JavaScript, you can do:

return Person && Person.Skill;

so if Person is not undefined, it will go to the next statement Person.Skill. I do that a lot in my JS and it works awesomely.

Any ideas on how to prevent code like this?

if(Person == null) return null;

return Person.Skill;

(or I guess, return (Person == null) ? null : Person.Skill;)
9/3/2010 7:06 PM | Kamran
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

@Kamran:

Unfortunately the ternary is probably the cleanest. You could create a static helper method or extension which would call a delegate to return a field if the item specified were non null and return null otherwise, but that might look muchore awkward than the ternary.
9/4/2010 9:12 AM | James Michael Hare
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

very informative. thanks!
9/6/2010 3:03 AM | Jainy
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

It's useful. Thanks
9/8/2010 11:31 PM | phutang
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Great collection of things there. I can use the null coalescing operator for a time in my projects and it really helps to reduce the code and make the code easier to read.
9/9/2010 11:59 AM | cnaboard
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Nice article, consice information for the 'Better' code. We know most of these, however it is good to get these together at one place
9/10/2010 6:10 AM | Sujit
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Nice. I personally dislike the "Null Coalescing Operator" as it is hard to read... I actually think the normal if-statement gives better readability - am I alone in this?
9/10/2010 8:05 AM | Bolt
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

very good c# tweaks
9/12/2010 3:29 AM | Sen Thomas
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Cool tips and tricks, what about .NET 4.0?
9/16/2010 3:51 AM | Slava
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Very informative and really helpful to me because i am totally new bie in the C#.net and your litter wonders are help me a lot......
10/16/2010 1:01 AM | Smoke Assist
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Excellent! Thanks mate.
11/22/2010 4:43 PM | emon
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

that's a very good post, I add it to my favorites !!
11/23/2010 2:07 AM | Bruno ARIU
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Great stuff. thanks a lot.
11/23/2010 2:46 AM | Tarun Juneja
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Great article!. TimeSpan as a parameter in sleep and similar functions is a very good idea, I will use it from now on!. The ?? operator, well, simply elegant. Cool.
11/23/2010 5:38 AM | José A. Pardo
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

#1 gets even better if 'TrimToNull' is an extenstion method, no?
12/1/2010 2:42 AM | Marc Lewandowski
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Duh, nevermind... should save these observations for saner hours. Feel free to delete these.
12/1/2010 2:47 AM | Marc Lewandowski
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

nice post!
12/23/2010 2:02 PM | suneeth
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Thanks!
2/16/2011 12:07 PM | James Michael Hare
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

I'd like to add a comment about the as operator: I've seen people use it too many times instead of a plain cast. If there is no type check, and the types are not compatible, a cast is better than using the as operator, since you get an invalid cast exception in the correct place, and not a null reference exception elsewhere. The code of your second wonder is instead the right place for the as operator.
2/24/2011 5:32 AM | Red Sea Holidays In Egypt
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Like anything, it's possible to overuse any "tool" thinking it's the only "tool". I did not mean to infer that you should only ever use the as cast, just that a type check & cast if it's the type you want can be replaced with as.
2/24/2011 12:24 PM | James Michael Hare
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Great post, very helpful, Thanks so much.
2/26/2011 5:27 AM | ElPluto
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Thanx for such a nice work James,
not all was new for me
but i really loved the way u presented the OLD and NEW approached with code examples..
it really inspired me
Thanx once again
3/5/2011 2:34 AM | Bilal Haider
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Great post. I never knew noticed the Time Span approach. Thanks!
4/23/2011 3:45 AM | Raj Aththanayake
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Nice site I like it so much,
keep it up :)
8/5/2011 12:36 AM | Melisa Ricks
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

I like to create a timer class that implements Idisposable and then stop the timer and output in the dispose method. That way you can just wrap the class you would like to time in a using block without having to worry about instantiating a stopwatch object.
9/28/2011 3:23 AM | Greg
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Very nice article, Thank you for sharing your knowledge
11/28/2011 3:55 AM | Prasad
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Very nice article for C# developers...
1/28/2012 9:26 AM | Kishore
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

great article thanks!
5/26/2012 10:46 PM | Satyendra
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

Thank you for the article.. stopwatch class was really interesting!!
10/9/2012 8:12 PM | Sumanth
Gravatar

# re: C#/.NET Five Little Wonders That Make Code Better (1 of 3)

very nice article,have a good reference for me
4/3/2014 1:53 AM | feng
Post A Comment
Title:
Name:
Email:
Comment:
Verification:
 

Powered by: