3 ms·
Agreed, especially if the related values occur a lot in a program and are thought of as "thing". E.g. a Point or Line class. I do think this moves the problem
by mattarm 5y ago
Agreed, especially if the related values occur a lot in a program and are thought of as "thing". E.g. a Point or Line class.
I do think this moves the problem of possible argument confusion to the construction of the new type. At some point the association must be expressed in code, and if the association is between two things of the same type the type system can't flag mistakes as errors. A simple data class still helps, even if it doesn't eliminate the problem, because people can more easily remember one Point(x, y) constructor than where "x" and "y" appear in dozens of different functions.