× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Adam -

On Wed, 12 Dec 2007 11:30:28 -0500, Adam Glauser
<adamglauser@xxxxxxxxxxxx> wrote:

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.

Ken Sims wrote:
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?

Clarity - see Jon Paris' earlier message for an example.

If you're talking about his example of comparing the values of a
subfield in two different occurrences, that is using functionality
availablle only to array structures, whereas I said specifically ..

If you're *NOT* using functionality that is available only to array data structures
(emphasis added)

so his example is irrelevant to what I'm saying.

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.

"Premature optimization is the root of all evil." - Donald Knuth

I don't see that that quote has anything to do with what I'm saying.

I'm not advocating some esoteric optimization method, I'm just taking
advantage of a straight forward programming technique. Anyone who
isn't capable of understanding how a MODS works ought not to be
programming, at least in any procedural language.

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.

Agreed, mostly. Even the best programmers can make mistakes, so
whichever version is more standard and more explicit is probably better
in the long run. In my opinion, that is the DS array.

More importantly, I suspect that any new functionality that may be
implemented would would be array DS only, as Jacobus suggested:
I don't know if it's "official" (whatever that means) but i would say
that MODS should be considered depricated

<GAG>

As a real life example, in a program that I'm currently writing, I
originally coded a data structure as an array data structure. As I
was putting the array index on the statements loading the various
sub-fields, I thought "Why the hell am I doing this? I'm not going to
be sorting it or doing anything else which needs the array
functionality." So I changed it to a MODS.

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.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.