Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the difference between

public delegate void SecondChangedHandler(Object clock, TimeInfoEventArgs ti);
public event SecondChangedHandler OnSecondChanged;


public event EventHandler<TimeInfoEventArgs> OnSecondChanged;

When should you use which and is there any best practice?

share|improve this question
up vote 9 down vote accepted

Before generics the first approach was the only option to declare an event handler delegate. Since generics were introduced in .NET 2.0, EventHandler<T:EventArgs> is the preferred way. Semantically there is no difference between them.

share|improve this answer

There is no difference indeed. Then EventHandler<T> (msdn) has just been added as a "shortcut" to avoid having to redeclare the delegate.

share|improve this answer
+1 - It is indeed to avoid having to redeclare the delegate. – Karthik Sreenivasan Feb 21 '12 at 4:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.