× 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.



 >>  Of course, java programmer normally create a setter for each variable.

More important is the reason for creating getters/setters in the first
place.  It is to encapsulate the data so that the _only_ way it can change
is under the control of the code that "owns" that data.  That is exactly the
opposite of what you are doing.

I try to avoid touching global data at all unless I have to.  If I look at
code like this:

MyVar = MyProc(parm1: parm2 ...)

I like to _know_ that only MyVar got changed.  And to _know_ that the values
in parm1 and parm2 were the controls for that process.

If I see "Exsr MySubr" or "MyProc()" I know absolutely _nothing_ about what
variables are modified, or what variables control the process unless I go
read the code.  The less code I have to waste time reading (only to find it
is not relevant to the bug/update at hand) the better surely?  In this case
the only advantage of the subproc MyProc over the subroutine is that MyProc
can define its own private variables - which can lead to less clutter in the
mainline D-specs.  But that's about all it buys you.

The only time I touch globals is in an I/O module - and with the advent of
V5R2's ability to specify a DS as the result of an I/O operation - even that
is needed less often than it was.

Just my 2 cents worth.

Jon Paris
Partner400
www.Partner400.com



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.