Variable names for Contact Information bits

Posted by RustyTheBoyRobot on Programmers See other posts from Programmers or by RustyTheBoyRobot
Published on 2012-06-28T16:54:37Z Indexed on 2012/06/28 21:24 UTC
Read the original article Hit count: 199

Filed under:
|

I am in the middle of refactoring code and would like to get some ideas on variable naming so that my new names clearly represent the data they hold.

I have a class called ContactMethod which makes sense to me; each instance is a different way to contact someone. My problem comes when naming the properties of ContactMethod. For example, one instance might be a Fax number of 555-555-5555 while another could be an Email address of [email protected]; I've got a property called contactMethodType to hold the values "fax" or "email", but I don't know what to call the "555-555-5555" or "[email protected]" part. Has anyone here created a good generic name for this piece of contact information?

(PS - the old convention was to call it a "Phone" with fields "phoneType" holding the "fax"/"email" value and "phoneId" holding the number/address. Yuck.)

© Programmers or respective owner

Related posts about naming

Related posts about variables