Shouldn't you really make the Z, X and Y coords different TYPES? Seems to me you make a lot of typos with those coordinates. If Typing structs keeps you from making errors, then why not be consistent?
You make a LOT more of that kind of typos than you do mixing up actual TYPE definitions. And, after all, there is nothing even remotely similar between an X and an Z coordinate. They are not even in the same dimention ffs.
Cant you create a xcoord type, ycoord type and so on, to let the compiler find those typos? Yes you can. That's the point of types, to avoid assignment of incompatible types. Doing this will prevent any x,y,z typo, from making it into the exe. Unless I misunderstand something.
I don't see how this helps, because you still will need to type X or Y somewhere in code where you use individual coordinates. Yeah you can not do "A.X = A.Y" anymore, but I don't think it is needed to prevent that.
Oh, you want to overload every single operator/function also? In this case operator +=. I don't think that is a feasible solution. Sure for Vector operations +/-/.. you could do that. But what if you need to add X to Y? Or Y to X in some cases? Then you need bunch of more operations. What if you need some function to operate with X and Y coordinate separately and Rectangle (or something) - bunch of more functions. This can easily explode exponentially if you need to support every single combination of different types.
no, not me. i am not even saying i agree. i just told you what i think HE meant.
ps. you don't need other functions / overloads to add X to Y or any other combination of coordinates. in those (rare) cases you just add their .Value members. i think his sole point was to protect against accidentally mixing up the X, Y and Zs by making them distinct types. which could be done - with just a little overloading.