As all of us know, .NET has very good documentation and variable/parameter naming. Oftentimes, you can figure out how to pass parameters to a function just by variable names shown at design time without consulting the documentation at all. Something that is very interesting for me is that the only variable that has an unrelated name is e which is used in nearly all event function declarations such as:
private void button1_Click(object sender, EventArgs e)
private void button1_DragDrop(object sender, DragEventArgs e)
My question is why do they name all event arguments e? Is there history behind it?
Ah! It was some lazy Microsoft Programmer :). Lolz jokes apart, this is an actual event naming guideline of Microsoft.
http://msdn.microsoft.com/en-us/library/h0eyck3s
This is what the third bullet says.
“Specify two parameters named sender and e. The sender parameter represents the object that raised the event. The sender parameter is always of type object, even if it is possible to use a more specific type. The state associated with the event is encapsulated in an instance of an event class named e. Use an appropriate and specific event class for the e parameter type.”