Do you use more meaningful names than Hungarian short form?
Rules to Better .NET Projects|b453a4db-2021-4c21-82cc-db69f0e180bb
v3.0
Posted at
20/10/2010 7:56 PM by
System Account
Rule Intro
Hungarian notation is used in VB6. In .NET, there are over 35,000 classes, so we can't just call them with three letter short form. We would suggest the developer use the full class name as in example below. As a result, the code will be much easier to read and follow up.
Page Content
-
//Bad Code
DateTime dt = new DateTime.Now();
DataSet ds = new DataSet();
// It could be confused with Date time.
DataTable dt = ds.Tables[0];
- Bad code - Without meaningful name.
-
//Good Code
DateTime currentDateTime = new DateTime.Now();
DataSet employmentDataSet = new DataSet();
DataTable ContactDetailsDataTable = ds.Tables[0];
- Good code - With meaningful name.
More information on naming convention.
{2D7B5600-F65A-4172-9656-B5A3C8A402B0}
Do you feel this rule needs an update?