In .NET, whenever I refactor a list of, say, strings to a more complex data structure to store more data, I am often tempted to use a dictionary or tuple to store two values. And everytime somewhere down the road i need to refactor again to accommodate for a third value or even more. JUST USE A LIST.
// fine List<string> values; // Ill just add a value here Dictionary<string, int> values; // hmm maybe like this Tuple<string, int> value; // oh fuck, now i need a third value Tuple<string, int, bool> values; // ??? // oh fuck, now i need to filter my dict values. Where(kv => kv.Value == 42). ToDictionary(kv => kv.Key, kv => kv.Value); // ??? // fine again 😌, why the hell did i not just do this :( List<MyValue> values;