Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"It runs like _x, where _x is something unsavory" -- Prof. Romas Aleliunas, CS 435


computers / comp.os.linux.misc / Re: self-documenting APL, not COBOL and tricks

SubjectAuthor
* Linux on a small memory PCThe Natural Philosopher
+* Re: Linux on a small memory PCMarco Moock
|+- Re: Linux on a small memory PCThe Natural Philosopher
|`* Re: Linux on a small memory PCAndreas Kohlbach
| `* Re: Linux on a small memory PCThe Natural Philosopher
|  +* Re: Linux on a small memory PCRobert Heller
|  |`* Re: Linux on a small memory PCAndreas Kohlbach
|  | +* Re: Linux on a small memory PCRichard Kettlewell
|  | |`* Re: Linux on a small memory PCThe Natural Philosopher
|  | | `- Re: Linux on a small memory PCRichard Kettlewell
|  | `* Re: Linux on a small memory PCThe Natural Philosopher
|  |  `* Re: Linux on a small memory PCAndreas Kohlbach
|  |   `* Re: Linux on a small memory PCThe Natural Philosopher
|  |    `* Re: Linux on a small memory PCAndreas Kohlbach
|  |     `* Fwd: Linux on a small memory PC25B.Z959
|  |      `* Re: Fwd: Linux on a small memory PCAndreas Kohlbach
|  |       `* Re: Fwd: Linux on a small memory PC25B.Z959
|  |        `* Re: Fwd: Linux on a small memory PCAndreas Kohlbach
|  |         `* Re: Fwd: Linux on a small memory PC25B.Z959
|  |          +* Re: Fwd: Linux on a small memory PCCharlie Gibbs
|  |          |`- Re: Fwd: Linux on a small memory PC25B.Z959
|  |          `* Re: Fwd: Linux on a small memory PCDan Espen
|  |           +* Re: Fwd: Linux on a small memory PCCharlie Gibbs
|  |           |`* Re: Fwd: Linux on a small memory PCComputer Nerd Kev
|  |           | +* Re: Fwd: Linux on a small memory PCComputer Nerd Kev
|  |           | |+* Re: Fwd: Linux on a small memory PCTom Furie
|  |           | ||`- Re: Fwd: Linux on a small memory PCAndreas Kohlbach
|  |           | |`- Re: Fwd: Linux on a small memory PCTom Furie
|  |           | +* Re: Fwd: Linux on a small memory PCDan Espen
|  |           | |+* Re: Fwd: Linux on a small memory PCDavid W. Hodgins
|  |           | ||`- Re: Fwd: Linux on a small memory PCDan Espen
|  |           | |+* Re: Fwd: Linux on a small memory PCComputer Nerd Kev
|  |           | ||+* Re: Fwd: Linux on a small memory PCDan Espen
|  |           | |||+* The Y2K problem - again (was: Fwd: Linux on a small memory PC)Andreas Kohlbach
|  |           | ||||`- Re: The Y2K problem - again (was: Fwd: Linux on a small memory PC)Peter Flass
|  |           | |||`* Re: Fwd: Linux on a small memory PCComputer Nerd Kev
|  |           | ||| `- Re: Fwd: Linux on a small memory PCTom Furie
|  |           | ||`* Re: Fwd: Linux on a small memory PCDavid W. Hodgins
|  |           | || `- Re: Fwd: Linux on a small memory PCCharlie Gibbs
|  |           | |`* Re: Fwd: Linux on a small memory PCEric Pozharski
|  |           | | +* Re: Fwd: Linux on a small memory PCDan Espen
|  |           | | |`- Re: Fwd: Linux on a small memory PCEric Pozharski
|  |           | | `- Re: Fwd: Linux on a small memory PCCharlie Gibbs
|  |           | +- Re: Fwd: Linux on a small memory PCCharlie Gibbs
|  |           | `* Re: Fwd: Linux on a small memory PCAndreas Kohlbach
|  |           |  `- Re: Fwd: Linux on a small memory PCCharlie Gibbs
|  |           `* Re: Fwd: Linux on a small memory PC25B.Z959
|  |            +- Re: Fwd: Linux on a small memory PC25B.Z959
|  |            `* Re: Fwd: Linux on a small memory PCCharlie Gibbs
|  |             `* Re: Fwd: Linux on a small memory PCDan Espen
|  |              +* Re: Fwd: Linux on a small memory PCDavid W. Hodgins
|  |              |`* Re: Fwd: Linux on a small memory PCDan Espen
|  |              | `- Re: Fwd: Linux on a small memory PCDavid W. Hodgins
|  |              `* Re: Fwd: Linux on a small memory PCCharlie Gibbs
|  |               `* Re: Fwd: Linux on a small memory PC25B.Z959
|  |                +* Re: Fwd: Linux on a small memory PCCharlie Gibbs
|  |                |`- Re: Fwd: Linux on a small memory PC25B.Z959
|  |                +* Re: Fwd: Linux on a small memory PCPeter Flass
|  |                |+* Re: Fwd: Linux on a small memory PCThe Natural Philosopher
|  |                ||`* Re: Fwd: Linux on a small memory PCPeter Flass
|  |                || +* Re: COBOL and tricksLew Pitcher
|  |                || |+* Re: COBOL and tricksPeter Flass
|  |                || ||+* Re: COBOL and tricksDavid W. Hodgins
|  |                || |||+* Re: COBOL and tricksDan Espen
|  |                || ||||+* Re: COBOL and tricksPeter Flass
|  |                || |||||+* Re: COBOL and tricksCharlie Gibbs
|  |                || ||||||`* Re: COBOL and tricks25B.Z959
|  |                || |||||| `* Re: COBOL and tricksPeter Flass
|  |                || ||||||  `- Re: COBOL and tricksCharlie Gibbs
|  |                || |||||`- Re: COBOL and tricksDan Espen
|  |                || ||||`- Re: COBOL and tricksRichard Kettlewell
|  |                || |||`* Re: COBOL and tricksCharlie Gibbs
|  |                || ||| +- Re: COBOL and tricksPeter Flass
|  |                || ||| `- Re: COBOL and tricksDan Espen
|  |                || ||+* Re: COBOL and tricksDan Espen
|  |                || |||+* Re: COBOL and tricksPeter Flass
|  |                || ||||+* Re: COBOL and tricksCharlie Gibbs
|  |                || |||||+- Re: COBOL and tricksAhem A Rivet's Shot
|  |                || |||||`* Re: COBOL and tricksThe Natural Philosopher
|  |                || ||||| `- Re: COBOL and tricksPeter Flass
|  |                || ||||`* Re: COBOL and tricksDan Espen
|  |                || |||| `- Re: COBOL and tricksCharlie Gibbs
|  |                || |||`* Re: COBOL and tricksCharlie Gibbs
|  |                || ||| `- Re: COBOL and tricksPeter Flass
|  |                || ||+- Re: COBOL and tricksScott Lurndal
|  |                || ||+* Re: COBOL and tricksD.J.
|  |                || |||`* Re: COBOL and tricks25B.Z959
|  |                || ||| +* Re: COBOL and tricksTauno Voipio
|  |                || ||| |`- Re: COBOL and tricks25B.Z959
|  |                || ||| +- Re: COBOL and tricksScott Lurndal
|  |                || ||| +- Re: COBOL and tricksG.K.
|  |                || ||| +- Re: COBOL and tricksD.J.
|  |                || ||| `- Re: COBOL and tricksAnne & Lynn Wheeler
|  |                || ||`* Re: COBOL and tricksCharlie Gibbs
|  |                || || `- Re: COBOL and tricksDan Espen
|  |                || |+* Re: COBOL and tricksAnne & Lynn Wheeler
|  |                || ||`* Re: COBOL and tricksPeter Flass
|  |                || || +* Re: COBOL and tricksThe Natural Philosopher
|  |                || || |`- Re: COBOL and tricksPeter Flass
|  |                || || `* Re: COBOL and tricksScott Lurndal
|  |                || ||  +- Re: COBOL and tricksPeter Flass
|  |                || ||  `- Re: COBOL and tricksDan Espen
|  |                || |`* Re: COBOL and tricks25B.Z959
|  |                || `* Re: Fwd: Linux on a small memory PCThe Natural Philosopher
|  |                |`* Re: Fwd: Linux on a small memory PCJ. Clarke
|  |                `* Re: Fwd: Linux on a small memory PCJ. Clarke
|  `* Re: Linux on a small memory PCPancho
+* Re: Linux on a small memory PCJoerg Lorenz
`- Re: Linux on a small memory PC25B.Z959

Pages:123456789101112131415161718192021222324252627282930313233
Re: COBOL and tricks

<9mYDK.543533$70j.452979@fx16.iad>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9618&group=comp.os.linux.misc#9618

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx16.iad.POSTED!not-for-mail
Newsgroups: alt.folklore.computers,comp.os.linux.misc
From: cgibbs@kltpzyxm.invalid (Charlie Gibbs)
Subject: Re: COBOL and tricks
References: <ouSdnQ4MiuXqxFf_nZ2dnUU7-L3NnZ2d@earthlink.com>
<HpKdnfYAbfikikP_nZ2dnUU7-cvNnZ2d@earthlink.com>
<574555364.680474584.174865.peter_flass-yahoo.com@news.eternal-september.org>
<5bOdndBzuNkG5kL_nZ2dnUU7-UnNnZ2d@earthlink.com>
<tbpfr4$2off$2@gal.iecc.com>
User-Agent: slrn/1.0.3 (Linux)
Lines: 22
Message-ID: <9mYDK.543533$70j.452979@fx16.iad>
X-Complaints-To: https://www.astraweb.com/aup
NNTP-Posting-Date: Tue, 26 Jul 2022 20:43:49 UTC
Date: Tue, 26 Jul 2022 20:43:49 GMT
X-Received-Bytes: 1453
 by: Charlie Gibbs - Tue, 26 Jul 2022 20:43 UTC

On 2022-07-26, John Levine <johnl@taugh.com> wrote:

> According to 25B.Z959 <25B.Z959@nada.net>:
>
>> Even my ASM ... every line has a comment, an ongoing
>> narrative of what's happening and why. Based on that
>> you could translate it into a dozen higher-level
>> languages.
>
> i += 2; // Add 1 to i.

Well, it might have done so in the original version -
which is why keeping comments up to date is vital.

(And yes, comments that trivial are a waste of time.
But that's another topic.)

--
/~\ Charlie Gibbs | Microsoft is a dictatorship.
\ / <cgibbs@kltpzyxm.invalid> | Apple is a cult.
X I'm really at ac.dekanfrus | Linux is anarchy.
/ \ if you read it the right way. | Pick your poison.

Re: COBOL and tricks

<1717161568.680560094.444476.peter_flass-yahoo.com@news.eternal-september.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9619&group=comp.os.linux.misc#9619

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!rocksolid2!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: peter_flass@yahoo.com (Peter Flass)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Tue, 26 Jul 2022 13:49:42 -0700
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <1717161568.680560094.444476.peter_flass-yahoo.com@news.eternal-september.org>
References: <87sfn8pr5t.fsf@usenet.ankman.de>
<UN6dnUE56LtnLE3_nZ2dnUU7-fXNnZ2d@earthlink.com>
<87zghai2dh.fsf@usenet.ankman.de>
<16ydncnktcv0sE__nZ2dnUU7-Q3NnZ2d@earthlink.com>
<tauc3e$3cjkn$1@dont-email.me>
<BbKdnS4bVeX7G07_nZ2dnUU7-RXNnZ2d@earthlink.com>
<L0XAK.382240$ssF.266663@fx14.iad>
<tb1iih$3pthf$2@dont-email.me>
<cL_AK.547297$X_i.178414@fx18.iad>
<JJadnSUvZb3dlUv_nZ2dnUU7-fXNnZ2d@earthlink.com>
<1034215367.679945065.348792.peter_flass-yahoo.com@news.eternal-september.org>
<tb6u29$15u9k$2@dont-email.me>
<2074045549.679949818.212355.peter_flass-yahoo.com@news.eternal-september.org>
<tb71r6$14eug$1@dont-email.me>
<2aadnYfne4Fc9Er_nZ2dnUU7-WnNnZ2d@earthlink.com>
<tb7qih$14eug$2@dont-email.me>
<gKydnS1iKPAP1EH_nZ2dnUU7-L3NnZ2d@earthlink.com>
<1993356671.680307216.022066.peter_flass-yahoo.com@news.eternal-september.org>
<tblva2$105$1@news.misty.com>
<tbn9oq$1h6ku$2@dont-email.me>
<tbo9oj$rej$1@news.misty.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: reader01.eternal-september.org; posting-host="e36ea150d27cad99fda797fbb2de6b68";
logging-data="2314063"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+pbaXswsyZSk8VYjSF9+/c"
User-Agent: NewsTap/5.3.1 (iPad)
Cancel-Lock: sha1:lrQe690yG85mnO7yseZzd8Tc0Ys=
sha1:kiyjM9WQc1uWhB7qptUaOVo+RmU=
 by: Peter Flass - Tue, 26 Jul 2022 20:49 UTC

Johnny Billquist <bqt@softjar.se> wrote:
> On 2022-07-26 01:42, Dan Espen wrote:
>> Johnny Billquist <bqt@softjar.se> writes:
>>
>>> On 2022-07-24 00:23, Peter Flass wrote:
>>>> 25B.Z959 <25B.Z959@nada.net> wrote:
>>>>> Sometimes that IS a factor ... you have to have people who
>>>>> can write it. But 1990 ... IMHO it should have been 'C'.
>>>>>
>>>>
>>>> IMNSHO, COBOL. C is a terrible language for those types of
>>> language. Things
>>>> that are so dimple in COBOL, like moving a character string with blank
>>>> fill, or formatting numeric output, requires calling subroutines in
>>> C, and
>>>> lack of length checking on string moves is a recipe for disaster.
>>> This is one of the weirder arguments I've ever seen:
>>> "requires calling a subroutine in C". As if that somehow is a problem?
>>> Not to mention it's a function, and not a subroutine. Any claim of
>>> "used the language quite a bit" sounds hollow after that.
>>>
>>> A statement to move a character string in COBOL will in the end be a
>>> subroutine call as well.
>>
>> And why do you think that?
>>
>> I've sure seen lots of COBOL MOVE instructions generate a single
>> hardware instruction.
>
> Depends on the compiler and hardware, and so on...
> Which actually leads to the point that the same is true in C.
> You might think you are calling a function like strncpy(). And you are,
> on an abstract level. However, modern C compilers understands what this
> is, and will in fact insert the required code directly in the
> instruction stream, which, again depending on the hardware, might end up
> being a single instruction.
>
> So in which way was COBOL better than C? In the end, claiming
> superiority of a language based on that one have a function, while the
> other have it as a statement is about as silly an argument as I have
> ever seen. And all the extra claims to support that view are even sillier.
>

Better for what? C is, or at least used to be, excellent at generating very
tight code with little overhead. From what I’ve seen, I believe the
overhead has crept back in. COBOL is excellent for programs that might not
need to be the fastest, but are expected to be running for DECADES and
maintained by a lot of different people of wildly different skill levels.

If I were writing an OS, I’s choose C over COBOL (actually, I’d choose PL/I
but that’s another argument). If I were writing a payroll system, COBOL
might be a better choice.

--
Pete

Re: COBOL and tricks

<301741343.680560460.621264.peter_flass-yahoo.com@news.eternal-september.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9620&group=comp.os.linux.misc#9620

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: peter_flass@yahoo.com (Peter Flass)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Tue, 26 Jul 2022 13:49:43 -0700
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <301741343.680560460.621264.peter_flass-yahoo.com@news.eternal-september.org>
References: <UN6dnUE56LtnLE3_nZ2dnUU7-fXNnZ2d@earthlink.com>
<87zghai2dh.fsf@usenet.ankman.de>
<16ydncnktcv0sE__nZ2dnUU7-Q3NnZ2d@earthlink.com>
<tauc3e$3cjkn$1@dont-email.me>
<BbKdnS4bVeX7G07_nZ2dnUU7-RXNnZ2d@earthlink.com>
<L0XAK.382240$ssF.266663@fx14.iad>
<tb1iih$3pthf$2@dont-email.me>
<cL_AK.547297$X_i.178414@fx18.iad>
<JJadnSUvZb3dlUv_nZ2dnUU7-fXNnZ2d@earthlink.com>
<1034215367.679945065.348792.peter_flass-yahoo.com@news.eternal-september.org>
<tb6u29$15u9k$2@dont-email.me>
<2074045549.679949818.212355.peter_flass-yahoo.com@news.eternal-september.org>
<tb71r6$14eug$1@dont-email.me>
<2aadnYfne4Fc9Er_nZ2dnUU7-WnNnZ2d@earthlink.com>
<tb7qih$14eug$2@dont-email.me>
<gKydnS1iKPAP1EH_nZ2dnUU7-L3NnZ2d@earthlink.com>
<1993356671.680307216.022066.peter_flass-yahoo.com@news.eternal-september.org>
<tblva2$105$1@news.misty.com>
<tbn9oq$1h6ku$2@dont-email.me>
<tbo9oj$rej$1@news.misty.com>
<tbok3d$1udf5$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: reader01.eternal-september.org; posting-host="e36ea150d27cad99fda797fbb2de6b68";
logging-data="2314063"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19J01oUq1TEPJNIVaeUGeod"
User-Agent: NewsTap/5.3.1 (iPad)
Cancel-Lock: sha1:Z8P4g76/qT5rVcVavthztt27pFw=
sha1:aXTGFA8uysu4tMAKW8ZyBxGQB9k=
 by: Peter Flass - Tue, 26 Jul 2022 20:49 UTC

Dan Espen <dan1espen@gmail.com> wrote:
> Johnny Billquist <bqt@softjar.se> writes:
>
>> On 2022-07-26 01:42, Dan Espen wrote:
>>> Johnny Billquist <bqt@softjar.se> writes:
>>>
>>>> On 2022-07-24 00:23, Peter Flass wrote:
>>>>> 25B.Z959 <25B.Z959@nada.net> wrote:
>>>>>> Sometimes that IS a factor ... you have to have people who
>>>>>> can write it. But 1990 ... IMHO it should have been 'C'.
>>>>>>
>>>>>
>>>>> IMNSHO, COBOL. C is a terrible language for those types of
>>>> language. Things
>>>>> that are so dimple in COBOL, like moving a character string with blank
>>>>> fill, or formatting numeric output, requires calling subroutines in
>>>> C, and
>>>>> lack of length checking on string moves is a recipe for disaster.
>>>> This is one of the weirder arguments I've ever seen:
>>>> "requires calling a subroutine in C". As if that somehow is a problem?
>>>> Not to mention it's a function, and not a subroutine. Any claim of
>>>> "used the language quite a bit" sounds hollow after that.
>>>>
>>>> A statement to move a character string in COBOL will in the end be a
>>>> subroutine call as well.
>>> And why do you think that?
>>> I've sure seen lots of COBOL MOVE instructions generate a single
>>> hardware instruction.
>>
>> Depends on the compiler and hardware, and so on...
>> Which actually leads to the point that the same is true in C.
>> You might think you are calling a function like strncpy(). And you
>> are, on an abstract level. However, modern C compilers understands
>> what this is, and will in fact insert the required code directly in
>> the instruction stream, which, again depending on the hardware, might
>> end up being a single instruction.
>>
>> So in which way was COBOL better than C? In the end, claiming
>> superiority of a language based on that one have a function, while the
>> other have it as a statement is about as silly an argument as I have
>> ever seen. And all the extra claims to support that view are even
>> sillier.
>
> This is all true, an IBM mainframe C compiler CAN generate a single
> instruction for a memcpy or strncpy. Providing the compiler can tell
> the length of the move at compile time. Something that is a lot more
> likely for COBOL than C.
>
> For IBM mainframes the COBOL compiler is going to be way more efficient
> than C because the COBOL compiler is way more likely to be using packed
> decimal.
>
>

XLC has functions for handling packed decimal. I don’t know about current
mainframe C.

--
Pete

Re: COBOL and tricks

<1157861234.680560589.016327.peter_flass-yahoo.com@news.eternal-september.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9621&group=comp.os.linux.misc#9621

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: peter_flass@yahoo.com (Peter Flass)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Tue, 26 Jul 2022 13:49:44 -0700
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <1157861234.680560589.016327.peter_flass-yahoo.com@news.eternal-september.org>
References: <16ydncnktcv0sE__nZ2dnUU7-Q3NnZ2d@earthlink.com>
<tauc3e$3cjkn$1@dont-email.me>
<BbKdnS4bVeX7G07_nZ2dnUU7-RXNnZ2d@earthlink.com>
<L0XAK.382240$ssF.266663@fx14.iad>
<tb1iih$3pthf$2@dont-email.me>
<cL_AK.547297$X_i.178414@fx18.iad>
<JJadnSUvZb3dlUv_nZ2dnUU7-fXNnZ2d@earthlink.com>
<1034215367.679945065.348792.peter_flass-yahoo.com@news.eternal-september.org>
<tb6u29$15u9k$2@dont-email.me>
<2074045549.679949818.212355.peter_flass-yahoo.com@news.eternal-september.org>
<tb71r6$14eug$1@dont-email.me>
<2aadnYfne4Fc9Er_nZ2dnUU7-WnNnZ2d@earthlink.com>
<tb7qih$14eug$2@dont-email.me>
<gKydnS1iKPAP1EH_nZ2dnUU7-L3NnZ2d@earthlink.com>
<1993356671.680307216.022066.peter_flass-yahoo.com@news.eternal-september.org>
<tblva2$105$1@news.misty.com>
<tbn9oq$1h6ku$2@dont-email.me>
<tbo9oj$rej$1@news.misty.com>
<tbocqu$1silh$1@dont-email.me>
<87pmhsow2z.fsf@LkoBDZeT.terraraq.uk>
<20220726151015.7f8dc972fa92debff0ecfaa2@eircom.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: reader01.eternal-september.org; posting-host="e36ea150d27cad99fda797fbb2de6b68";
logging-data="2314063"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/GVYYlAhUE4W9UqRwpajSB"
User-Agent: NewsTap/5.3.1 (iPad)
Cancel-Lock: sha1:nLfXn/FHlN7skGjRdIlDqtPLspk=
sha1:le3jsfascL0En4FxPZUimBrdNz0=
 by: Peter Flass - Tue, 26 Jul 2022 20:49 UTC

Ahem A Rivet's Shot <steveo@eircom.net> wrote:
> On Tue, 26 Jul 2022 14:13:56 +0100
> Richard Kettlewell <invalid@invalid.invalid> wrote:
>
>> The Natural Philosopher <tnp@invalid.invalid> writes:
>>> C is the exact opposite, terse, machine level assembler but faster
>>> coded.
>>
>> “Assembler” is a terrible mental model for C.
>>
>> richard@sfere:~/junk$ cat t.c
>> int f(int *ptr) {
>> int r = *ptr;
>
> If ptr is 0 this is undefined behaviour aka probably SEGV.

The programmer makes assumptions based on what he/she knows. Presumably the
original author might “know” that ptr will never be zero (previously
tested, data would not allow it, etc.) This is why maintenance is such a
minefield. I have been bitten by my own code when I changed it years after
originally written.

Actually, I wouldn’t WANT the compiler to test for zero here. If you want
it, do it yourself.

--
Pete

Re: COBOL and tricks

<1496961531.680561040.564565.peter_flass-yahoo.com@news.eternal-september.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9622&group=comp.os.linux.misc#9622

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: peter_flass@yahoo.com (Peter Flass)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Tue, 26 Jul 2022 13:49:44 -0700
Organization: A noiseless patient Spider
Lines: 71
Message-ID: <1496961531.680561040.564565.peter_flass-yahoo.com@news.eternal-september.org>
References: <L0XAK.382240$ssF.266663@fx14.iad>
<tb1iih$3pthf$2@dont-email.me>
<cL_AK.547297$X_i.178414@fx18.iad>
<JJadnSUvZb3dlUv_nZ2dnUU7-fXNnZ2d@earthlink.com>
<1034215367.679945065.348792.peter_flass-yahoo.com@news.eternal-september.org>
<tb6u29$15u9k$2@dont-email.me>
<2074045549.679949818.212355.peter_flass-yahoo.com@news.eternal-september.org>
<tb71r6$14eug$1@dont-email.me>
<2aadnYfne4Fc9Er_nZ2dnUU7-WnNnZ2d@earthlink.com>
<tb7qih$14eug$2@dont-email.me>
<gKydnS1iKPAP1EH_nZ2dnUU7-L3NnZ2d@earthlink.com>
<1993356671.680307216.022066.peter_flass-yahoo.com@news.eternal-september.org>
<tblva2$105$1@news.misty.com>
<tbn9oq$1h6ku$2@dont-email.me>
<tbo9oj$rej$1@news.misty.com>
<tbocqu$1silh$1@dont-email.me>
<87pmhsow2z.fsf@LkoBDZeT.terraraq.uk>
<20220726151015.7f8dc972fa92debff0ecfaa2@eircom.net>
<87edy8ori7.fsf@LkoBDZeT.terraraq.uk>
<tbp0n6$21no4$1@dont-email.me>
<tbp2cv$224ma$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: reader01.eternal-september.org; posting-host="e36ea150d27cad99fda797fbb2de6b68";
logging-data="2314063"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1//2QawZlCBjcYLP1ypAvBx"
User-Agent: NewsTap/5.3.1 (iPad)
Cancel-Lock: sha1:m4oQCkhHmfg+V6TpMm39A5rv09g=
sha1:tr6eGWBK/jPoU+HlZBzoxPRPrUE=
 by: Peter Flass - Tue, 26 Jul 2022 20:49 UTC

Pancho <Pancho.Jones@proton.me> wrote:
> On 26/07/2022 16:20, The Natural Philosopher wrote:
>> On 26/07/2022 15:52, Richard Kettlewell wrote:
>>> Ahem A Rivet's Shot <steveo@eircom.net> writes:
>>>> Richard Kettlewell <invalid@invalid.invalid> wrote:
>>>>> The Natural Philosopher <tnp@invalid.invalid> writes:
>>>>>> C is the exact opposite, terse, machine level assembler but faster
>>>>>> coded.
>>>>>
>>>>> “Assembler” is a terrible mental model for C.
>>>>>
>>>>>      richard@sfere:~/junk$ cat t.c
>>>>>      int f(int *ptr) {
>>>>>        int r = *ptr;
>>>>
>>>>     If ptr is 0 this is undefined behaviour aka probably SEGV.
>>>
>>> Please see the remarks you snipped. If *ptr faults then the likely
>>> outcome is a crash; but in some environments that does not happen.
>>>
>>>>>        if(!ptr)
>>>>
>>>>     Did you mean !*ptr ?
>>>
>>> No, I did not.
>>>
>>>>>          return 0;
>>>>>        return r;
>>>>
>>>>     Or is it counting on ptr not really being followed until here ?
>>>
>>> No, the code is buggy (the indirection and the test are the wrong way
>>> around). But it’s a bug that happened in real life and the outcome is
>>> not someone working with the ‘portable assembler’ mental model of C
>>> would expect.
>>
>> Once you introduce a bug and have a buggy compiler, that's exactly what
>> you do expect.
>>
>> Carrying a mental model in assembler, what that code is , is to lead the
>> contents of a reference which may be null, then test if the reference is
>> actually null, and pass that reference contents or null back.
>> At assembly level that is pure nonsense. There is no point in testing a
>> pointer for null if you have already referenced it.
>>
>> The fact that you have been able to reference it without a segfault
>> shows it is probably not null.
>
> I think the point was that some OS (or is it CPU architecture) allows
> you to read from the NULL memory address. I've no idea which one, but
> presumably one does.
>
> If the read from the NULL address throws a fault, then the C and
> assembler will be equivalent.
>
>> So the first point is that the actual code is crap. Written by someone
>> who didn't know what they were doing.
>> The second point is that the compiler is certainly behaving in a
>> questionable manner too.
>
> C says the operation is undefined. I don't use C. Just thinking about it
> makes me feel queezy.
>

In a lot of cases, the contents of low memory, including address 0, are
readable. In MVS (etc.) low memory is the Prefixed Storage Area (PSA) which
is a useful control block. Some, or all?, Unices don’t map page zero, so
you get a SIGSEGV trying to access it, but this isn’t universally true.

--
Pete

Re: COBOL and tricks

<tbpk6g$26fje$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9623&group=comp.os.linux.misc#9623

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: vir.campestris@invalid.invalid (Vir Campestris)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Tue, 26 Jul 2022 21:52:32 +0100
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <tbpk6g$26fje$1@dont-email.me>
References: <ouSdnQ4MiuXqxFf_nZ2dnUU7-L3NnZ2d@earthlink.com>
<UN6dnUE56LtnLE3_nZ2dnUU7-fXNnZ2d@earthlink.com>
<87zghai2dh.fsf@usenet.ankman.de>
<16ydncnktcv0sE__nZ2dnUU7-Q3NnZ2d@earthlink.com>
<tauc3e$3cjkn$1@dont-email.me>
<BbKdnS4bVeX7G07_nZ2dnUU7-RXNnZ2d@earthlink.com>
<L0XAK.382240$ssF.266663@fx14.iad> <tb1iih$3pthf$2@dont-email.me>
<cL_AK.547297$X_i.178414@fx18.iad>
<JJadnSUvZb3dlUv_nZ2dnUU7-fXNnZ2d@earthlink.com>
<1034215367.679945065.348792.peter_flass-yahoo.com@news.eternal-september.org>
<tb6u29$15u9k$2@dont-email.me>
<2074045549.679949818.212355.peter_flass-yahoo.com@news.eternal-september.org>
<tb71r6$14eug$1@dont-email.me>
<2aadnYfne4Fc9Er_nZ2dnUU7-WnNnZ2d@earthlink.com>
<tb7qih$14eug$2@dont-email.me>
<gKydnS1iKPAP1EH_nZ2dnUU7-L3NnZ2d@earthlink.com>
<1993356671.680307216.022066.peter_flass-yahoo.com@news.eternal-september.org>
<HpKdnfYAbfikikP_nZ2dnUU7-cvNnZ2d@earthlink.com>
<574555364.680474584.174865.peter_flass-yahoo.com@news.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 26 Jul 2022 20:52:32 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="ae409517ea73f456372f7b28e1304f9a";
logging-data="2309742"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/iw1Ij600gWegsK4secTyFiNwn9/rizIc="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:It88UHLiHryksgslMsaPtJ3PdaE=
Content-Language: en-GB
In-Reply-To: <574555364.680474584.174865.peter_flass-yahoo.com@news.eternal-september.org>
 by: Vir Campestris - Tue, 26 Jul 2022 20:52 UTC

On 25/07/2022 21:55, Peter Flass wrote:
> No, COBOL is for the NEXT poor bastard who has to look at your code and
> try to figure out what the heck you were trying to do. The more “concise” a
> language is, the more write-only it tends to be.

Ah, you've seen APL then?

Andy

Re: COBOL and tricks

<tbpk8g$26fje$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9624&group=comp.os.linux.misc#9624

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: vir.campestris@invalid.invalid (Vir Campestris)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Tue, 26 Jul 2022 21:53:36 +0100
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <tbpk8g$26fje$2@dont-email.me>
References: <ouSdnQ4MiuXqxFf_nZ2dnUU7-L3NnZ2d@earthlink.com>
<HpKdnfYAbfikikP_nZ2dnUU7-cvNnZ2d@earthlink.com>
<574555364.680474584.174865.peter_flass-yahoo.com@news.eternal-september.org>
<5bOdndBzuNkG5kL_nZ2dnUU7-UnNnZ2d@earthlink.com> <tbpfr4$2off$2@gal.iecc.com>
<9mYDK.543533$70j.452979@fx16.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 26 Jul 2022 20:53:36 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="ae409517ea73f456372f7b28e1304f9a";
logging-data="2309742"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/0ZPq2/jpLC8mZCgfPymWLB4L+2UwiBpc="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:kutItg7AhngZpeX9fP5rE4LA1Jw=
In-Reply-To: <9mYDK.543533$70j.452979@fx16.iad>
Content-Language: en-GB
 by: Vir Campestris - Tue, 26 Jul 2022 20:53 UTC

On 26/07/2022 21:43, Charlie Gibbs wrote:
> On 2022-07-26, John Levine <johnl@taugh.com> wrote:
>
>> According to 25B.Z959 <25B.Z959@nada.net>:
>>
>>> Even my ASM ... every line has a comment, an ongoing
>>> narrative of what's happening and why. Based on that
>>> you could translate it into a dozen higher-level
>>> languages.
>>
>> i += 2; // Add 1 to i.
>
> Well, it might have done so in the original version -
> which is why keeping comments up to date is vital.
>
> (And yes, comments that trivial are a waste of time.
> But that's another topic.)
>
The useful comments don't say _what_ you're doing, they say _why_.

Andy

Re: COBOL and tricks

<2028996710.680561665.014893.peter_flass-yahoo.com@news.eternal-september.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9625&group=comp.os.linux.misc#9625

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: peter_flass@yahoo.com (Peter Flass)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Tue, 26 Jul 2022 13:57:01 -0700
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <2028996710.680561665.014893.peter_flass-yahoo.com@news.eternal-september.org>
References: <ouSdnQ4MiuXqxFf_nZ2dnUU7-L3NnZ2d@earthlink.com>
<HpKdnfYAbfikikP_nZ2dnUU7-cvNnZ2d@earthlink.com>
<574555364.680474584.174865.peter_flass-yahoo.com@news.eternal-september.org>
<5bOdndBzuNkG5kL_nZ2dnUU7-UnNnZ2d@earthlink.com>
<tbpfr4$2off$2@gal.iecc.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: reader01.eternal-september.org; posting-host="a320065e885b43b2ef054c8484b7143a";
logging-data="2317596"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/UTsnaReDinjRyRhM/wH04"
User-Agent: NewsTap/5.3.1 (iPad)
Cancel-Lock: sha1:W4K3SJ0lsq8UZOMD8YVvknfsSfE=
sha1:7zm57yxzMFPXgyVqgnOlx07SBs4=
 by: Peter Flass - Tue, 26 Jul 2022 20:57 UTC

John Levine <johnl@taugh.com> wrote:
> According to 25B.Z959 <25B.Z959@nada.net>:
>> Even my ASM ... every line has a comment, an ongoing
>> narrative of what's happening and why. Based on that
>> you could translate it into a dozen higher-level
>> languages.
>
> i += 2; // Add 1 to i.
>

For some values of one ;-)

--
Pete

Re: COBOL and tricks

<1454874257.680561741.605156.peter_flass-yahoo.com@news.eternal-september.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9626&group=comp.os.linux.misc#9626

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: peter_flass@yahoo.com (Peter Flass)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Tue, 26 Jul 2022 13:57:02 -0700
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <1454874257.680561741.605156.peter_flass-yahoo.com@news.eternal-september.org>
References: <16ydncnktcv0sE__nZ2dnUU7-Q3NnZ2d@earthlink.com>
<tauc3e$3cjkn$1@dont-email.me>
<BbKdnS4bVeX7G07_nZ2dnUU7-RXNnZ2d@earthlink.com>
<L0XAK.382240$ssF.266663@fx14.iad>
<tb1iih$3pthf$2@dont-email.me>
<cL_AK.547297$X_i.178414@fx18.iad>
<JJadnSUvZb3dlUv_nZ2dnUU7-fXNnZ2d@earthlink.com>
<1034215367.679945065.348792.peter_flass-yahoo.com@news.eternal-september.org>
<tb6u29$15u9k$2@dont-email.me>
<2074045549.679949818.212355.peter_flass-yahoo.com@news.eternal-september.org>
<tb71r6$14eug$1@dont-email.me>
<2aadnYfne4Fc9Er_nZ2dnUU7-WnNnZ2d@earthlink.com>
<tb7qih$14eug$2@dont-email.me>
<gKydnS1iKPAP1EH_nZ2dnUU7-L3NnZ2d@earthlink.com>
<1993356671.680307216.022066.peter_flass-yahoo.com@news.eternal-september.org>
<HpKdnfYAbfikikP_nZ2dnUU7-cvNnZ2d@earthlink.com>
<574555364.680474584.174865.peter_flass-yahoo.com@news.eternal-september.org>
<5bOdndBzuNkG5kL_nZ2dnUU7-UnNnZ2d@earthlink.com>
<8mYDK.543531$70j.517354@fx16.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: reader01.eternal-september.org; posting-host="a320065e885b43b2ef054c8484b7143a";
logging-data="2317596"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+X9Ga5rgkj1bF1ej6hQI2Y"
User-Agent: NewsTap/5.3.1 (iPad)
Cancel-Lock: sha1:d3PpVNVd0mtwoz5XdqhP1+ZiAS0=
sha1:9lD8mnoCf1rn9iJ9O4EQWLHB9r8=
 by: Peter Flass - Tue, 26 Jul 2022 20:57 UTC

Charlie Gibbs <cgibbs@kltpzyxm.invalid> wrote:
> On 2022-07-26, 25B.Z959 <25B.Z959@nada.net> wrote:
>
>> On 7/25/22 4:55 PM, Peter Flass wrote:
>>
>>> 25B.Z959 <25B.Z959@nada.net> wrote:
>>>
>>>> So ... COBOL is for BAD PROGRAMMERS who can't foresee
>>>> downstream consequences hmmm ??? ;-)
>>>
>>> No, COBOL is for the NEXT poor bastard who has to look at your code and
>>> try to figure out what the heck you were trying to do. The more “concise”
>>> a language is, the more write-only it tends to be.
>>
>> THAT'S why 60-75% of my programs are expository COMMENTS
>> and little TUTORIALS. YOU can EXPLAIN the code a LOT
>> better than any code can explain itself.
>>
>> Even my ASM ... every line has a comment, an ongoing
>> narrative of what's happening and why. Based on that
>> you could translate it into a dozen higher-level
>> languages.
>
> I started doing exactly that in assembly language, and still do it in C.
>
>> And then I see "examples" with 200 lines of 'C' or
>> whatever with like THREE cryptic comments. The rest
>> is apparently all Magic ....
>
> "My code is so readable it doesn't need comments."
>

I comment most lines, and include the text of the spec I’m working from as
a block comment where appropriate.

--
Pete

Re: COBOL and tricks

<tbpkie$26fje$3@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9627&group=comp.os.linux.misc#9627

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: vir.campestris@invalid.invalid (Vir Campestris)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Tue, 26 Jul 2022 21:58:53 +0100
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <tbpkie$26fje$3@dont-email.me>
References: <871quvs7m8.fsf@usenet.ankman.de>
<gKydnS1iKPAP1EH_nZ2dnUU7-L3NnZ2d@earthlink.com>
<1993356671.680307216.022066.peter_flass-yahoo.com@news.eternal-september.org>
<tblva2$105$1@news.misty.com> <tbn9oq$1h6ku$2@dont-email.me>
<tbo9oj$rej$1@news.misty.com> <tbocqu$1silh$1@dont-email.me>
<87pmhsow2z.fsf@LkoBDZeT.terraraq.uk>
<20220726151015.7f8dc972fa92debff0ecfaa2@eircom.net>
<87edy8ori7.fsf@LkoBDZeT.terraraq.uk> <tbp0n6$21no4$1@dont-email.me>
<tbp2cv$224ma$1@dont-email.me> <rsUDK.104202$Me2.65661@fx47.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 26 Jul 2022 20:58:54 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="ae409517ea73f456372f7b28e1304f9a";
logging-data="2309742"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/zrTQNB3b9m0mO1Ah7vi28tsTlYpdCXmM="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:fbgX09H7C2JkPVPthMI1uhDB7DU=
Content-Language: en-GB
In-Reply-To: <rsUDK.104202$Me2.65661@fx47.iad>
 by: Vir Campestris - Tue, 26 Jul 2022 20:58 UTC

On 26/07/2022 17:17, Scott Lurndal wrote:
> Pancho <Pancho.Jones@proton.me> writes:
>> On 26/07/2022 16:20, The Natural Philosopher wrote:
>>> On 26/07/2022 15:52, Richard Kettlewell wrote:
>
>>> The fact that you have been able to reference it without a segfault
>>> shows it is probably not null.
>>
>> I think the point was that some OS (or is it CPU architecture) allows
>> you to read from the NULL memory address. I've no idea which one, but
>> presumably one does.
>
> The legacy BSD operating systems marked page zero of the virtual address
> space as READ-ONLY and initialized the entire page with zeros. Trying
> to store through a NULL pointer would fault, but loads would return zero.
>
> Took a fair amount of work to fix BSD utilities to work on System V due
> to this.
>
> For microcontrollers etc that don't have virtual memory, address zero
> was always legal.
>
> In early processors, there were often registers located in the first
> page of memory (e.g. the autoincrement memory locations in the PDP-8).

The first system I learned assembler on was a DECSystem10. That had the
registers mapped into the first 16 memory addresses, so an access via a
null pointer would have given the the contents of the first register.

OTOH its memory was all 36 bit words, with magic to access strings. I
don't think C would have worked at all well.

Andy

Re: COBOL and tricks

<20220726222023.d94b8dddad1d9bf35e7c6a3b@eircom.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9628&group=comp.os.linux.misc#9628

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: steveo@eircom.net (Ahem A Rivet's Shot)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Tue, 26 Jul 2022 22:20:23 +0100
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <20220726222023.d94b8dddad1d9bf35e7c6a3b@eircom.net>
References: <16ydncnktcv0sE__nZ2dnUU7-Q3NnZ2d@earthlink.com>
<L0XAK.382240$ssF.266663@fx14.iad>
<tb1iih$3pthf$2@dont-email.me>
<cL_AK.547297$X_i.178414@fx18.iad>
<JJadnSUvZb3dlUv_nZ2dnUU7-fXNnZ2d@earthlink.com>
<1034215367.679945065.348792.peter_flass-yahoo.com@news.eternal-september.org>
<tb6u29$15u9k$2@dont-email.me>
<2074045549.679949818.212355.peter_flass-yahoo.com@news.eternal-september.org>
<tb71r6$14eug$1@dont-email.me>
<2aadnYfne4Fc9Er_nZ2dnUU7-WnNnZ2d@earthlink.com>
<tb7qih$14eug$2@dont-email.me>
<gKydnS1iKPAP1EH_nZ2dnUU7-L3NnZ2d@earthlink.com>
<1993356671.680307216.022066.peter_flass-yahoo.com@news.eternal-september.org>
<tblva2$105$1@news.misty.com>
<tbn9oq$1h6ku$2@dont-email.me>
<tbo9oj$rej$1@news.misty.com>
<tbocqu$1silh$1@dont-email.me>
<87pmhsow2z.fsf@LkoBDZeT.terraraq.uk>
<20220726151015.7f8dc972fa92debff0ecfaa2@eircom.net>
<1157861234.680560589.016327.peter_flass-yahoo.com@news.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: reader01.eternal-september.org; posting-host="537f5bee203455a3a56e8c385956a462";
logging-data="2333114"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19VxijPQc/mSHyJ8yCQHdRyJnulrYJ7k/c="
Cancel-Lock: sha1:C3T3nxWmoguYC3UN1Fmmd4eEDNM=
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.0)
X-Clacks-Overhead: "GNU Terry Pratchett"
 by: Ahem A Rivet's - Tue, 26 Jul 2022 21:20 UTC

On Tue, 26 Jul 2022 13:49:44 -0700
Peter Flass <peter_flass@yahoo.com> wrote:

> Ahem A Rivet's Shot <steveo@eircom.net> wrote:
> > On Tue, 26 Jul 2022 14:13:56 +0100
> > Richard Kettlewell <invalid@invalid.invalid> wrote:
> >
> >> The Natural Philosopher <tnp@invalid.invalid> writes:
> >>> C is the exact opposite, terse, machine level assembler but faster
> >>> coded.
> >>
> >> “Assembler” is a terrible mental model for C.
> >>
> >> richard@sfere:~/junk$ cat t.c
> >> int f(int *ptr) {
> >> int r = *ptr;
> >
> > If ptr is 0 this is undefined behaviour aka probably SEGV.
>
> The programmer makes assumptions based on what he/she knows. Presumably
> the original author might “know” that ptr will never be zero (previously

Programmer tests ptr for 0 in the next statement. Buggy code!

--
Steve O'Hara-Smith
Odds and Ends at http://www.sohara.org/

Re: COBOL and tricks

<20220726222648.bd05b68c16b046eb091b4e5c@eircom.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9629&group=comp.os.linux.misc#9629

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: steveo@eircom.net (Ahem A Rivet's Shot)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Tue, 26 Jul 2022 22:26:48 +0100
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <20220726222648.bd05b68c16b046eb091b4e5c@eircom.net>
References: <ouSdnQ4MiuXqxFf_nZ2dnUU7-L3NnZ2d@earthlink.com>
<87zghai2dh.fsf@usenet.ankman.de>
<16ydncnktcv0sE__nZ2dnUU7-Q3NnZ2d@earthlink.com>
<tauc3e$3cjkn$1@dont-email.me>
<BbKdnS4bVeX7G07_nZ2dnUU7-RXNnZ2d@earthlink.com>
<L0XAK.382240$ssF.266663@fx14.iad>
<tb1iih$3pthf$2@dont-email.me>
<cL_AK.547297$X_i.178414@fx18.iad>
<JJadnSUvZb3dlUv_nZ2dnUU7-fXNnZ2d@earthlink.com>
<1034215367.679945065.348792.peter_flass-yahoo.com@news.eternal-september.org>
<tb6u29$15u9k$2@dont-email.me>
<2074045549.679949818.212355.peter_flass-yahoo.com@news.eternal-september.org>
<tb71r6$14eug$1@dont-email.me>
<2aadnYfne4Fc9Er_nZ2dnUU7-WnNnZ2d@earthlink.com>
<tb7qih$14eug$2@dont-email.me>
<gKydnS1iKPAP1EH_nZ2dnUU7-L3NnZ2d@earthlink.com>
<1993356671.680307216.022066.peter_flass-yahoo.com@news.eternal-september.org>
<HpKdnfYAbfikikP_nZ2dnUU7-cvNnZ2d@earthlink.com>
<574555364.680474584.174865.peter_flass-yahoo.com@news.eternal-september.org>
<tbpk6g$26fje$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: reader01.eternal-september.org; posting-host="537f5bee203455a3a56e8c385956a462";
logging-data="2333114"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/N+aQSYXlb+Via8RR8j7oBabMMo+MIK1o="
Cancel-Lock: sha1:glg7+bwj/L47ibyWVc3kHM+NpJg=
X-Clacks-Overhead: "GNU Terry Pratchett"
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.0)
 by: Ahem A Rivet's - Tue, 26 Jul 2022 21:26 UTC

On Tue, 26 Jul 2022 21:52:32 +0100
Vir Campestris <vir.campestris@invalid.invalid> wrote:

> On 25/07/2022 21:55, Peter Flass wrote:
> > No, COBOL is for the NEXT poor bastard who has to look at your code and
> > try to figure out what the heck you were trying to do. The more
> > “concise” a language is, the more write-only it tends to be.
>
> Ah, you've seen APL then?

The most unreadable language yet has to be whitespace:

https://en.wikipedia.org/wiki/Whitespace_(programming_language)

--
Steve O'Hara-Smith
Odds and Ends at http://www.sohara.org/

Re: COBOL and tricks

<20220726222135.d85078c52e7c4e064bdbdf69@eircom.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9630&group=comp.os.linux.misc#9630

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.freedyn.de!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: steveo@eircom.net (Ahem A Rivet's Shot)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Tue, 26 Jul 2022 22:21:35 +0100
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <20220726222135.d85078c52e7c4e064bdbdf69@eircom.net>
References: <ouSdnQ4MiuXqxFf_nZ2dnUU7-L3NnZ2d@earthlink.com>
<HpKdnfYAbfikikP_nZ2dnUU7-cvNnZ2d@earthlink.com>
<574555364.680474584.174865.peter_flass-yahoo.com@news.eternal-september.org>
<5bOdndBzuNkG5kL_nZ2dnUU7-UnNnZ2d@earthlink.com>
<tbpfr4$2off$2@gal.iecc.com>
<9mYDK.543533$70j.452979@fx16.iad>
<tbpk8g$26fje$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="537f5bee203455a3a56e8c385956a462";
logging-data="2333114"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Vz3T7+RCVGDrcW0VAD6Sp4prlDhvZ5bM="
Cancel-Lock: sha1:sTOfPC8gOJxch7xZ6Wl2CjftEIU=
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.0)
X-Clacks-Overhead: "GNU Terry Pratchett"
 by: Ahem A Rivet's - Tue, 26 Jul 2022 21:21 UTC

On Tue, 26 Jul 2022 21:53:36 +0100
Vir Campestris <vir.campestris@invalid.invalid> wrote:

> The useful comments don't say _what_ you're doing, they say _why_.

This!

--
Steve O'Hara-Smith
Odds and Ends at http://www.sohara.org/

Re: COBOL and tricks

<20220726221907.037a75ab526ce8f5f3f248c2@eircom.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9631&group=comp.os.linux.misc#9631

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: steveo@eircom.net (Ahem A Rivet's Shot)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Tue, 26 Jul 2022 22:19:07 +0100
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <20220726221907.037a75ab526ce8f5f3f248c2@eircom.net>
References: <871quvs7m8.fsf@usenet.ankman.de>
<gKydnS1iKPAP1EH_nZ2dnUU7-L3NnZ2d@earthlink.com>
<1993356671.680307216.022066.peter_flass-yahoo.com@news.eternal-september.org>
<tblva2$105$1@news.misty.com>
<tbn9oq$1h6ku$2@dont-email.me>
<tbo9oj$rej$1@news.misty.com>
<tbocqu$1silh$1@dont-email.me>
<87pmhsow2z.fsf@LkoBDZeT.terraraq.uk>
<20220726151015.7f8dc972fa92debff0ecfaa2@eircom.net>
<87edy8ori7.fsf@LkoBDZeT.terraraq.uk>
<tbp0n6$21no4$1@dont-email.me>
<tbp2cv$224ma$1@dont-email.me>
<rsUDK.104202$Me2.65661@fx47.iad>
<tbpkie$26fje$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="537f5bee203455a3a56e8c385956a462";
logging-data="2333114"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+VXNgFSEKI+H9H5QtDHlprsgyQ+BEmy8c="
Cancel-Lock: sha1:Xa70hhIQrPHsBq993mkdiS/Yxdc=
X-Clacks-Overhead: "GNU Terry Pratchett"
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.0)
 by: Ahem A Rivet's - Tue, 26 Jul 2022 21:19 UTC

On Tue, 26 Jul 2022 21:58:53 +0100
Vir Campestris <vir.campestris@invalid.invalid> wrote:

> The first system I learned assembler on was a DECSystem10. That had the
> registers mapped into the first 16 memory addresses, so an access via a
> null pointer would have given the the contents of the first register.
>
> OTOH its memory was all 36 bit words, with magic to access strings. I
> don't think C would have worked at all well.

You might be surprised - it seems gcc was got working on it a
couple of decades ago.

http://pdp10.nocrew.org/gcc/

--
Steve O'Hara-Smith
Odds and Ends at http://www.sohara.org/

Re: COBOL and tricks

<tbq037$29e35$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9632&group=comp.os.linux.misc#9632

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dan1espen@gmail.com (Dan Espen)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Tue, 26 Jul 2022 20:15:33 -0400
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <tbq037$29e35$1@dont-email.me>
References: <871quvs7m8.fsf@usenet.ankman.de>
<16ydncnktcv0sE__nZ2dnUU7-Q3NnZ2d@earthlink.com>
<tauc3e$3cjkn$1@dont-email.me>
<BbKdnS4bVeX7G07_nZ2dnUU7-RXNnZ2d@earthlink.com>
<L0XAK.382240$ssF.266663@fx14.iad> <tb1iih$3pthf$2@dont-email.me>
<cL_AK.547297$X_i.178414@fx18.iad>
<JJadnSUvZb3dlUv_nZ2dnUU7-fXNnZ2d@earthlink.com>
<1034215367.679945065.348792.peter_flass-yahoo.com@news.eternal-september.org>
<tb6u29$15u9k$2@dont-email.me>
<2074045549.679949818.212355.peter_flass-yahoo.com@news.eternal-september.org>
<tb71r6$14eug$1@dont-email.me>
<2aadnYfne4Fc9Er_nZ2dnUU7-WnNnZ2d@earthlink.com>
<tb7qih$14eug$2@dont-email.me>
<gKydnS1iKPAP1EH_nZ2dnUU7-L3NnZ2d@earthlink.com>
<1993356671.680307216.022066.peter_flass-yahoo.com@news.eternal-september.org>
<tblva2$105$1@news.misty.com> <tbn9oq$1h6ku$2@dont-email.me>
<tbo9oj$rej$1@news.misty.com> <tbok3d$1udf5$1@dont-email.me>
<8mYDK.543532$70j.52459@fx16.iad>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="0a61fa83997e9e06e6a0cf9c33af4553";
logging-data="2406501"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/CaQ4sH6JzZcugCgXvP1KXHVz+CythgMo="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:rlH3qpcdxlk27R734TwWKNcxjfQ=
 by: Dan Espen - Wed, 27 Jul 2022 00:15 UTC

Charlie Gibbs <cgibbs@kltpzyxm.invalid> writes:

> On 2022-07-26, Dan Espen <dan1espen@gmail.com> wrote:
>
>> For IBM mainframes the COBOL compiler is going to be way more efficient
>> than C because the COBOL compiler is way more likely to be using packed
>> decimal.
>
> As long as you're referring to data fields, that's true.
> But I once knocked 30% off a program's execution time by
> simply changing all subscripts from COMP-3 (packed decimal)
> to COMP-4 (binary). (The original author obviously had
> no real-world experience.)

Now the right solution is

USAGE IS INDEX

Of course you don't use packed decimal for indexes. USAGE DISPLAY is no
good either. But early on most of us knew to use COMP before usage
index was invented.

--
Dan Espen

Re: COBOL and tricks

<tbq0lu$29e35$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9633&group=comp.os.linux.misc#9633

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dan1espen@gmail.com (Dan Espen)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Tue, 26 Jul 2022 20:25:32 -0400
Organization: A noiseless patient Spider
Lines: 63
Message-ID: <tbq0lu$29e35$2@dont-email.me>
References: <UN6dnUE56LtnLE3_nZ2dnUU7-fXNnZ2d@earthlink.com>
<16ydncnktcv0sE__nZ2dnUU7-Q3NnZ2d@earthlink.com>
<tauc3e$3cjkn$1@dont-email.me>
<BbKdnS4bVeX7G07_nZ2dnUU7-RXNnZ2d@earthlink.com>
<L0XAK.382240$ssF.266663@fx14.iad> <tb1iih$3pthf$2@dont-email.me>
<cL_AK.547297$X_i.178414@fx18.iad>
<JJadnSUvZb3dlUv_nZ2dnUU7-fXNnZ2d@earthlink.com>
<1034215367.679945065.348792.peter_flass-yahoo.com@news.eternal-september.org>
<tb6u29$15u9k$2@dont-email.me>
<2074045549.679949818.212355.peter_flass-yahoo.com@news.eternal-september.org>
<tb71r6$14eug$1@dont-email.me>
<2aadnYfne4Fc9Er_nZ2dnUU7-WnNnZ2d@earthlink.com>
<tb7qih$14eug$2@dont-email.me>
<gKydnS1iKPAP1EH_nZ2dnUU7-L3NnZ2d@earthlink.com>
<1993356671.680307216.022066.peter_flass-yahoo.com@news.eternal-september.org>
<tblva2$105$1@news.misty.com> <tbn9oq$1h6ku$2@dont-email.me>
<tbo9oj$rej$1@news.misty.com> <tbok3d$1udf5$1@dont-email.me>
<301741343.680560460.621264.peter_flass-yahoo.com@news.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: reader01.eternal-september.org; posting-host="0a61fa83997e9e06e6a0cf9c33af4553";
logging-data="2406501"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Z7+F6cEiOWI1giN8QmN7BqhWnDqmxEdo="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:mglzZoNzeP+INEYrvh4q7yRTZRQ=
 by: Dan Espen - Wed, 27 Jul 2022 00:25 UTC

Peter Flass <peter_flass@yahoo.com> writes:

> Dan Espen <dan1espen@gmail.com> wrote:
>> Johnny Billquist <bqt@softjar.se> writes:
>>
>>> On 2022-07-26 01:42, Dan Espen wrote:
>>>> Johnny Billquist <bqt@softjar.se> writes:
>>>>
>>>>> On 2022-07-24 00:23, Peter Flass wrote:
>>>>>> 25B.Z959 <25B.Z959@nada.net> wrote:
>>>>>>> Sometimes that IS a factor ... you have to have people who
>>>>>>> can write it. But 1990 ... IMHO it should have been 'C'.
>>>>>>>
>>>>>>
>>>>>> IMNSHO, COBOL. C is a terrible language for those types of
>>>>> language. Things
>>>>>> that are so dimple in COBOL, like moving a character string with blank
>>>>>> fill, or formatting numeric output, requires calling subroutines in
>>>>> C, and
>>>>>> lack of length checking on string moves is a recipe for disaster.
>>>>> This is one of the weirder arguments I've ever seen:
>>>>> "requires calling a subroutine in C". As if that somehow is a problem?
>>>>> Not to mention it's a function, and not a subroutine. Any claim of
>>>>> "used the language quite a bit" sounds hollow after that.
>>>>>
>>>>> A statement to move a character string in COBOL will in the end be a
>>>>> subroutine call as well.
>>>> And why do you think that?
>>>> I've sure seen lots of COBOL MOVE instructions generate a single
>>>> hardware instruction.
>>>
>>> Depends on the compiler and hardware, and so on...
>>> Which actually leads to the point that the same is true in C.
>>> You might think you are calling a function like strncpy(). And you
>>> are, on an abstract level. However, modern C compilers understands
>>> what this is, and will in fact insert the required code directly in
>>> the instruction stream, which, again depending on the hardware, might
>>> end up being a single instruction.
>>>
>>> So in which way was COBOL better than C? In the end, claiming
>>> superiority of a language based on that one have a function, while the
>>> other have it as a statement is about as silly an argument as I have
>>> ever seen. And all the extra claims to support that view are even
>>> sillier.
>>
>> This is all true, an IBM mainframe C compiler CAN generate a single
>> instruction for a memcpy or strncpy. Providing the compiler can tell
>> the length of the move at compile time. Something that is a lot more
>> likely for COBOL than C.
>>
>> For IBM mainframes the COBOL compiler is going to be way more efficient
>> than C because the COBOL compiler is way more likely to be using packed
>> decimal.
>
> XLC has functions for handling packed decimal. I don’t know about current
> mainframe C.

Back when I was working the situation was that C had one way of doing
it, C++ had another. Neither was a clean solution in my opinion.

--
Dan Espen

Re: COBOL and tricks

<8OqdnRDKdfFSPn3_nZ2dnUU7-f_NnZ2d@earthlink.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9634&group=comp.os.linux.misc#9634

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!border-1.nntp.ord.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 26 Jul 2022 21:32:46 -0500
Subject: Re: COBOL and tricks
Newsgroups: alt.folklore.computers,comp.os.linux.misc
References: <ouSdnQ4MiuXqxFf_nZ2dnUU7-L3NnZ2d@earthlink.com>
<HpKdnfYAbfikikP_nZ2dnUU7-cvNnZ2d@earthlink.com>
<574555364.680474584.174865.peter_flass-yahoo.com@news.eternal-september.org>
<5bOdndBzuNkG5kL_nZ2dnUU7-UnNnZ2d@earthlink.com> <tbpfr4$2off$2@gal.iecc.com>
From: 25B.Z959@nada.net (25B.Z959)
Date: Tue, 26 Jul 2022 22:32:45 -0400
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
MIME-Version: 1.0
In-Reply-To: <tbpfr4$2off$2@gal.iecc.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Message-ID: <8OqdnRDKdfFSPn3_nZ2dnUU7-f_NnZ2d@earthlink.com>
Lines: 31
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.165.113
X-Trace: sv3-tZUTp/7m2QYGlNA0gXLkcFa2mYpD6FoFnGkh7zCUXMIQtBxwCRvbBy4ZALrgEGqEKC5Ire5xIWtXpJR!4ynLqaeILVGU1fd0VdSJszGRvsCY3PVAAveld4nIoUv7CtbVXVQkO8ujqMDmz24WpTwWUDkg0PwB!xckavig1lbA4S+BSn/gv
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2489
X-Received-Bytes: 2642
 by: 25B.Z959 - Wed, 27 Jul 2022 02:32 UTC

On 7/26/22 3:38 PM, John Levine wrote:
> According to 25B.Z959 <25B.Z959@nada.net>:
>> Even my ASM ... every line has a comment, an ongoing
>> narrative of what's happening and why. Based on that
>> you could translate it into a dozen higher-level
>> languages.
>
> i += 2; // Add 1 to i.

Um ... that'd add TWO to i .......

i++ ; add 1 to i ... ++i++ might add two, depending
on the compiler.

(Intel 8051 ... assume 'i' is ushort value at address 0x0100)

MOV 0x0100,a ... copy contents of address 0x100 to accumulator
INC a ... increment accumulator by one
MOV a, 0x0100 ... copy accumulator to address 0x0100

- OR JUST -

INC 0x0100 ... increment byte value found at 0x0100,
... kinda actually does the above three lines,
... but leaves accumulator as-is.

Gets more complicated incrementing an integer var, gotta
ADD so the overflow flag comes into play. INC does not
affect the overflow flag, it just rolls-over to 0x00 if
you inc an 0xFF

Re: COBOL and tricks

<4e6dnbM2AIdWO33_nZ2dnUU7-cXNnZ2d@earthlink.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9635&group=comp.os.linux.misc#9635

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 26 Jul 2022 21:45:31 -0500
Subject: Re: COBOL and tricks
Newsgroups: alt.folklore.computers,comp.os.linux.misc
References: <ouSdnQ4MiuXqxFf_nZ2dnUU7-L3NnZ2d@earthlink.com>
<HpKdnfYAbfikikP_nZ2dnUU7-cvNnZ2d@earthlink.com>
<574555364.680474584.174865.peter_flass-yahoo.com@news.eternal-september.org>
<5bOdndBzuNkG5kL_nZ2dnUU7-UnNnZ2d@earthlink.com> <tbpfr4$2off$2@gal.iecc.com>
<9mYDK.543533$70j.452979@fx16.iad> <tbpk8g$26fje$2@dont-email.me>
From: 25B.Z959@nada.net (25B.Z959)
Date: Tue, 26 Jul 2022 22:45:30 -0400
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
MIME-Version: 1.0
In-Reply-To: <tbpk8g$26fje$2@dont-email.me>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Message-ID: <4e6dnbM2AIdWO33_nZ2dnUU7-cXNnZ2d@earthlink.com>
Lines: 33
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.165.113
X-Trace: sv3-e6OChzZ7NAUC/Wx9bYSQsFcW8xkuExOtuP2acBYvFtljN4g27ClFRof172pkzkmD1XhafitqskezVlr!uHosuFnJJDxFjE3zRx1kc1vV50q8JfDEPBZaGGyoB6/XQ5Jqfo4ir1heFWXIv69uF96/YCNTq/Q9!6qP2ZuVpT6fkuoCOtn/v
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2832
 by: 25B.Z959 - Wed, 27 Jul 2022 02:45 UTC

On 7/26/22 4:53 PM, Vir Campestris wrote:
> On 26/07/2022 21:43, Charlie Gibbs wrote:
>> On 2022-07-26, John Levine <johnl@taugh.com> wrote:
>>
>>> According to 25B.Z959 <25B.Z959@nada.net>:
>>>
>>>>    Even my ASM ... every line has a comment, an ongoing
>>>>    narrative of what's happening and why. Based on that
>>>>    you could translate it into a dozen higher-level
>>>>    languages.
>>>
>>>     i += 2;    // Add 1 to i.
>>
>> Well, it might have done so in the original version -
>> which is why keeping comments up to date is vital.
>>
>> (And yes, comments that trivial are a waste of time.
>> But that's another topic.)
>>
> The useful comments don't say _what_ you're doing, they say _why_.

'Zactly ... it needs to be a 'narrative' - both WHAT and WHY.
Doesn't matter if it's ASM or COBOL or FORTRAN or Python. If
you or anybody would EVER need to go back and tweak the pgm
it really NEEDS serious commenting. Alas it's kinda RARE to
see this ..... the old "Well *I* know what it's all about NOW"
attitude. Wait a couple years until the boss decides your form
needs some new data fields or entry box #7 moved 10 spaces to
the right 'cause it would 'look nicer' .... :-)

Think of the actual code as 'shorthand' for the story you're
writing whether it's Shakespeare, or "See Spot run !" ....

Re: COBOL and tricks

<XNKdne9AffQPNH3_nZ2dnUU7-cvNnZ2d@earthlink.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9636&group=comp.os.linux.misc#9636

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!border-1.nntp.ord.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 26 Jul 2022 21:57:22 -0500
Subject: Re: COBOL and tricks
Newsgroups: alt.folklore.computers,comp.os.linux.misc
References: <ouSdnQ4MiuXqxFf_nZ2dnUU7-L3NnZ2d@earthlink.com>
<16ydncnktcv0sE__nZ2dnUU7-Q3NnZ2d@earthlink.com>
<tauc3e$3cjkn$1@dont-email.me>
<BbKdnS4bVeX7G07_nZ2dnUU7-RXNnZ2d@earthlink.com>
<L0XAK.382240$ssF.266663@fx14.iad> <tb1iih$3pthf$2@dont-email.me>
<cL_AK.547297$X_i.178414@fx18.iad>
<JJadnSUvZb3dlUv_nZ2dnUU7-fXNnZ2d@earthlink.com>
<1034215367.679945065.348792.peter_flass-yahoo.com@news.eternal-september.org>
<tb6u29$15u9k$2@dont-email.me>
<2074045549.679949818.212355.peter_flass-yahoo.com@news.eternal-september.org>
<tb71r6$14eug$1@dont-email.me>
<2aadnYfne4Fc9Er_nZ2dnUU7-WnNnZ2d@earthlink.com>
<tb7qih$14eug$2@dont-email.me>
<gKydnS1iKPAP1EH_nZ2dnUU7-L3NnZ2d@earthlink.com>
<1993356671.680307216.022066.peter_flass-yahoo.com@news.eternal-september.org>
<HpKdnfYAbfikikP_nZ2dnUU7-cvNnZ2d@earthlink.com>
<574555364.680474584.174865.peter_flass-yahoo.com@news.eternal-september.org>
<5bOdndBzuNkG5kL_nZ2dnUU7-UnNnZ2d@earthlink.com>
<8mYDK.543531$70j.517354@fx16.iad>
From: 25B.Z959@nada.net (25B.Z959)
Date: Tue, 26 Jul 2022 22:57:21 -0400
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
MIME-Version: 1.0
In-Reply-To: <8mYDK.543531$70j.517354@fx16.iad>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Message-ID: <XNKdne9AffQPNH3_nZ2dnUU7-cvNnZ2d@earthlink.com>
Lines: 36
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.165.113
X-Trace: sv3-p1ETIoprrzL+2T0pPKVUfzbF4JBWPTvNKSBCITGH1CQYnv4lUIYOiQfnSbPKlt0qyLKzMFAfGMDIpyd!F277IEa2MC8W3PQpIdTQqsr/bx/xensRsEM+Lb2E/5aZ9C60wrd054GTSBlc3GPkm5RarW1p4EKC!+hJlTZfV4LHjDc4BGi6B
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 3585
X-Received-Bytes: 3707
 by: 25B.Z959 - Wed, 27 Jul 2022 02:57 UTC

On 7/26/22 4:43 PM, Charlie Gibbs wrote:
> On 2022-07-26, 25B.Z959 <25B.Z959@nada.net> wrote:
>
>> On 7/25/22 4:55 PM, Peter Flass wrote:
>>
>>> 25B.Z959 <25B.Z959@nada.net> wrote:
>>>
>>>> So ... COBOL is for BAD PROGRAMMERS who can't foresee
>>>> downstream consequences hmmm ??? ;-)
>>>
>>> No, COBOL is for the NEXT poor bastard who has to look at your code and
>>> try to figure out what the heck you were trying to do. The more “concise”
>>> a language is, the more write-only it tends to be.
>>
>> THAT'S why 60-75% of my programs are expository COMMENTS
>> and little TUTORIALS. YOU can EXPLAIN the code a LOT
>> better than any code can explain itself.
>>
>> Even my ASM ... every line has a comment, an ongoing
>> narrative of what's happening and why. Based on that
>> you could translate it into a dozen higher-level
>> languages.
>
> I started doing exactly that in assembly language, and still do it in C.
>
>> And then I see "examples" with 200 lines of 'C' or
>> whatever with like THREE cryptic comments. The rest
>> is apparently all Magic ....
>
> "My code is so readable it doesn't need comments."

There's an old joke about a college prof (and a friend
of mine had one JUST like it) where the prof slams down
five lines of ultra-dense next-level math on the blackboard
then kinda half turns to the class and says "So, obviously ..."

Re: Fwd: Linux on a small memory PC

<HKudnS3s5e5QM33_nZ2dnUU7-KvNnZ2d@earthlink.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9637&group=comp.os.linux.misc#9637

  copy link   Newsgroups: comp.os.linux.misc alt.folklore.computers
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 26 Jul 2022 22:19:41 -0500
Subject: Re: Fwd: Linux on a small memory PC
Newsgroups: comp.os.linux.misc,alt.folklore.computers
References: <871quvs7m8.fsf@usenet.ankman.de>
<ouSdnQ4MiuXqxFf_nZ2dnUU7-L3NnZ2d@earthlink.com>
<87sfn8pr5t.fsf@usenet.ankman.de>
<UN6dnUE56LtnLE3_nZ2dnUU7-fXNnZ2d@earthlink.com>
<87zghai2dh.fsf@usenet.ankman.de>
<16ydncnktcv0sE__nZ2dnUU7-Q3NnZ2d@earthlink.com>
<tauc3e$3cjkn$1@dont-email.me>
<BbKdnS4bVeX7G07_nZ2dnUU7-RXNnZ2d@earthlink.com>
<L0XAK.382240$ssF.266663@fx14.iad> <tb1iih$3pthf$2@dont-email.me>
<cL_AK.547297$X_i.178414@fx18.iad>
<JJadnSUvZb3dlUv_nZ2dnUU7-fXNnZ2d@earthlink.com>
<o21hdhprvqv8fl2ni8sapba4ln95q2dahq@4ax.com>
From: 25B.Z959@nada.net (25B.Z959)
Date: Tue, 26 Jul 2022 23:19:40 -0400
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
MIME-Version: 1.0
In-Reply-To: <o21hdhprvqv8fl2ni8sapba4ln95q2dahq@4ax.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Message-ID: <HKudnS3s5e5QM33_nZ2dnUU7-KvNnZ2d@earthlink.com>
Lines: 68
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.165.113
X-Trace: sv3-1M4mTyJq7HZbw0uqsbzfK2PQkw42Bz57aF6U9wIG6gLQI4xqYmpnlvlgJvHyo5czJaFJh4BTzyqWDWB!MCIXPQjr+086IBfg+9owMvE/pNSTorB2mevF45smQoEQMW9GYRlm89tDRDzrbBjqNjgv1ovqn/oc!EGuQQG5c+nLaFb81oweB
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 4631
 by: 25B.Z959 - Wed, 27 Jul 2022 03:19 UTC

On 7/20/22 6:41 PM, J. Clarke wrote:
> On Mon, 18 Jul 2022 21:26:23 -0400, "25B.Z959" <25B.Z959@nada.net>
> wrote:
>
>> On 7/17/22 4:59 PM, Charlie Gibbs wrote:
>>> [Cross-posted to alt.folklore.computers]
>>>
>>> On 2022-07-17, Dan Espen <dan1espen@gmail.com> wrote:
>>>
>>>> Charlie Gibbs <cgibbs@kltpzyxm.invalid> writes:
>>>>
>>>>> On 2022-07-17, 25B.Z959 <25B.Z959@nada.net> wrote:
>>>>>
>>>>>> On 7/16/22 8:48 AM, Dan Espen wrote:
>>>>>>
>>>>>>> "25B.Z959" <25B.Z959@nada.net> writes:
>>>>>>>
>>>>>>>> Fortunately, few are so cheap to be using 2-digit dates
>>>>>>>> anymore. Not so in the past - they just assumed 19xx. Saved a
>>>>>>>> little space, easier calx.
>>>>>>>
>>>>>>> There you go, true to form. Now people use 2 digit dates because
>>>>>>> they are cheap.
>>>>>>
>>>>>> You are neglecting Computers Past ..... low speed, low
>>>>>> capacity. You simplified calx, you squeezed-down the data anywhere
>>>>>> you could. I know, I had to do it.
>>>>>
>>>>> Me too. My first job was in an all-card shop. To squeeze things onto
>>>>> an 80-column card, we stored dates in 5 columns as ddmmy. That's
>>>>> right, we only kept the last digit of the year. I started there in
>>>>> 1970, and one of my first assignments was to go through all report
>>>>> programs and change the '6' they inserted in front of the year to '7'.
>>>>
>>>> In an all card shop having more than 1 card for a logical record is a
>>>> problem. Not insurmountable but difficult. I've heard the one digit
>>>> year story in that context but never had to deal with it.
>>>
>>> We used two cards for customer name data, but they didn't have dates
>>> in them, just long names. You're right, having more than one card
>>> for a logical record is a pain in the ass. I use the present tense
>>> because I'm still faced with such files today.
>>
>>
>> Yep - the past IS present ... old records never die, they
>> just become more inconvenient. :-)
>>
>> Amazing how many institutions STILL run COBOL apps writ
>> during the 60s by the guys with skinny ties. They work
>> very well, they're too expensive to re-do, so ....
>>
>> There's probably a COBOL->C++ or JAVA translator out
>> there somewhere ... but money's so tight these days
>> and so many of those legacy apps are so super-critical
>> that they just can't/won't.
>
> And now some poor schmuck in India has to deal with it all.

You can hear them leafing through their manuals as they
ask irrelevant questions ......

I once was looking through one of those sites that list
unsecured webcams (and you'd be amazed how many). One
of them was a tech-support main room in Bangalore. At
(N.American) night you'd see them all lined up at their
PCs ... but N.American DAY ... they all had a little
mat and slept packed-in on the floor. Really.

Re: COBOL and tricks

<tbr4fl$2g6gm$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9638&group=comp.os.linux.misc#9638

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: tnp@invalid.invalid (The Natural Philosopher)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Wed, 27 Jul 2022 11:36:37 +0100
Organization: A little, after lunch
Lines: 18
Message-ID: <tbr4fl$2g6gm$1@dont-email.me>
References: <871quvs7m8.fsf@usenet.ankman.de>
<16ydncnktcv0sE__nZ2dnUU7-Q3NnZ2d@earthlink.com>
<tauc3e$3cjkn$1@dont-email.me>
<BbKdnS4bVeX7G07_nZ2dnUU7-RXNnZ2d@earthlink.com>
<L0XAK.382240$ssF.266663@fx14.iad> <tb1iih$3pthf$2@dont-email.me>
<cL_AK.547297$X_i.178414@fx18.iad>
<JJadnSUvZb3dlUv_nZ2dnUU7-fXNnZ2d@earthlink.com>
<1034215367.679945065.348792.peter_flass-yahoo.com@news.eternal-september.org>
<tb6u29$15u9k$2@dont-email.me>
<2074045549.679949818.212355.peter_flass-yahoo.com@news.eternal-september.org>
<tb71r6$14eug$1@dont-email.me>
<2aadnYfne4Fc9Er_nZ2dnUU7-WnNnZ2d@earthlink.com>
<tb7qih$14eug$2@dont-email.me>
<gKydnS1iKPAP1EH_nZ2dnUU7-L3NnZ2d@earthlink.com>
<1993356671.680307216.022066.peter_flass-yahoo.com@news.eternal-september.org>
<tblva2$105$1@news.misty.com> <tbn9oq$1h6ku$2@dont-email.me>
<tbo9oj$rej$1@news.misty.com> <tbocqu$1silh$1@dont-email.me>
<87pmhsow2z.fsf@LkoBDZeT.terraraq.uk> <tbp097$21k72$1@dont-email.me>
<tbp677$lv1$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 27 Jul 2022 10:36:37 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="4ffb97d083fdf6cd35e8c376bf948503";
logging-data="2628118"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/yCTlpmW0ozDCRqJG7ykTzUxJobArBfAA="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:eQt0G8QxeSwVcDzC7Qnqo+oqf6o=
In-Reply-To: <tbp677$lv1$1@gioia.aioe.org>
Content-Language: en-GB
 by: The Natural Philosop - Wed, 27 Jul 2022 10:36 UTC

On 26/07/2022 17:53, Andy Walker wrote:
> Whether a compiler "should" assume that is a matter of opinion.
> But the compiler is /entitled/ to assume that, because if it is null then
> the behaviour on dereferencing was undefined,

Why is that? memory address of 0 is a valid memory address. At least in
hardware terms.
Does the C language enforce that memory at (page) address 0 is
unaddressable?

--
You can get much farther with a kind word and a gun than you can with a
kind word alone.

Al Capone

Re: COBOL and tricks

<tbr4l7$2g6gm$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9639&group=comp.os.linux.misc#9639

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: tnp@invalid.invalid (The Natural Philosopher)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Wed, 27 Jul 2022 11:39:35 +0100
Organization: A little, after lunch
Lines: 41
Message-ID: <tbr4l7$2g6gm$2@dont-email.me>
References: <ouSdnQ4MiuXqxFf_nZ2dnUU7-L3NnZ2d@earthlink.com>
<16ydncnktcv0sE__nZ2dnUU7-Q3NnZ2d@earthlink.com>
<tauc3e$3cjkn$1@dont-email.me>
<BbKdnS4bVeX7G07_nZ2dnUU7-RXNnZ2d@earthlink.com>
<L0XAK.382240$ssF.266663@fx14.iad> <tb1iih$3pthf$2@dont-email.me>
<cL_AK.547297$X_i.178414@fx18.iad>
<JJadnSUvZb3dlUv_nZ2dnUU7-fXNnZ2d@earthlink.com>
<1034215367.679945065.348792.peter_flass-yahoo.com@news.eternal-september.org>
<tb6u29$15u9k$2@dont-email.me>
<2074045549.679949818.212355.peter_flass-yahoo.com@news.eternal-september.org>
<tb71r6$14eug$1@dont-email.me>
<2aadnYfne4Fc9Er_nZ2dnUU7-WnNnZ2d@earthlink.com>
<tb7qih$14eug$2@dont-email.me>
<gKydnS1iKPAP1EH_nZ2dnUU7-L3NnZ2d@earthlink.com>
<1993356671.680307216.022066.peter_flass-yahoo.com@news.eternal-september.org>
<HpKdnfYAbfikikP_nZ2dnUU7-cvNnZ2d@earthlink.com>
<574555364.680474584.174865.peter_flass-yahoo.com@news.eternal-september.org>
<5bOdndBzuNkG5kL_nZ2dnUU7-UnNnZ2d@earthlink.com>
<8mYDK.543531$70j.517354@fx16.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 27 Jul 2022 10:39:35 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="4ffb97d083fdf6cd35e8c376bf948503";
logging-data="2628118"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/milB4+sRt6z8ADsxUQrPQnAeBDPQ8iwc="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:zuWr2lVbEfYVPk29Rf/Q6q/HPaI=
Content-Language: en-GB
In-Reply-To: <8mYDK.543531$70j.517354@fx16.iad>
 by: The Natural Philosop - Wed, 27 Jul 2022 10:39 UTC

On 26/07/2022 21:43, Charlie Gibbs wrote:
> On 2022-07-26, 25B.Z959 <25B.Z959@nada.net> wrote:
>
>> On 7/25/22 4:55 PM, Peter Flass wrote:
>>
>>> 25B.Z959 <25B.Z959@nada.net> wrote:
>>>
>>>> So ... COBOL is for BAD PROGRAMMERS who can't foresee
>>>> downstream consequences hmmm ??? ;-)
>>>
>>> No, COBOL is for the NEXT poor bastard who has to look at your code and
>>> try to figure out what the heck you were trying to do. The more “concise”
>>> a language is, the more write-only it tends to be.
>>
>> THAT'S why 60-75% of my programs are expository COMMENTS
>> and little TUTORIALS. YOU can EXPLAIN the code a LOT
>> better than any code can explain itself.
>>
>> Even my ASM ... every line has a comment, an ongoing
>> narrative of what's happening and why. Based on that
>> you could translate it into a dozen higher-level
>> languages.
>
> I started doing exactly that in assembly language, and still do it in C.
>
>> And then I see "examples" with 200 lines of 'C' or
>> whatever with like THREE cryptic comments. The rest
>> is apparently all Magic ....
>
> "My code is so readable it doesn't need comments."
>
I am in between. Typically I will head a block of code with an
explanation of what it is supposed to do.

I wont bother much in between unless that code looks cryptic to me, and
I try to make it not so. Bearing in mind that compiler optimisation
means you needn't code for speed at source level, but for clarity.

--
Microsoft : the best reason to go to Linux that ever existed.

Re: COBOL and tricks

<20220727122854.a33d600de3a32339f5162e73@eircom.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9640&group=comp.os.linux.misc#9640

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: steveo@eircom.net (Ahem A Rivet's Shot)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Wed, 27 Jul 2022 12:28:54 +0100
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <20220727122854.a33d600de3a32339f5162e73@eircom.net>
References: <871quvs7m8.fsf@usenet.ankman.de>
<tauc3e$3cjkn$1@dont-email.me>
<BbKdnS4bVeX7G07_nZ2dnUU7-RXNnZ2d@earthlink.com>
<L0XAK.382240$ssF.266663@fx14.iad>
<tb1iih$3pthf$2@dont-email.me>
<cL_AK.547297$X_i.178414@fx18.iad>
<JJadnSUvZb3dlUv_nZ2dnUU7-fXNnZ2d@earthlink.com>
<1034215367.679945065.348792.peter_flass-yahoo.com@news.eternal-september.org>
<tb6u29$15u9k$2@dont-email.me>
<2074045549.679949818.212355.peter_flass-yahoo.com@news.eternal-september.org>
<tb71r6$14eug$1@dont-email.me>
<2aadnYfne4Fc9Er_nZ2dnUU7-WnNnZ2d@earthlink.com>
<tb7qih$14eug$2@dont-email.me>
<gKydnS1iKPAP1EH_nZ2dnUU7-L3NnZ2d@earthlink.com>
<1993356671.680307216.022066.peter_flass-yahoo.com@news.eternal-september.org>
<tblva2$105$1@news.misty.com>
<tbn9oq$1h6ku$2@dont-email.me>
<tbo9oj$rej$1@news.misty.com>
<tbocqu$1silh$1@dont-email.me>
<87pmhsow2z.fsf@LkoBDZeT.terraraq.uk>
<tbp097$21k72$1@dont-email.me>
<tbp677$lv1$1@gioia.aioe.org>
<tbr4fl$2g6gm$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: reader01.eternal-september.org; posting-host="1bcfeabb7aef395021c0124232059fde";
logging-data="2637715"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19MjQ5laDYxfixIYln9NVyDhe+ImrL9yEs="
Cancel-Lock: sha1:RQ6trQWV9c4k+JHnT/elYRFnwEQ=
X-Clacks-Overhead: "GNU Terry Pratchett"
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.0)
 by: Ahem A Rivet's - Wed, 27 Jul 2022 11:28 UTC

On Wed, 27 Jul 2022 11:36:37 +0100
The Natural Philosopher <tnp@invalid.invalid> wrote:

> On 26/07/2022 17:53, Andy Walker wrote:
> > Whether a compiler "should" assume that is a matter of opinion.
> > But the compiler is /entitled/ to assume that, because if it is null
> > then the behaviour on dereferencing was undefined,
>
> Why is that? memory address of 0 is a valid memory address. At least in
> hardware terms.

However it usually isn't an accessible one in a protected memory
environment.

> Does the C language enforce that memory at (page) address 0 is
> unaddressable?

No, it simply states that the behaviour of a program is undefined
(by the C standard) once it attempts to access memory that hasn't been
allocated by one of the documented mechanisms in the C standard. What
happens depends on the platform and the compiler.

If you're writing code for a platform where you know what that
behaviour will be and it is the behaviour you want then C will not get in
your way (your compiler might but it should be persuadable) - but you are
warned that the code may behave differently on a different platform.

Note that the C standard does technically allow the compiler or the
compiled program to execute the author but as far as I know this option has
never been implemented - let me know if you find otherwise.

--
Steve O'Hara-Smith
Odds and Ends at http://www.sohara.org/

Re: COBOL and tricks

<tbr9e9$tb4$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9641&group=comp.os.linux.misc#9641

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!aioe.org!NjtosaOI+U24HyIQwPnd5A.user.46.165.242.75.POSTED!not-for-mail
From: anw@cuboid.co.uk (Andy Walker)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Wed, 27 Jul 2022 13:01:13 +0100
Organization: Not very much
Message-ID: <tbr9e9$tb4$1@gioia.aioe.org>
References: <871quvs7m8.fsf@usenet.ankman.de> <tauc3e$3cjkn$1@dont-email.me>
<BbKdnS4bVeX7G07_nZ2dnUU7-RXNnZ2d@earthlink.com>
<L0XAK.382240$ssF.266663@fx14.iad> <tb1iih$3pthf$2@dont-email.me>
<cL_AK.547297$X_i.178414@fx18.iad>
<JJadnSUvZb3dlUv_nZ2dnUU7-fXNnZ2d@earthlink.com>
<1034215367.679945065.348792.peter_flass-yahoo.com@news.eternal-september.org>
<tb6u29$15u9k$2@dont-email.me>
<2074045549.679949818.212355.peter_flass-yahoo.com@news.eternal-september.org>
<tb71r6$14eug$1@dont-email.me>
<2aadnYfne4Fc9Er_nZ2dnUU7-WnNnZ2d@earthlink.com>
<tb7qih$14eug$2@dont-email.me>
<gKydnS1iKPAP1EH_nZ2dnUU7-L3NnZ2d@earthlink.com>
<1993356671.680307216.022066.peter_flass-yahoo.com@news.eternal-september.org>
<tblva2$105$1@news.misty.com> <tbn9oq$1h6ku$2@dont-email.me>
<tbo9oj$rej$1@news.misty.com> <tbocqu$1silh$1@dont-email.me>
<87pmhsow2z.fsf@LkoBDZeT.terraraq.uk> <tbp097$21k72$1@dont-email.me>
<tbp677$lv1$1@gioia.aioe.org> <tbr4fl$2g6gm$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="30052"; posting-host="NjtosaOI+U24HyIQwPnd5A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: Andy Walker - Wed, 27 Jul 2022 12:01 UTC

On 27/07/2022 11:36, The Natural Philosopher wrote:
[I wrote:]
>> But the compiler is /entitled/ to assume that, because if it is>> null then the behaviour on dereferencing was undefined,
> Why is that? memory address of 0 is a valid memory address. At least
> in hardware terms.

Whether or not that is true depends on your hardware and what
pages [on systems where that is meaningful] have been allocated. But,
rather ...

> Does the C language enforce that memory at (page) address 0 is unaddressable?

... C enforces that 0, as a pointer, is a null pointer and cannot
properly be dereferenced [it can be used for other purposes]. See the C
standard, eg N1570 [C11 -- other C standards are available, but they
haven't changed much in this area over the decades]:

6.3.2.3.3:
" An integer constant expression with the value 0, or such an expression
" cast to type void *, is called a null pointer constant. If a null
" pointer constant is converted to a pointer type, the resulting pointer,
" called a null pointer, is guaranteed to compare unequal to a pointer
" to any object or function. "

and 6.5.3.2.4:
" The unary * operator denotes indirection. ... If an invalid value has
" been assigned to the pointer, the behavior of the unary * operator is
" undefined.[footnote 102] "

where footnote 102 says:
" Among the invalid values for dereferencing a pointer by the unary *
" operator are a null pointer, an address inappropriately aligned for
" the type of object pointed to, and the address of an object after
" the end of its lifetime. "

Whether a null pointer actually "points to address 0" is up to compiler
magic to sort out. After all, the high-level language programmer is not
expected to know where in storage the objects used by the program reside.
Note that the result of dereferencing a null pointer is undefined, rather
than, for example, being defined to halt the program with an error; you
may get away with it, but it's still a bug, and therefore a disaster
waiting to happen.

--
Andy Walker, Nottingham.
Andy's music pages: www.cuboid.me.uk/andy/Music
Composer of the day: www.cuboid.me.uk/andy/Music/Composers/Kotzwara

Re: COBOL and tricks

<87tu72ofnw.fsf@LkoBDZeT.terraraq.uk>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=9642&group=comp.os.linux.misc#9642

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!news.niel.me!nntp.terraraq.uk!.POSTED.nntp.terraraq.uk!not-for-mail
From: invalid@invalid.invalid (Richard Kettlewell)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Wed, 27 Jul 2022 14:20:51 +0100
Organization: terraraq NNTP server
Message-ID: <87tu72ofnw.fsf@LkoBDZeT.terraraq.uk>
References: <871quvs7m8.fsf@usenet.ankman.de>
<L0XAK.382240$ssF.266663@fx14.iad> <tb1iih$3pthf$2@dont-email.me>
<cL_AK.547297$X_i.178414@fx18.iad>
<JJadnSUvZb3dlUv_nZ2dnUU7-fXNnZ2d@earthlink.com>
<1034215367.679945065.348792.peter_flass-yahoo.com@news.eternal-september.org>
<tb6u29$15u9k$2@dont-email.me>
<2074045549.679949818.212355.peter_flass-yahoo.com@news.eternal-september.org>
<tb71r6$14eug$1@dont-email.me>
<2aadnYfne4Fc9Er_nZ2dnUU7-WnNnZ2d@earthlink.com>
<tb7qih$14eug$2@dont-email.me>
<gKydnS1iKPAP1EH_nZ2dnUU7-L3NnZ2d@earthlink.com>
<1993356671.680307216.022066.peter_flass-yahoo.com@news.eternal-september.org>
<tblva2$105$1@news.misty.com> <tbn9oq$1h6ku$2@dont-email.me>
<tbo9oj$rej$1@news.misty.com> <tbocqu$1silh$1@dont-email.me>
<87pmhsow2z.fsf@LkoBDZeT.terraraq.uk> <tbp097$21k72$1@dont-email.me>
<tbp677$lv1$1@gioia.aioe.org> <tbr4fl$2g6gm$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: mantic.terraraq.uk; posting-host="nntp.terraraq.uk:2a00:1098:0:86:1000:3f:0:2";
logging-data="55483"; mail-complaints-to="usenet@mantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:aagT5fFKRNwocKCYcA1SDXjX8SU=
X-Face: h[Hh-7npe<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
+r0NzP?vnz:e/knOY)PI-
X-Boydie: NO
 by: Richard Kettlewell - Wed, 27 Jul 2022 13:20 UTC

The Natural Philosopher <tnp@invalid.invalid> writes:
> On 26/07/2022 17:53, Andy Walker wrote:
>> Whether a compiler "should" assume that is a matter of opinion.
>> But the compiler is /entitled/ to assume that, because if it is null then
>> the behaviour on dereferencing was undefined,
>
> Why is that? memory address of 0 is a valid memory address. At least
> in hardware terms.

You’re still thinking about C as ‘portable assembler’.

> Does the C language enforce that memory at (page) address 0 is
> unaddressable?

It’s not about what it enforces; it’s about what it doesn’t enforce. In
this case, it places no constraints on the implementation’s behavior
when a null pointer (or any other kind of invalid pointer) is
dereferenced. Modern implementations exploit this absence of constraints
in their code generation.

--
https://www.greenend.org.uk/rjk/


computers / comp.os.linux.misc / Re: self-documenting APL, not COBOL and tricks

Pages:123456789101112131415161718192021222324252627282930313233
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor