Variable naming for arrays/lists/collections - C#

Posted by David Neale on Stack Overflow See other posts from Stack Overflow or by David Neale
Published on 2010-05-06T07:45:29Z Indexed on 2010/05/07 19:18 UTC
Read the original article Hit count: 400

What should I call a variable instantiated with some type of array?

Is it okay to simply use a pluralised form of the type being held?

IList<Person> people = new List<Person>();

or should I append something like 'List' to the name?

IList<Person> personList = new List<Person>();

Is it generally acceptable to have loops like this?

foreach(string item in items)
{ 
    //Do something 
}

© Stack Overflow or respective owner

Related posts about .NET

Related posts about c#