views:

63

answers:

4

What is the most commonly used convention (in C# and VB) to name object, when I want to emphesize that it is an instance of class that implements some interface. Like here:

//is iDisp correct name?
protected void Dispose(IDisposable iDisp)
{ 
    iDisp.Dispose();
    Console.WriteLine("Disposed");
}
+2  A: 

I'd drop the I from the interface name and camel-case the remaining name, so for your example I'd call it disposable.

Lee
+1  A: 

I would not use the name iDisp, but rather name the variable disposable.

Since the interface name should describe a function/protocol that should be implemented, the name disposable tells that the object implements this function.

Rune Grimstad
+1  A: 

I dont think is there any naming convection for this. If I were you I just use the name: disposable or d

Sebastian Brózda
A: 

Microsofts naming guidelines can be found -->here<--

jgauffin