Maybe the Smart People on this list can give a good rule of thumb for
deciding when to READU/WRITE vs. MATREADU/MATWRITE. After all these
years, I still don't have one.
From: Richard Taylor
>
> We are faced with this same situation and the thought behind this
> truly baffles me.
I will admit to some of the same bafflement.
> Why take a flexible, dynamic database system
The syntax for dynamic arrays is more natural for the language, too
(e.g., XYZ(17)<1,5> vs. XYZ<17,5>).
Readability makes for maintainability, generally the most important
contributor to software quality.
> and force it to be fixed length.
well, sorta. Each element of the dimensioned array is a variable length
dynamic array. ( See my previous post for how to complicate your life
by inserting attribute marks. )
> This is what you are doing using dimensioned arrays and MATREADs. The
most
> common justification I have heard is performance and this simply does
not hold
> water.
Within limits (but I don't know the limits).
If you have a program that manipulates many attributes many times, then
it makes sense to matread them into a dimensioned array up front, and
matwrite them in the end, thereby limiting big string manipulations.
People forget or newbies don't know that CUST.REC<117> is really
EXTRACT( CUST.REC, 117,0,0) or REPLACE(...,CUST.REC,117,0,0). That can
be very expensive when you do that for many attributes many times, with
large dynamic arrays. By contrast, each dimensioned array element has
its own memory address, so references and assignments can jump straight
to it.
But I do not have a good appreciation for what "limits", "many", "big"
really mean in my previous paragraph. Does anyone have a good
heuristic?
> I started in Pick in R83 and have never used a dimensioned array to
> hold record structure and I have not seen performance issues. This to
the
> extent that we ran an MRP run on a 286 Wyse PC that choked the
mainframe at
> this company.
Ah-ha, my dear Watson, then you don't really know how that system would
have screamed if you'd used dimensioned arrays instead, do you?
>
> "The more they complicate the plumbing
> the easier it is to stop up the drain"
Yeah. What I said about dynamic array syntax being more natural.
cds
P.S. Why are we limited to 1- or 2-dimensioned arrays?
E.g., DIM XYZ( 5,10,2,3,8 ) would be a 5-dimensional array.
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/