3 ms·
Given your Coord example, can you come up with a better OO version than the article's advice of "can I make it immutable"? The immutable version would let you
by mrkeen 2y ago
Given your Coord example, can you come up with a better OO version than the article's advice of "can I make it immutable"?
The immutable version would let you have all four fields. A setter on any of the 4 items (should you desire it) will return a new object whose four fields remain consistent with one another.
- polotics 2y ago...and how precise do the switches between coordinate systems have to be? depending on your format for floats, you will land on areas that are only expressible with perfect precision in one or the other coordinate system. I can imagine a fixed point that moves around by being repeatedly queried in one or the other system.