I've been running into code (new code) that uses what I call 'Parallel Arrays' or Lists. Meaning there are 2 arrays that contain related data and are linked by their position (index) in the array.I consider this confusing and prone to all sorts of errors. The solution I normally propose is to create an object called Company with the fields CompanyId and CompanyName.An very real example:List<string> companyNames;List<int> companyIds;//...They get populated somewhere and we then processfor(var i=0; i<companyNames.Count; i++){    UpdateCompanyName(companyIds[i],companyNames[i]);}Are these parallel arrays considered bad practice?
When is it okay to use Parallel Arrays?
object oriented;programming practices;code smell
Here are some reasons why someone might use parrel arrays:In a language that does not support classes or structsTo avoid thread locking when individual threads are only modifying one of the columnsWhen the persistence method forces these things to be stored separately and you are reconstituting them.They can consume less memory if the structures are padded. (not applicable for these data types in C#)When parts of the data need to be kept close together to make efficient use of the CPU cache (would not be of help in the above code). Use of Single Instruction Multiple Data (SIMD) op codes. (not applicable for this code, or strings at all)  I do not see any compelling reason to do this in this case... and there are likely better options in all of the above or are not so useful in a high level language. 