Importance Of Variable Names

Can anyone see the problem with this bit of code?

    public class InterfaceKitDigitalOutputCollection
    {
        
// Fields
        private IntPtr phid;
 
        
// Methods
        internal InterfaceKitDigitalOutputCollection(InterfaceKit phid)
        {
            
this.phid = phid.phidgetDeviceHandle;
        }

 

I changed the local parameter

        // Methods
        internal InterfaceKitDigitalOutputCollection(InterfaceKit
 interfaceKit)
        {
            
this.phid = interfaceKit.phidgetDeviceHandle;
        }

 

And suddenly the code is more consistent and readable.  A small change to be sure, but I lost 5 minutes assuming that variable names were unique in the class.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: