Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Thufir's a Harkonnen now.


computers / alt.folklore.computers / Re: self-documenting APL, not COBOL and tricks

SubjectAuthor
* 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 tricksQuadibloc
 || ||||| `* Re: COBOL and tricksCharlie Gibbs
 || |||||  +- Re: COBOL and tricksAhem A Rivet's Shot
 || |||||  `- Re: COBOL and tricksAhem A Rivet's Shot
 || ||||`* 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: COBOL and tricksLew Pitcher
 || |  +* Re: COBOL and tricksKerr-Mudd, John
 || |  |`* Re: COBOL and tricksCharlie Gibbs
 || |  | `* Re: COBOL and tricksKerr-Mudd, John
 || |  |  `* Re: COBOL and tricksLew Pitcher
 || |  |   `* Re: COBOL and tricksCharlie Gibbs
 || |  |    `* Re: COBOL and tricksAhem A Rivet's Shot
 || |  |     `* Re: COBOL and tricksCharlie Gibbs
 || |  |      `- Re: COBOL and tricksAhem A Rivet's Shot
 || |  +- Re: COBOL and tricksCharlie Gibbs
 || |  `* Re: COBOL and tricks25B.Z959
 || |   +* Re: COBOL and tricksLew Pitcher
 || |   |+* Re: COBOL and tricksCharlie Gibbs
 || |   ||`- Re: COBOL and tricks25B.Z959
 || |   |+* Re: COBOL and tricksAllodoxaphobia
 || |   ||+* Re: COBOL and tricks25B.Z959
 || |   |||`* Re: COBOL and tricksAlan Bowler
 || |   ||| `* Re: COBOL and tricksJohn Levine
 || |   |||  `* Re: COBOL and tricksAnne & Lynn Wheeler
 || |   |||   `- Re: COBOL and tricksAnne & Lynn Wheeler
 || |   ||+- Re: COBOL and tricksAhem A Rivet's Shot
 || |   ||`* Re: COBOL and tricksKerr-Mudd, John
 || |   || +- Re: COBOL and tricksDan Espen
 || |   || +* Re: COBOL and tricksDennis Boone
 || |   || |`* Re: COBOL and tricksScott Lurndal
 || |   || | +- Re: COBOL and tricksKerr-Mudd, John
 || |   || | `* Re: COBOL and tricksPeter Flass
 || |   || |  +* Re: COBOL and tricksScott Lurndal
 || |   || |  |+- Re: COBOL and tricksPeter Flass
 || |   || |  |`* Re: COBOL and tricksCharles Richmond
 || |   || |  | `- Re: COBOL and tricksRich Alderson
 || |   || |  +- Re: COBOL and tricksDan Espen
 || |   || |  `* Re: COBOL and tricksCharles Richmond
 || |   || |   `* Re: COBOL and tricksAhem A Rivet's Shot
 || |   || |    `- Re: COBOL and tricksCharlie Gibbs
 || |   || `* Re: COBOL and tricks25B.Z959
 || |   ||  +* Re: COBOL and tricksJack Strangio
 || |   ||  |`- Re: COBOL and tricksPeter Flass
 || |   ||  `- Re: COBOL and tricksAllodoxaphobia
 || |   |`* Re: COBOL and tricks25B.Z959
 || |   | +* Re: COBOL and tricksCharlie Gibbs
 || |   | |`* Re: COBOL and tricks25B.Z959
 || |   | | +- Re: COBOL and tricksmaus
 || |   | | `- Re: COBOL and tricksCharlie Gibbs
 || |   | `* Re: COBOL and tricksCharles Richmond
 || |   |  `* Re: COBOL and tricksMike Spencer
 || |   |   `* Re: COBOL and tricksCharlie Gibbs
 || |   `* Re: COBOL and tricksPeter Flass
 || `* 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

Pages:12345678910111213141516171819202122232425262728
Re: COBOL and tricks

<msCdnRUjXqMA6kL_nZ2dnUU7-dfNnZ2d@earthlink.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5941&group=alt.folklore.computers#5941

  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 00:11:57 -0500
Subject: Re: COBOL and tricks
Newsgroups: alt.folklore.computers,comp.os.linux.misc
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>
<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>
<tbhibj$3tqoq$1@dont-email.me>
<xLidnR_o-_ElKkH_nZ2dnUU7-SXNnZ2d@earthlink.com>
<7ZpDK.64090$sZ1.19046@fx07.iad>
From: 25B.Z959@nada.net (25B.Z959)
Date: Tue, 26 Jul 2022 01:11:56 -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: <7ZpDK.64090$sZ1.19046@fx07.iad>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Message-ID: <msCdnRUjXqMA6kL_nZ2dnUU7-dfNnZ2d@earthlink.com>
Lines: 41
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.165.113
X-Trace: sv3-6SYq8G8EMsTtDQmIwTdB8Vp0rS4GbO4YVn2wxBia264MtTqFvsWhFmqm12a7oMwY34nwED+wWhVSyXb!KUuBhAKt76yPloWAwOFBFPY+RS8UtkBLt5yOz2vNVJ97LLIGvEa3pRZJw1AyavMy52vUstpFrJbO!tfzIzE5SFyPU73JNsjBm
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: 3910
 by: 25B.Z959 - Tue, 26 Jul 2022 05:11 UTC

On 7/25/22 1:36 AM, Charlie Gibbs wrote:
> On 2022-07-24, 25B.Z959 <25B.Z959@nada.net> wrote:
>
>> FORTRAN is still pretty widely used also, esp in academic
>> and engineering environments, mostly due to the huge volume
>> of proven hard-core math routines which nobody wants to
>> re-write.
>
> Many rivals, with the benefit of hindsight, have crossed
> swords with the old workhorse! Yet FORTRAN gallops on,
> warts and all, more transportable than syphilis, fired
> by a bottomless pit of working subprograms.
> -- Stan Kelly-Bootle: The Devil's DP Dictionary
>

Fully agree ... NOBODY wants to re-invent it - and
those subs are LONG-PROVEN while replacements would
not be able to make such a claim.

People design buildings, bridges, aircraft, nuclear
reactors, with FORTRAN code. Who would RISK doing
so with 'translations' that might have subtle 'pentium
bugs' within ???

Besides, it's not THAT bad of a language - not too
difficult (except for output formatting). Very
straight-up, not many cryptic symbols or such. Not
a zillion brackets or lambda statements. If you can
program a modern BASIC you can program FORTRAN
real quick. I hadn't touched it in like 40 years and
wrote a nice handy library of useful string and numeric
crap I use in almost every program - within 48 lazy hours.

Then I wrote a utility that translates text-based data
records into a couple of other forms you can more easily
import into common databases. Sure, COULD have wrote that
in Python or 'C' or Pascal ... but ....... :-)

The "modern" design where stuff doesn't have to be
in EXACT locations on the "punch card" DOES make it
all much nicer.

Re: COBOL and tricks

<5bOdndBzuNkG5kL_nZ2dnUU7-UnNnZ2d@earthlink.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5942&group=alt.folklore.computers#5942

  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 00:28:59 -0500
Subject: Re: COBOL and tricks
Newsgroups: alt.folklore.computers,comp.os.linux.misc
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>
From: 25B.Z959@nada.net (25B.Z959)
Date: Tue, 26 Jul 2022 01:28:58 -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: <574555364.680474584.174865.peter_flass-yahoo.com@news.eternal-september.org>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Message-ID: <5bOdndBzuNkG5kL_nZ2dnUU7-UnNnZ2d@earthlink.com>
Lines: 123
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.165.113
X-Trace: sv3-u7tBEzIzEEWTeBZt7U6Ef0i4+ZwiCDKQkaUN7HVUUwPG/N5nqrMmBl2YpXz5Pe/cucKVVKk+8uwFGbh!to1mb7BHh6/3Ik8myeo2uIrIHADZJbMq4+KkpjJcquWD3bDF23UIf7W8AViO5mKys7pPEgeD+xzG!yo4ZPCQJmAZ0OPbyv6uE
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: 7449
 by: 25B.Z959 - Tue, 26 Jul 2022 05:28 UTC

On 7/25/22 4:55 PM, Peter Flass wrote:
> 25B.Z959 <25B.Z959@nada.net> wrote:
>> On 7/23/22 6:23 PM, Peter Flass wrote:
>>> 25B.Z959 <25B.Z959@nada.net> wrote:
>>>> On 7/19/22 10:50 PM, Lew Pitcher wrote:
>>>>> On Tue, 19 Jul 2022 22:34:40 -0400, 25B.Z959 wrote:
>>>>>
>>>>>> On 7/19/22 3:48 PM, Lew Pitcher wrote:
>>>>>>> On Tue, 19 Jul 2022 11:58:29 -0700, Peter Flass wrote:
>>>>>>>
>>>>>>>> The Natural Philosopher <tnp@invalid.invalid> wrote:
>>>>>>>>> On 19/07/2022 18:48, Peter Flass wrote:
>>>>>>>>>> 25B.Z959 <25B.Z959@nada.net> wrote:
>>>>>>> [snip]
>>>>>>>>>>> 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.
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Maybe these are better than translators I have seen, but old ones produced
>>>>>>>>>> unreadable code, and they might well miss some litte tricks that the old
>>>>>>>>>> guys put in, and so leave time-bombs in the translated program. Much more
>>>>>>>>>> expensive, but a lot better, is to extract the specs from the existing
>>>>>>>>>> code, and there are re-engineering programs that can probably do a lot of
>>>>>>>>>> that work, and then rewrite in the new language using programmers skilled
>>>>>>>>>> in that language.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> TBH you cant do many tricks in COBOL and the whole thrust of the bloody
>>>>>>>>> language is 'do it by the book, and write the book as documentation, as
>>>>>>>>> well'
>>>>>>>>>
>>>>>>>>
>>>>>>>> How much would you like to bet? Yes, the language encourages
>>>>>>>> straightforward programming, but I’ve seen things…
>>>>>>>
>>>>>>> A long time ago, I worked on many COBOL applications, including a
>>>>>>> client (PC) / server (MVS) communications application. I've seen
>>>>>>> things that I cannot unsee, coded things that I cannot uncode.
>>>>>>
>>>>>>
>>>>>> Got any of it on a floppy or print-out anywhere ? I'd
>>>>>> love to see how to do client/server only using COBOL.
>>>>>
>>>>> Both client and server used the same COBOL codebase, but with
>>>>> different compilers and operating environments.
>>>>>
>>>>> The client was coded in Microfocus "Visual Object (VISOC)" COBOL
>>>>> and ran on Windows NT 3 and Windows NT 4.1, using a TCP/IP to SNA
>>>>> (terminal communications) connection.
>>>>>
>>>>> The server was coded in IBM COBOL and ran under IMS DC on an MVS
>>>>> system, using an SNA terminal LU as it's communications endpoint.
>>>>>
>>>>> As this was an in-house "inner platform" project (3 tier client/server
>>>>> architecture, circa 1990), I did not keep personal copies of any
>>>>> of the code. Suffice it to say that my first question to the architect,
>>>>> my first day on that project, was "Why COBOL?" The answer was "Because
>>>>> that's what the coders know."
>>>>
>>>>
>>>> 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.
>>>
>>> I have used both languages quite a bit, perhaps COBOL more, years ago, but
>>> neither is my preferred language, so I have no dog in this fight.
>>
>>
>> Sorry, I like 'C' - and have writ little functions, MY way,
>> to do a lot of the things you were talking about.
>>
>> Only ASM gives you more control - and I've done my share of
>> that over the years too.
>>
>>>
>>>>
>>>> Mostly I like "terse" languages - less typing and lots
>>>> of room left over for comments at the ends of the lines.
>>>
>>> Sounds like assembler ;-)
>>
>>
>> YES ! :-)
>>
>> ASM ... MMmmmmmmm !
>>
>>
>>> It’s too easy to write tricky code with side-effects in C. COBOL might not
>>> be as self-documenting as advertised, but the operation of each statement
>>> is pretty obvious and easily understood.
>>
>> 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.

And then I see "examples" with 200 lines of 'C' or
whatever with like THREE cryptic comments. The rest
is apparently all Magic ....

Re: COBOL and tricks

<e5mdnQYhVca64EL_nZ2dnUU7-YHNnZ2d@earthlink.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5943&group=alt.folklore.computers#5943

  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 00:35:35 -0500
Subject: Re: COBOL and tricks
Newsgroups: alt.folklore.computers,comp.os.linux.misc
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>
<Q8FDK.545253$J0r9.492663@fx11.iad>
From: 25B.Z959@nada.net (25B.Z959)
Date: Tue, 26 Jul 2022 01:35:34 -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: <Q8FDK.545253$J0r9.492663@fx11.iad>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Message-ID: <e5mdnQYhVca64EL_nZ2dnUU7-YHNnZ2d@earthlink.com>
Lines: 39
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.165.113
X-Trace: sv3-sGY/1jFF7Qga8xfstOOloLC8omxAiGXmaiHeCIsqCD11DC4QODsIk5J/Jk0wR8INUx/3PolFq4R6gdK!j9hrssJJC+bhYpWi0MNCcB2syGhy9rqObsYziL7GXC4WGfnAn5Y28B0QTkD3w8OLm3zV6CigtVIE!LT4ewBvD+0Rz9fFXtQJT
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: 3672
 by: 25B.Z959 - Tue, 26 Jul 2022 05:35 UTC

On 7/25/22 6:52 PM, Charlie Gibbs wrote:
> On 2022-07-25, Peter Flass <peter_flass@yahoo.com> wrote:
>
>> 25B.Z959 <25B.Z959@nada.net> wrote:
>>
>>> On 7/23/22 6:23 PM, Peter Flass wrote:
>>>
>>>> It’s too easy to write tricky code with side-effects in C. COBOL might not
>>>> be as self-documenting as advertised, but the operation of each statement
>>>> is pretty obvious and easily understood.
>>>
>>> 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.
>
> I've cleaned up some pretty horrid COBOL code. Overly-verbose and
> convoluted code can be just as bad as something overly concise.

I would not even begin to deny that Truth.

> A sufficiently determined programmer can write unreadable code
> in any language. Convoluted code with no comments is even worse.
> Convoluted code with outdated, incorrect comments is worse still.

SOME do it INTENTIONALLY - "job security" or pure ego
perhaps.

Hey, there's always Brainfuck .......

The vast bulk of my code is COMMENTS, lucid explanations,
an ongoing narrative of every step. No code can document
itself better than the programmer can whether it's ASM or
COBOL or LISP or whatever bizarre paradigm. Might take one
line, or 50, to explain what's going on and why.

Re: COBOL and tricks

<slrntdv1fh.3vh.maus@dmaus.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5944&group=alt.folklore.computers#5944

  copy link   Newsgroups: alt.folklore.computers
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: maus@dmaus.org (maus)
Newsgroups: alt.folklore.computers
Subject: Re: COBOL and tricks
Date: 26 Jul 2022 06:13:05 GMT
Lines: 30
Message-ID: <slrntdv1fh.3vh.maus@dmaus.org>
References: <871quvs7m8.fsf@usenet.ankman.de>
<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>
<tbhibj$3tqoq$1@dont-email.me>
<xLidnR_o-_ElKkH_nZ2dnUU7-SXNnZ2d@earthlink.com>
<7ZpDK.64090$sZ1.19046@fx07.iad>
<msCdnRUjXqMA6kL_nZ2dnUU7-dfNnZ2d@earthlink.com>
X-Trace: individual.net tkWoPm6J91vuz/g1RGMb7AP7lW4eZo6b3i7rnq/C+fRKrNLVLg
Cancel-Lock: sha1:geLInOvjnlUkM+jnyeL5dgbdeik=
User-Agent: slrn/1.0.3 (Linux)
 by: maus - Tue, 26 Jul 2022 06:13 UTC

On 2022-07-26, 25B.Z959 <25B.Z959@nada.net> wrote:
> On 7/25/22 1:36 AM, Charlie Gibbs wrote:
>> On 2022-07-24, 25B.Z959 <25B.Z959@nada.net> wrote:
>>
>>> FORTRAN is still pretty widely used also, esp in academic
>>> and engineering environments, mostly due to the huge volume
>>> of proven hard-core math routines which nobody wants to
>>> re-write.
>>
>> Many rivals, with the benefit of hindsight, have crossed
>> swords with the old workhorse! Yet FORTRAN gallops on,
>> warts and all, more transportable than syphilis, fired
>> by a bottomless pit of working subprograms.
>> -- Stan Kelly-Bootle: The Devil's DP Dictionary
>>
>
> Fully agree ... NOBODY wants to re-invent it - and
> those subs are LONG-PROVEN while replacements would
> not be able to make such a claim.
>
> in EXACT locations on the "punch card" DOES make it
> all much nicer.

++

--
greymausg@mail.com
"Are you sure that you can live on your investments after retirement?
If not, send us all your money."

Re: Fwd: Linux on a small memory PC

<lYadnW5y4eNdEEL_nZ2dnUU7-W3NnZ2d@earthlink.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5946&group=alt.folklore.computers#5946

  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!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 26 Jul 2022 01:46:24 -0500
Subject: Re: Fwd: Linux on a small memory PC
Newsgroups: alt.folklore.computers,comp.os.linux.misc
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>
<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>
<tb8m6v$1i9o2$10@dont-email.me> <WLWBK.527042$ntj.319471@fx15.iad>
<Kd2dncQdB5pAh0P_nZ2dnUU7-cnNnZ2d@earthlink.com>
<X5qDK.463534$ssF.214083@fx14.iad>
From: 25B.Z959@nada.net (25B.Z959)
Date: Tue, 26 Jul 2022 02:46:23 -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: <X5qDK.463534$ssF.214083@fx14.iad>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Message-ID: <lYadnW5y4eNdEEL_nZ2dnUU7-W3NnZ2d@earthlink.com>
Lines: 71
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.165.113
X-Trace: sv3-Ar4mZNl/nmIBs93iajhwTemv6e4GJVA7TKrC0JCucelDQh6qmw+NHvALe2mdnzs1V6msi86FvJYhVOC!RvKB1MSbAwx8Ewf8pnge9PV3fjSqtb3hk9zJBGX2mkClXgz5PNHv7z2VNF1etslyLdx74CQ5Sr6s!dEMjD7l0TNftj31o2Mlu
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: 5516
X-Received-Bytes: 5638
 by: 25B.Z959 - Tue, 26 Jul 2022 06:46 UTC

On 7/25/22 1:45 AM, Charlie Gibbs wrote:
> On 2022-07-25, 25B.Z959 <25B.Z959@nada.net> wrote:
>
>> I was always able to find smaller outfits where Fast,
>> Efficient and Creative was coveted and appreciated.
>> I could identify Needs they didn't know existed and
>> act on them. The checks weren't quite as big - but ....
>
> I've always gravitated toward smaller outfits . When I left $BIGCORP
> for a smaller one, the hiring personnel director was baffled that
> I would come to a job that paid less. But I got my sanity back,
> and since the new establishment was closer to home, I saved $200
> per month on gas plus a lot of commute time.
>
> (Ten years later that outfit went Dilbert too, but that's another story.)

They all go Dilbert, must be a human/corporate-nature thing,
after awhile ... migrate to start-ups with exotic needs. That
keeps it interesting. I haven't felt like I was *WORKING A
JOB* in 40 years.

One of the bosses saw a Digital Signage example - and wanted
one ... but I couldn't find a decent cheap/free example. So
I wrote one in Python. Then I re-wrote it it Laz/FPC even
better and snappier and more capable. Runs on a rPI
velcro-ed to a Big Screen - you can even take it off
premises, web interface, assemble/arrange yer slide deck.
Some very bad/redundant PHP/HTML involved. FUN !

The mechanic wanted a working maint program - which
was PROMISED by a company as part of a larger package
TWO YEARS AGO and there's no sign of it. A few days
with Laz/FPC and he's got a flexible GUI app that
uses a PICK-style ascii-delimited multivalue database.
FUN ! Then the FORTRAN utility that can translate it
into several formats easy to eventually import into
several kinds of databases. FUN !

I've always loved making exotic dataloggers - micro-controllers
and hand-wired boards, unique sensors. Programming Meets Real
World. Admittedly devices like HOBO loggers can do a lot with
micro-power - and teeny little chips only robots can deal with -
but they tend to be oriented around a handful of "standard"
measurements/methods. What if you need something "different" ?
Well, you MAKE IT YOURSELF. (go with the SEEED LiPo/Solar
chargers, they hold the right output voltage regardless of
solar influx) How do you get +/- 2mm accuracy out of distance
sensors rated for +/- 10mm accuracy ? FUN !

Admittedly, I'm a fan of the immortal Steve Ciarcia who always
said his favorite programming language was "Solder". Amazing
what you can accomplish with a few parts and logic gates ...
stuff even affordable DSP chips will suffer to do ... and
there weren't any DSP chips for most of my career.

Consider eyes - they are little brains unto themselves. They
prep, qualify, quantify, format, "DSP", comment, the raw
input all by themselves before sending the condensed study
on to the brain. A very smart peripheral that makes the
main system MUCH more efficient and responsive.

And I got six figures, insurance and a retirement plan and
occasional peer awards for all this fun :-)

Smaller CAN be bigger. Find a niche you can LOVE.

But if you just HAVE to have the biggest mini-mansion
on the block and $125,000 matched Hiz/Herz SUVs and
the gigantic loan payments that come with it ... well ...
you may have to *WORK A HATEFUL JOB* for pointy-haired
bosses ... sorry .........

Re: COBOL and tricks

<tbo9oj$rej$1@news.misty.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5947&group=alt.folklore.computers#5947

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!.POSTED.77-58-244-139.dclient.hispeed.ch!not-for-mail
From: bqt@softjar.se (Johnny Billquist)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Tue, 26 Jul 2022 10:48:18 +0200
Organization: MGT Consulting
Message-ID: <tbo9oj$rej$1@news.misty.com>
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>
<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>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 26 Jul 2022 08:48:20 -0000 (UTC)
Injection-Info: news.misty.com; posting-host="77-58-244-139.dclient.hispeed.ch:77.58.244.139";
logging-data="28115"; mail-complaints-to="abuse@misty.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.11.0
Content-Language: en-US
In-Reply-To: <tbn9oq$1h6ku$2@dont-email.me>
 by: Johnny Billquist - Tue, 26 Jul 2022 08:48 UTC

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.

Johnny

Re: COBOL and tricks

<tbocqu$1silh$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5948&group=alt.folklore.computers#5948

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!news.freedyn.de!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: Tue, 26 Jul 2022 10:40:46 +0100
Organization: A little, after lunch
Lines: 60
Message-ID: <tbocqu$1silh$1@dont-email.me>
References: <871quvs7m8.fsf@usenet.ankman.de>
<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; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 26 Jul 2022 09:40:46 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="af0785dda1a42be4da28e5e549b7c30a";
logging-data="1985201"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19RMgBntclsFa4vXZ8nZOSArgddl+SnP3Y="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:zhM6UaRKfQsUrbKYnOHRZ7THPGs=
Content-Language: en-GB
In-Reply-To: <tbo9oj$rej$1@news.misty.com>
 by: The Natural Philosop - Tue, 26 Jul 2022 09:40 UTC

On 26/07/2022 09:48, Johnny Billquist 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.
>
>   Johnny
Value judgements depend on ones ethical standpoint.

COBOL allowed teams of relatively untechnical people to create and
maintain large programs in a disciplined way. It allowed efficient use
of limited memory and good control over formatted printouts.

Its downside was massively large source code, and inability to get close
to the bare metal.

C is the exact opposite, terse, machine level assembler but faster
coded. It exactly suits a technically aware person who knows exactly
what they are doing and is capable of minding his on Ps and Qs.

Yer pays yer money...
--
Climate Change: Socialism wearing a lab coat.

Re: COBOL and tricks

<tbok3d$1udf5$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5949&group=alt.folklore.computers#5949

  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 07:44:43 -0400
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <tbok3d$1udf5$1@dont-email.me>
References: <871quvs7m8.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
Injection-Info: reader01.eternal-september.org; posting-host="050670d6e003d784d21d9a77be0998c9";
logging-data="2045413"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19zqYCrtFT+owK8z38qfzLjlFyFe/sktRQ="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:AwQwJqC/N18guUa7bRMrwb0kkak=
 by: Dan Espen - Tue, 26 Jul 2022 11:44 UTC

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.

--
Dan Espen

Re: COBOL and tricks

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

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5950&group=alt.folklore.computers#5950

  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: Tue, 26 Jul 2022 14:13:56 +0100
Organization: terraraq NNTP server
Message-ID: <87pmhsow2z.fsf@LkoBDZeT.terraraq.uk>
References: <871quvs7m8.fsf@usenet.ankman.de>
<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> <tbocqu$1silh$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="34115"; mail-complaints-to="usenet@mantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:1FIKU/+J0wkABPxC8H+oX8a6q1U=
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 - Tue, 26 Jul 2022 13:13 UTC

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)
return 0;
return r;
}
richard@sfere:~/junk$ gcc -O2 -c t.c && objdump -dMintel t.o

t.o: file format elf64-x86-64

Disassembly of section .text:

0000000000000000 <f>:
0: 8b 07 mov eax,DWORD PTR [rdi]
2: c3 ret

If C really was some kind of ‘portable assembler’, the compiler would
preserve the test of ptr even though it follows the indirect read.

In C as actually specified, the compiler is free to remove it, and
compilers do just that.

In a user space application this mistake just leads to a crash; in the
Linux kernel a variant of it lead to CVE-2009-1897.

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

Re: COBOL and tricks

<20220726151015.7f8dc972fa92debff0ecfaa2@eircom.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5953&group=alt.folklore.computers#5953

  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 15:10:15 +0100
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <20220726151015.7f8dc972fa92debff0ecfaa2@eircom.net>
References: <871quvs7m8.fsf@usenet.ankman.de>
<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>
<tbocqu$1silh$1@dont-email.me>
<87pmhsow2z.fsf@LkoBDZeT.terraraq.uk>
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="2129617"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18QgZD7Vs25+iyglxo1iznupSFC6khgfKU="
Cancel-Lock: sha1:DIrGYFwphs1QH9b8czSpqPACn84=
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 14:10 UTC

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.

> if(!ptr)

Did you mean !*ptr ?

> return 0;
> return r;

Or is it counting on ptr not really being followed until here ?

> Disassembly of section .text:
>
> 0000000000000000 <f>:
> 0: 8b 07 mov eax,DWORD PTR [rdi]
> 2: c3 ret

That would be consistent with optimising out a test for *ptr

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

Re: COBOL and tricks

<W2TDK.65409$iR.21550@fx44.iad>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5954&group=alt.folklore.computers#5954

  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!fx44.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: COBOL and tricks
Newsgroups: alt.folklore.computers,comp.os.linux.misc
References: <871quvs7m8.fsf@usenet.ankman.de> <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>
Lines: 19
Message-ID: <W2TDK.65409$iR.21550@fx44.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 26 Jul 2022 14:41:58 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 26 Jul 2022 14:41:58 GMT
X-Received-Bytes: 1618
 by: Scott Lurndal - Tue, 26 Jul 2022 14:41 UTC

Ahem A Rivet's Shot <steveo@eircom.net> writes:
>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.

To be fair, this was an actual example from the linux kernel a few
years ago.

Re: COBOL and tricks

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

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5955&group=alt.folklore.computers#5955

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!aioe.org!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: Tue, 26 Jul 2022 15:52:48 +0100
Organization: terraraq NNTP server
Message-ID: <87edy8ori7.fsf@LkoBDZeT.terraraq.uk>
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>
<20220726151015.7f8dc972fa92debff0ecfaa2@eircom.net>
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="35690"; mail-complaints-to="usenet@mantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:wqssRPdovZISEnB55eTopDbPzAA=
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 - Tue, 26 Jul 2022 14:52 UTC

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.

>> Disassembly of section .text:
>>
>> 0000000000000000 <f>:
>> 0: 8b 07 mov eax,DWORD PTR [rdi]
>> 2: c3 ret
>
> That would be consistent with optimising out a test for *ptr

Sure, but that’s not the test found in the source. It has optimized out
the if(!ptr) return 0.

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

Re: COBOL and tricks

<tbp097$21k72$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5956&group=alt.folklore.computers#5956

  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: Tue, 26 Jul 2022 16:12:39 +0100
Organization: A little, after lunch
Lines: 69
Message-ID: <tbp097$21k72$1@dont-email.me>
References: <871quvs7m8.fsf@usenet.ankman.de>
<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> <tbocqu$1silh$1@dont-email.me>
<87pmhsow2z.fsf@LkoBDZeT.terraraq.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 26 Jul 2022 15:12:39 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="af0785dda1a42be4da28e5e549b7c30a";
logging-data="2150626"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+yd8KTsbpMvkM7TErdvLxxYPL0k0mYMX0="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:1ssedZWwxPWOU222AYKfvJNUO00=
In-Reply-To: <87pmhsow2z.fsf@LkoBDZeT.terraraq.uk>
Content-Language: en-GB
 by: The Natural Philosop - Tue, 26 Jul 2022 15:12 UTC

On 26/07/2022 14:13, Richard Kettlewell 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)
> return 0;
> return r;
> }
> richard@sfere:~/junk$ gcc -O2 -c t.c && objdump -dMintel t.o
>
> t.o: file format elf64-x86-64
>
>
> Disassembly of section .text:
>
> 0000000000000000 <f>:
> 0: 8b 07 mov eax,DWORD PTR [rdi]
> 2: c3 ret
>
> If C really was some kind of ‘portable assembler’, the compiler would
> preserve the test of ptr even though it follows the indirect read.

Well C when I learnt it would have done just that. Today its full of
SmartShit™ because computer scientists got their hands on it and tried
to second guess what you really meant rather than what you actually wrote.

And that example is precisely the sort of coding that wasn't done by
someone who knew what they were doing

int f(int *ptr)
{
return(ptr? *ptr:0);
}
Is clearer and absolutely implies the ptr needs to be tested in order to
determine the result.

And it avoids trying to access the contents of a null pointer, which
might cause issues
>
> In C as actually specified, the compiler is free to remove it, and
> compilers do just that.
>
I don't see why. The return value is conditional on the test of ptr.

To me that looks like bad code and a compiler bug

> In a user space application this mistake just leads to a crash; in the
> Linux kernel a variant of it lead to CVE-2009-1897.
>
Whoever wrote that code needs sacking, You do not reference memory
pointers that may be null.

Nor should a compiler assume that if a pointer has been referenced it is
therefore not null.

--
The lifetime of any political organisation is about three years before
its been subverted by the people it tried to warn you about.

Anon.

Re: COBOL and tricks

<tbp0n6$21no4$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5957&group=alt.folklore.computers#5957

  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: Tue, 26 Jul 2022 16:20:06 +0100
Organization: A little, after lunch
Lines: 55
Message-ID: <tbp0n6$21no4$1@dont-email.me>
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>
<20220726151015.7f8dc972fa92debff0ecfaa2@eircom.net>
<87edy8ori7.fsf@LkoBDZeT.terraraq.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 26 Jul 2022 15:20:07 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="af0785dda1a42be4da28e5e549b7c30a";
logging-data="2154244"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/EFq0mUwzo/1W8qBkVfrFzkt7iTycZWA0="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:7udP8XOnWG+LLIRD55uuCOhH6lo=
Content-Language: en-GB
In-Reply-To: <87edy8ori7.fsf@LkoBDZeT.terraraq.uk>
 by: The Natural Philosop - Tue, 26 Jul 2022 15:20 UTC

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

--
It’s easier to fool people than to convince them that they have been fooled.
Mark Twain

Re: COBOL and tricks

<tbp2cv$224ma$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5959&group=alt.folklore.computers#5959

  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: Pancho.Jones@proton.me (Pancho)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Tue, 26 Jul 2022 16:48:47 +0100
Organization: A noiseless patient Spider
Lines: 63
Message-ID: <tbp2cv$224ma$1@dont-email.me>
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>
<20220726151015.7f8dc972fa92debff0ecfaa2@eircom.net>
<87edy8ori7.fsf@LkoBDZeT.terraraq.uk> <tbp0n6$21no4$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 26 Jul 2022 15:48:47 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="7b2c6bd802e2cb9e2b3b62fd210fbe68";
logging-data="2167498"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+TI2+0ozuW4+q6CQ7SYWUNXBOiaKTZPAU="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.3.0
Cancel-Lock: sha1:cXuFG0Wxl7A3CpYNIv3Z2CJlr8c=
Content-Language: en-GB
In-Reply-To: <tbp0n6$21no4$1@dont-email.me>
 by: Pancho - Tue, 26 Jul 2022 15:48 UTC

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.

Re: COBOL and tricks

<rsUDK.104202$Me2.65661@fx47.iad>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5960&group=alt.folklore.computers#5960

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx47.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: COBOL and tricks
Newsgroups: alt.folklore.computers,comp.os.linux.misc
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>
Lines: 23
Message-ID: <rsUDK.104202$Me2.65661@fx47.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 26 Jul 2022 16:17:27 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 26 Jul 2022 16:17:27 GMT
X-Received-Bytes: 1993
 by: Scott Lurndal - Tue, 26 Jul 2022 16:17 UTC

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

Re: COBOL and tricks

<tbp677$lv1$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5965&group=alt.folklore.computers#5965

  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: Tue, 26 Jul 2022 17:53:59 +0100
Organization: Not very much
Message-ID: <tbp677$lv1$1@gioia.aioe.org>
References: <871quvs7m8.fsf@usenet.ankman.de>
<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> <tbocqu$1silh$1@dont-email.me>
<87pmhsow2z.fsf@LkoBDZeT.terraraq.uk> <tbp097$21k72$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="22497"; 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 - Tue, 26 Jul 2022 16:53 UTC

On 26/07/2022 16:12, The Natural Philosopher wrote:
> Well C when I learnt it would have done just that. Today its full of
> SmartShit™ because computer scientists got their hands on it and
> tried to second guess what you really meant rather than what you
> actually wrote.

Actually, it's rather the opposite. If you switch on "-O2", the
compiler will assume that you mean what you wrote.

[Richard K]:
>> In C as actually specified, the compiler is free to remove it, and
>> compilers do just that.
> I don't see why. The return value is conditional on the test of ptr.

If "ptr" is 0, then the behaviour is undefined. So if your code
crashes and burns, you have no-one to blame but yourself.

> To me that looks like bad code

Certainly a bug. Characterising it as "bad code" is a step further.
There are worse programming sins than perpetrating a typo that should be
detected during testing. Including the sin of /not/ detecting it during
testing. But there are worse sins even than that.

> and a compiler bug

Not so. The compiler has simply assumed ["-O2", remember] that
you want your code to run as fast as possible. Once you invoke undefined
behaviour, anything that happens is fair game. Don't blame the compiler
for bugs in the program.

> Whoever wrote that code needs sacking, You do not reference memory
> pointers that may be null.

If every programmer who ever perpetrated a bug was sacked, there
would not be a single [useful] programmer in employment.

> Nor should a compiler assume that if a pointer has been referenced it
> is therefore not null.

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, and it scarcely matters,
/except as a courtesy to the user/, whether the actual behaviour is to
print a message saying "Yah, boo, sucks, you dereferenced a null pointer"
and halt or simply to let the program continue on its merry way until
Something Bad happens.

If you need nice behaviour, then run your programs with compilers
that build in checks against illegal dereferencing, out-of-bounds indexing,
uninitialised variables, and so on. If you don't, then feel free to go for
optimisation that removes all the checks.

Of course, what sensible programmers do is to test their code
with checks switched on, and when satisfied switch them off. Even then,
we should remember Dijkstra; switching checks off in production code is
like using water wings when splashing around in the pool and discarding
them when swimming out to sea.

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

Re: COBOL and tricks

<875yjjpvtf.fsf@LkoBDZeT.terraraq.uk>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5969&group=alt.folklore.computers#5969

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!aioe.org!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: Tue, 26 Jul 2022 19:34:20 +0100
Organization: terraraq NNTP server
Message-ID: <875yjjpvtf.fsf@LkoBDZeT.terraraq.uk>
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>
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="38853"; mail-complaints-to="usenet@mantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:ILPC74/mT7KnkR+js+mDckSi4iI=
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 - Tue, 26 Jul 2022 18:34 UTC

The Natural Philosopher <tnp@invalid.invalid> writes:
> On 26/07/2022 14:13, Richard Kettlewell wrote:
>> In C as actually specified, the compiler is free to remove it, and
>> compilers do just that.
>
> I don't see why. The return value is conditional on the test of ptr.
>
> To me that looks like bad code and a compiler bug

It’s not a compiler bug. It’s permitted by the language spec as it’s
stood for the last few decades.

>> In a user space application this mistake just leads to a crash; in the
>> Linux kernel a variant of it lead to CVE-2009-1897.
>
> Whoever wrote that code needs sacking, You do not reference memory
> pointers that may be null.

If you sacked every programmer who created a bug there’d be none
left. (Maybe not such a bad thing.) But you’re missing the point, which
is that the ‘assembler’ model you proposed for C doesn’t match reality.

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

Re: COBOL and tricks

<tbpfr4$2off$2@gal.iecc.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5970&group=alt.folklore.computers#5970

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!not-for-mail
From: johnl@taugh.com (John Levine)
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: COBOL and tricks
Date: Tue, 26 Jul 2022 19:38:12 -0000 (UTC)
Organization: Taughannock Networks
Message-ID: <tbpfr4$2off$2@gal.iecc.com>
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>
Injection-Date: Tue, 26 Jul 2022 19:38:12 -0000 (UTC)
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970";
logging-data="90607"; mail-complaints-to="abuse@iecc.com"
In-Reply-To: <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>
Cleverness: some
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: johnl@iecc.com (John Levine)
 by: John Levine - Tue, 26 Jul 2022 19:38 UTC

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.

--
Regards,
John Levine, johnl@taugh.com, Primary Perpetrator of "The Internet for Dummies",
Please consider the environment before reading this e-mail. https://jl.ly

Re: COBOL and tricks

<6mYDK.543528$70j.422084@fx16.iad>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5973&group=alt.folklore.computers#5973

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.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: <871quvs7m8.fsf@usenet.ankman.de>
<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>
<tbhibj$3tqoq$1@dont-email.me>
<xLidnR_o-_ElKkH_nZ2dnUU7-SXNnZ2d@earthlink.com>
<7ZpDK.64090$sZ1.19046@fx07.iad>
<msCdnRUjXqMA6kL_nZ2dnUU7-dfNnZ2d@earthlink.com>
User-Agent: slrn/1.0.3 (Linux)
Lines: 16
Message-ID: <6mYDK.543528$70j.422084@fx16.iad>
X-Complaints-To: https://www.astraweb.com/aup
NNTP-Posting-Date: Tue, 26 Jul 2022 20:43:46 UTC
Date: Tue, 26 Jul 2022 20:43:46 GMT
X-Received-Bytes: 2051
 by: Charlie Gibbs - Tue, 26 Jul 2022 20:43 UTC

On 2022-07-26, 25B.Z959 <25B.Z959@nada.net> wrote:

> The "modern" design where stuff doesn't have to be
> in EXACT locations on the "punch card" DOES make it
> all much nicer.

On the other hand, fixed locations means you know exactly
where to look. Each method has its advantages and
disadvantages - although I admit that I've converted
to CSV for just about everything.

--
/~\ 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: Fwd: Linux on a small memory PC

<7mYDK.543530$70j.525285@fx16.iad>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5975&group=alt.folklore.computers#5975

  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: Fwd: Linux on a small memory PC
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>
<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>
<tb8m6v$1i9o2$10@dont-email.me> <WLWBK.527042$ntj.319471@fx15.iad>
<Kd2dncQdB5pAh0P_nZ2dnUU7-cnNnZ2d@earthlink.com>
<X5qDK.463534$ssF.214083@fx14.iad>
<lYadnW5y4eNdEEL_nZ2dnUU7-W3NnZ2d@earthlink.com>
User-Agent: slrn/1.0.3 (Linux)
Lines: 23
Message-ID: <7mYDK.543530$70j.525285@fx16.iad>
X-Complaints-To: https://www.astraweb.com/aup
NNTP-Posting-Date: Tue, 26 Jul 2022 20:43:47 UTC
Date: Tue, 26 Jul 2022 20:43:47 GMT
X-Received-Bytes: 2212
 by: Charlie Gibbs - Tue, 26 Jul 2022 20:43 UTC

On 2022-07-26, 25B.Z959 <25B.Z959@nada.net> wrote:

> Smaller CAN be bigger. Find a niche you can LOVE.
>
> But if you just HAVE to have the biggest mini-mansion
> on the block and $125,000 matched Hiz/Herz SUVs and
> the gigantic loan payments that come with it ... well ...
> you may have to *WORK A HATEFUL JOB* for pointy-haired
> bosses ... sorry .........

But that's Success. Don't you want Success?

I've spent my entire career avoiding Success.
It's much more fun that way.

BTW on Peter Gabriel's album _So_, the lyrics for
_Big Time_ are accompanied by the note "suc cess".

--
/~\ 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

<8mYDK.543531$70j.517354@fx16.iad>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5976&group=alt.folklore.computers#5976

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.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>
<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>
<5bOdndBzuNkG5kL_nZ2dnUU7-UnNnZ2d@earthlink.com>
User-Agent: slrn/1.0.3 (Linux)
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Lines: 35
Message-ID: <8mYDK.543531$70j.517354@fx16.iad>
X-Complaints-To: https://www.astraweb.com/aup
NNTP-Posting-Date: Tue, 26 Jul 2022 20:43:48 UTC
Date: Tue, 26 Jul 2022 20:43:48 GMT
X-Received-Bytes: 2886
 by: Charlie Gibbs - Tue, 26 Jul 2022 20:43 UTC

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

--
/~\ 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

<8mYDK.543532$70j.52459@fx16.iad>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5977&group=alt.folklore.computers#5977

  copy link   Newsgroups: alt.folklore.computers comp.os.linux.misc
Path: i2pn2.org!rocksolid2!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.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: <871quvs7m8.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> <tbok3d$1udf5$1@dont-email.me>
User-Agent: slrn/1.0.3 (Linux)
Lines: 17
Message-ID: <8mYDK.543532$70j.52459@fx16.iad>
X-Complaints-To: https://www.astraweb.com/aup
NNTP-Posting-Date: Tue, 26 Jul 2022 20:43:48 UTC
Date: Tue, 26 Jul 2022 20:43:48 GMT
X-Received-Bytes: 2138
 by: Charlie Gibbs - Tue, 26 Jul 2022 20:43 UTC

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

--
/~\ 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

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

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5978&group=alt.folklore.computers#5978

  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=5979&group=alt.folklore.computers#5979

  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


computers / alt.folklore.computers / Re: self-documenting APL, not COBOL and tricks

Pages:12345678910111213141516171819202122232425262728
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor