Apologies if this is not a very technical question, but I am struggling with naming my dictionary.
Questions
Is there a better way to name my dictionary and function?
Reasoning
This there are multiple String fields in Car and the dictionary and thought (could be wrong) it be better to state what the key field in the dictionary meant.
Code
struct Car {
let name: String
let sourceID: String
let manufacturerID: String
let price: Int
}
let cars = [Car]() //array
let carsGroupedBySourceID = [String: Car]() //Dictionary
func doSomething(withCarsGroupedBySourceID carsGroupedBySourceID: [String: Car]) {
}