Richard wrote:
> On Apr 16, 8:50 pm, "Pete Dashwood"
> <
dashw...@removethis.enternet.co.nz> wrote:
>> Arnold Trembley wrote:
>>> On 4/13/2013 7:09 PM, Pete Dashwood wrote:
>>>> Alistair Maclean wrote:
>>>>> (SNIP)
>>
>>>>> I am happy using COPY on my hobby database as it allows me to
>>>>> modularise and more easily develop/maintain a modelling program
>>>>> that I am experimenting with. I even use the COPY for SELECTS,
>>>>> FDs, working storage and procedure code. Bliss.
>>
>>>> Why not use Cut & Paste? :-)
>>
>>>> Pete.
>>
>>> There's no need for a smiley. Cut & paste is a perfectly valid form
>>> of code re-use. Unlike COPY, you cannot pick up a new version with a
>>> recompile, but you also avoid the version control issues associated
>>> with COPY. It's very similar to cloning a COBOL program.
>
> While 'cut & paste' may be the generic term, it is actually 'copy &
> paste' that should be used.
>
Correct.
But we are having a friendly discussion. Everyone concerned knows what is
meant.
> The problem with using 'copy&paste' is that if there is a change
> required then it must be tracked down in _every_ program that this was
> pasted into.
And that's why we mostly don't do it...
"Tracking things down in programs", using modern tools, is really no big
deal, though.
>
> From earlier:
>
> """ The point I was trying to explore is not about COPY (that's just
> an example
> of it, from COBOL). Rather, it is about the whole IDEA of duplicating
> something in code.
>
> BECAUSE this is facilitated (through mechanisms like COPY),
> programmers go
> right ahead and do it.
>
> My argument is that they probably shouldn't and there should be better
> ways
> to achieve the result of propagating the same structure and
> functionality
> into different places where it is needed.."""
>
> So first you argued that duplicating code shouldn't be done, and now
> you advocate duplicating code.
I can see how this could be confusing to someone with a black and white,
pedantic mind. Someone incapable of seeing shades of grey and being unable
to adopt different positions for the sake of discussion?
I'm not "advocating" anything. I would need to care in order to do that and
I already explained that I actually don't.
However, there s nothing wrong with exlorring some of the implications of
points raised, in the form of a general argument.
>
>
> If you have a problem with alleged 'VCS issues' then maybe you are
> using the wrong VCS. I like Bazaar.
I have no issue with VCS. I used Panvalet and similar systems for years and
the programming team at PRIMA is not so large that we can't talk to each
other.
Besides, I don't use COPY so that particular versioning trap simply doesn't
arise.
>
>
>>> It might not be as sophisticated as calling a dynamically loaded
>>> subprogram, or re-using an object, but it still saves some work.:-)
>>
>> OK, I stand chastised... :-)
>>
>> The original comment was tongue-in-cheek but I take your point.
>>
>> There are so many problems inherent in using COPY (as was pointed out
>> previously regarding test and production library versions etc. and
>> trying to control it where many people are using it in different
>> programs at the same time) I'm tempted to think Cut & Paste MIGHT be
>> better...
>
> You did mention the problems associated with using card packs, yes.
> Copybooks, especially FDs and Linkage areas, and even WS data
> structures, must be put under special control, such as a db admin.
I would agree it is good if they are, but I think "must" is too strong. It
depends on the size of the team.
>
>
>> Another thing I hate about COPY is when people send me code for
>> help, and completely forget that without all the COPY books I simply
>> can't even compile it. I ask for the COPY books and get a ZIP file
>> that doesn't match what they are using. I've had occasions where a
>> complete solution was provided to them after several days work, but
>> it was useless because of wrong COPY books.
>
> I suspect that 'when people send me code for help' is because they no
> longer have anyone who knows anything at all about the system. Either
> because the programmers have left or because it has been ignored for
> many years. I get systems like that handed to me too.
>
I can assure you that some very competent people who really DO know what
they are doing sometimes send me code to confirm whether it is system
software or their application causing a problem. Mostly this is in the area
of PowerCOBOL, where support has been poor and a lot goes on "under the
covers". It has become less frequent lately and I think this is because more
and more people are moving off PowerCOBOL and also because the support from
offical vendors has improved. It is still annoying when they nforget the
COPY books, and that was my point.
>
>> Then there is the cryptic Fujitsu message about the COPY library
>> being not properly constructed or defined (when it is perfectly OK).
>
> I have never seen that.
Be thankful... :-)
>
>> Not to mention that over 90% of the problems we have when migrating
>> people is caused by bad COPY book definitions. You can save days of
>> work just by getting the COPY books compliant with the
>> standard...(ensuring group fields, REDEFINES, OCCURS etc are legal.
>> It is quite amazing how many source books we get that are not.)
>
> That doesn't seem special to copybooks, bad code can be anywhere.
Yes, it can. But for us the COPY books from Clients are critical because
their data repository will be generated from an analysis of it. Most of the
time, it is problems with old Legacy COBOL definitions that get spat out by
the CreateTables tool. If the Source Sets (SELECTs and FDs) are of good
quality and '85 standard compliant, data conversion goes like a dream.
>How
> would 'copy & paste' from the copybook directly into the program
> source magically make it better code ?
Obviously, it wouldn't. That's not the point.
>
>
>> But I sound like I'm ranting so I better stop.
>>
>> At least when you look at our generated code it contains the
>> expanded COPY book that was used. It is deliberately hard coded.
>> This is a check so you can see exactly which definitions were used
>> to build your database and to generate the access against it. It
>> CAN'T change because someone changed a COPY book somewhere.
>
> That 'someone' can change program code too.
You're quite right about that. However, in practice over the last four
years, we have never had a client change the templated code that is
generated. They have never needed to and thousands of hours were spent
debugging it and getting it right. We have NEVER had a DAL object fail or
hang in production (always a first time, I guess - I am never smug about
computer programs). The generated COBOL is an open book and people COULD
amend it if they wanted to; they just don't. Occasionally they DO amend
generated code to LOAD their new DB, adding filters and checks of their own,
but most clients don't even do that.
>
>> (If it does HAVE to change, it is a matter of seconds to regenerate
>> the Table Set on the RDB and the COM component/interface block that
>> manages it in the DAL layer. The new interface needs to be
>> recompiled into the affected application programs and this means
>> re-running them through Transformation. (That could take a few
>> minutes if there are a number of programs. Another way to do it is
>> to simply make the new interface a COPY book (if you normally use
>> COPY) and just recompile the affected, already Transformed,
>> programs.)
>>
>> As a general rule, it is good not to mess with COPY books any more
>> than you absolutely have to.