Re: Thou shalt have no other gods before the ANSI C standard

From: rpl (plinnane3REMOVE_at_NOSPAMyahoo.com)
Date: 02/18/05


Date: Fri, 18 Feb 2005 09:50:57 -0500

jmfbahciv@aol.com wrote:
> In article <7s2dnSLs0KNna4nfRVn-qg@rogers.com>,
> rpl <plinnane3REMOVE@NOSPAMyahoo.com> wrote:
<snips>>>
>>
>>Wow. Somebody should frame that in the "do not do this" hall of fame.
>>Classic (COBOL) structural error.

> Nope. Again, read what I wrote. The purpose was to "save" code.
> The _measurement_ used to determine if any was saved was completely
> wrong.

? a PERFORM does a push, jump, (blahblahblah), pop, jump... guy *did*
save code as measured by executable static memory size. Of course he
also added to the number of instructions necessary to run the program
because of the added PERFORMs overhead (duh). YMMV as to whether that's
a good tradeoff for maintainability.

Modern (as in post 1975 <grin>) methods woulda tossed the "is this a
call from the subroutine?" test into the bin and put whatever the common
statements were outside the mainline to be PERFORMed from the mainline
as well as from everywhere else.

(Now it) sounds like an input read from a tape file with alot of
level-breaks (a flattened rdb)(?).

Hey... I'm not doing your COBOL homework for you, am I ? <g>

>>.. Again I'm guessing what this guy's
>>done, but sounds like the subroutine was an add-on not done by the
>>original programmer.

> When you maintain somebody else's code you make
> the changes within the context of _the philosophy of the
> programmer_. This means that you figure out how the coder thinks
> and then patch using his thinking processes. If you don't, the
> chances are high that you are inserting a bandaid.

Yeah but you said 'spaghetti code'; (to me) that means something that's
basically duct-tape and string... patches by people with different
writing methods (or lack of) for instance. If there was a consistent
"method in the madness" then that's just a different structuring/coding
method ('spaghetti code' being an inaccurate slur).

If you're using a mainline and perform statements, then you want/need to
put high-iteration code at the front of the program to avoid paging.
(You still don't want it in the mainline (which is just flow-control)
though)

> What I did was look at the reasons the code had to be spaghetti.
> The culprit (where all this code's bugs were) was in the original
> input data format. I fixed that.
>
>>Define "co-routine"
>
> I don't know how to define the term in English ASCII. And I don't
> know C to describe it in code.

That's good 'cause I don't speak 'C'. ("Why did the chicken cross the
fanfold? To write a C program"), but it sounds like basically you're
tossing main control back and forth between two parts of the program.

> Is co-routine another DEC-centric phrase? Our CPU architectures
> had instructions that made this possible.

no clue. Maybe the mainline should've explicitly included the
flow-control part of the subroutine...

rpl

>
> <snip>
>
> /BAH
>
> Subtract a hundred and four for e-mail.