in reply to Re^2: What data structure is this and how to access?
in thread What data structure is this and how to access?

tobyink:

I understand what you mean. However, sometimes you have to start with a simplification to get the basic point across without complicating the environment overmuch. When we answer a question, we're frequently (consciously or not) walking a tightrope trying to balance between a simple (and somewhat deficient) answer and a longer (and more technically accurate, yet possibly more confusing) answer. External factors also come into play: for example, my time was short this morning before my commute to work, so it biased me towards shorter answers.

In this specific case, he wanted to know the name of the structure he was creating as well as how to access the elements. So for the question asked, I think my answer is fine. Obviously, a longer answer showing the flexibility of the array, like you demonstrate, would also be fine. I just opted for the shorter answer in this case. If he posed the question differently, I might've presented an answer more like yours.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

  • Comment on Re^3: What data structure is this and how to access?