usea said:
But even I can recognize the immense benefit.
To the person who originally asked the question about points: Sorry for derailing your question.
That being said, surely even you can realize what an immense overstatement that is? Immense benefits are things like LTCG or OOP in general. A freaking getter and setter is not an immense benefit.
It's a freaking point for christ's sake. I can pretty much guarantee you that if your get function is doing anything other than returning x in your extremely primitive point class, you have bigger problems to worry about.
But ok, I'll humor you for a second. Suppose you are making use of an external library that is optimized for, oh idk, SSE. It provides a function that transforms a 3 dimensional point by a transformation matrix. Since this is an external library and has no idea what your proprietary object hierarchy looks like, it simply exposes a function like this:
Transform(m11, m12, m13, m21, m22, m23, m31, m32, m33, *px, *py, *pz);
OOOOOPS.
"Aha!", you say. "You can simply provide a transform member function that has access to the internals of the class". Terrific. That is, of course, unless your code base is like every other code base in the world (i.e. imperfect). Oh *that* matrix. That one is in row-major order. Maybe I should make a TransformInRowMajor() function instead, or just add a bool to the end of my Transform() function that says which order to interpret the matrix in. (Hint: This is starting to get stupid). Maybe it's actually a 4x4 matrix but I only want to transform using the 3x3 matrix in the upper left corner. Sure would be nice if I could just access those pesky little x, y, and z variables.
Download any library in the world for doing 3D math that wasn't written by someone who was just eager to apply their hard-learned OOP concepts, and you'll see that points, like every other simple thing in the world that are just plain-old data, have their member variables public.