Hi Jacobus -
On Wed, 12 Dec 2007 11:26:33 +0100, john e <jacobus1968@xxxxxxxxxxx>
wrote:
This is because with arrays, the index of element you are refering is explicit, while with MODS it's implicit.
I consider that an advantage in most circumstances. If you're not
using functionality that is available only to array data structures,
why have to bother to put the array index on the access to every field
in the data structure? And if the index is a variable, it has to be
resolved and checked every time to make sure it is within the allowed
range. With the regular MODS, resolution and checking only has to be
done when the occurrence is set. After that it's just like using a
single occurrence data structure, which is better for performance.
With MODS, you "set" the index with some built-in function or opcode somewhere in your code and somewhere else in the code you refer to the "current" element.
And with an arrary data structure you "set" an index variable with
some built-in function or opcode somewhere in your code and somewhere
else in the code you refer to the element referenced by that variable.
Bad coding is bad coding, whether it's a MODS or an array data
structure. Programmers who can't keep track of an occurrence
shouldn't be in the programming business, just like ones who can't
keep track of an array index, whether it's array data structure or a
plain ol' array.
Ken
Opinions expressed are my own and do not necessarily represent the views
of my employer or anyone in their right mind.
As an Amazon Associate we earn from qualifying purchases.