Background:
I am having a discussion with a friend regarding the correct way to refer to elements within a 2D array for something I'm designing. I was unhappy with using XNA's Point
and Vector2
structs as array references because the properties of them are labelled X
and Y
.
I created my structs for these, ArrayPoint
and ArrayVector2
and called my own properties I
and J
. My friend thinks this is a massive waste of time, however, I do not like swapping the X
and Y
references because my maths background has always taught me to use i and j for matrices, e.g using myArray[i, j]
instead of myArray[y, x]
.
What is the best way to deal with this situation?
Is it simply a case of swapping x and y? Or creating your own structs to deal with it how you like? Is it all down to personal preference since this is pretty much all arbitrary anyway?