2 ms·
My general rule (in Scala) is that if I need a tuple larger than two or three elements, I'm better of writing a case class. Tuples get unreadable real fast. I
by kelnos 6y ago
My general rule (in Scala) is that if I need a tuple larger than two or three elements, I'm better of writing a case class. Tuples get unreadable real fast.
I think tuples are an essential language feature (and it's ridiculous that Java doesn't have them yet), but I think they're often way overused.
- valenterry 6y agoMy heuristics is much more based on how often the same structure is used and in which places. Sometimes type aliases are a more light way compromise too.