Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

"Life sucks, but it's better than the alternative." -- Peter da Silva


computers / comp.os.vms / BASIC (and Horizon)

SubjectAuthor
* BASIC (and Horizon)Simon Clubley
`* Re: BASIC (and Horizon)Arne Vajhøj
 `* Re: BASIC (and Horizon)kludge
  +- Re: BASIC (and Horizon)Lawrence D'Oliveiro
  +* Re: BASIC (and Horizon)Arne Vajhøj
  |`* Re: BASIC (and Horizon)Dave Froble
  | +* Re: BASIC (and Horizon)Chris Townley
  | |`* Re: BASIC (and Horizon)Dave Froble
  | | +* Re: BASIC (and Horizon)Chris Townley
  | | |`* Re: BASIC (and Horizon)Dave Froble
  | | | +- Re: BASIC (and Horizon)Chris Townley
  | | | `- Re: BASIC (and Horizon)Lawrence D'Oliveiro
  | | +* Re: BASIC (and Horizon)Michael S
  | | |+* Re: BASIC (and Horizon)Scott Dorsey
  | | ||`* Re: BASIC (and Horizon)Arne Vajhøj
  | | || +- Re: BASIC (and Horizon)Dan Cross
  | | || `* Re: BASIC (and Horizon)Scott Dorsey
  | | ||  `* Re: BASIC (and Horizon)Arne Vajhøj
  | | ||   `- Re: BASIC (and Horizon)Scott Dorsey
  | | |`* Re: BASIC (and Horizon)Lawrence D'Oliveiro
  | | | `* Re: BASIC (and Horizon)Arne Vajhøj
  | | |  +* Re: BASIC (and Horizon)Dave Froble
  | | |  |`* Re: BASIC (and Horizon)Dan Cross
  | | |  | `* Re: BASIC (and Horizon)Dave Froble
  | | |  |  +* Re: BASIC (and Horizon)Single Stage to Orbit
  | | |  |  |+- Re: BASIC (and Horizon)Dan Cross
  | | |  |  |`* Re: BASIC (and Horizon)Dave Froble
  | | |  |  | `- Re: BASIC (and Horizon)Single Stage to Orbit
  | | |  |  +- Re: BASIC (and Horizon)Dan Cross
  | | |  |  +- Re: BASIC (and Horizon)Simon Clubley
  | | |  |  `- Re: BASIC (and Horizon)Lawrence D'Oliveiro
  | | |  `* Re: BASIC (and Horizon)Lawrence D'Oliveiro
  | | |   `* Re: BASIC (and Horizon)Arne Vajhøj
  | | |    +* Re: BASIC (and Horizon)Dan Cross
  | | |    |`* Re: BASIC (and Horizon)Simon Clubley
  | | |    | +- Re: BASIC (and Horizon)Dan Cross
  | | |    | `* Re: BASIC (and Horizon)Arne Vajhøj
  | | |    |  `- Re: BASIC (and Horizon)Lawrence D'Oliveiro
  | | |    +* Re: BASIC (and Horizon)Lawrence D'Oliveiro
  | | |    |+- Re: BASIC (and Horizon)Dan Cross
  | | |    |`* Re: BASIC (and Horizon)Arne Vajhøj
  | | |    | +* Re: BASIC (and Horizon)Dave Froble
  | | |    | |`* Re: BASIC (and Horizon)Arne Vajhøj
  | | |    | | `* Re: BASIC (and Horizon)Lawrence D'Oliveiro
  | | |    | |  `* Re: BASIC (and Horizon)Arne Vajhøj
  | | |    | |   `- Re: BASIC (and Horizon)Lawrence D'Oliveiro
  | | |    | `* Re: BASIC (and Horizon)Lawrence D'Oliveiro
  | | |    |  +* Re: BASIC (and Horizon)Arne Vajhøj
  | | |    |  |`- Re: BASIC (and Horizon)Lawrence D'Oliveiro
  | | |    |  `* Re: BASIC (and Horizon)Dan Cross
  | | |    |   `* Re: BASIC (and Horizon)Arne Vajhøj
  | | |    |    `- Re: BASIC (and Horizon)Dan Cross
  | | |    `- Re: BASIC (and Horizon)Dave Froble
  | | +* Re: BASIC (and Horizon)Arne Vajhøj
  | | |+* Re: BASIC (and Horizon)Simon Clubley
  | | ||`- Re: BASIC (and Horizon)Arne Vajhøj
  | | |`* Re: BASIC (and Horizon)Lawrence D'Oliveiro
  | | | `* Re: BASIC (and Horizon)Arne Vajhøj
  | | |  `* Re: BASIC (and Horizon)Lawrence D'Oliveiro
  | | |   `* Re: BASIC (and Horizon)Arne Vajhøj
  | | |    `* Re: BASIC (and Horizon)Lawrence D'Oliveiro
  | | |     `* Re: BASIC (and Horizon)Arne Vajhøj
  | | |      `* Re: BASIC (and Horizon)Lawrence D'Oliveiro
  | | |       `* Re: BASIC (and Horizon)Arne Vajhøj
  | | |        +- Re: BASIC (and Horizon)Arne Vajhøj
  | | |        `- Re: BASIC (and Horizon)Lawrence D'Oliveiro
  | | `* Re: BASIC (and Horizon)Stephen Hoffman
  | |  `* Re: BASIC (and Horizon)Lawrence D'Oliveiro
  | |   `* Re: BASIC (and Horizon)Stephen Hoffman
  | |    `- Re: BASIC (and Horizon)Lawrence D'Oliveiro
  | `- Re: BASIC (and Horizon)Arne Vajhøj
  `* Re: BASIC (and Horizon)bill
   +* Re: BASIC (and Horizon)Chris Townley
   |`- Re: BASIC (and Horizon)bill
   +* Re: BASIC (and Horizon)Scott Dorsey
   |`* Re: BASIC (and Horizon)bill
   | `* Re: BASIC (and Horizon)Bob Eager
   |  `* Re: BASIC (and Horizon)Lawrence D'Oliveiro
   |   `- Re: BASIC (and Horizon)Michael S
   `* Re: BASIC (and Horizon)Andreas Eder
    `- Re: BASIC (and Horizon)bill

Pages:1234
BASIC (and Horizon)

<up8qmo$ima5$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33350&group=comp.os.vms#33350

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: clubley@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley)
Newsgroups: comp.os.vms
Subject: BASIC (and Horizon)
Date: Mon, 29 Jan 2024 18:27:36 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 68
Message-ID: <up8qmo$ima5$1@dont-email.me>
Injection-Date: Mon, 29 Jan 2024 18:27:36 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3ff54b2a33f05e559719adfb6b5d245f";
logging-data="612677"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+YaKOvErBZtJL9eJGf08WxSrKAD4hf504="
User-Agent: slrn/0.9.8.1 (VMS/Multinet)
Cancel-Lock: sha1:RWWMzY4tLVpWjByypRDkWmfC6oo=
 by: Simon Clubley - Mon, 29 Jan 2024 18:27 UTC

On 2024-01-29, Dave Froble <davef@tsoft-inc.com> wrote:
> On 1/29/2024 8:24 AM, Simon Clubley wrote:
>>
>> $ set response/mode=good_natured
>>
>> Don't be too hard on David, Dan. He still likes to use line numbers
>> in his BASIC code... :-)
>>
>
> That is a filthy slander ...
>
> Line numbers can be used in place of labels for GoTo statements, which you'll
> also probably also slander. But they can be useful. Other than that, line
> numbers can be useful for appending boiler plate code to a program. Line
> numbers are used in handling error exceptions and handling.
>
> Your implication that I use numbers on every line is just false.
>

$ set response/mode=good_natured

Er, David, where do I say _every_ line ? Or is that a guilty conscience
that's reading something above which isn't there ? :-)

It was a reference to the last time you posted a bit of BASIC code and
it was pointed out it could be written much more cleanly using structured
control loops.

Someone (Arne IIRC) posted some BASIC code using structured control
loops and I don't remember you being too impressed by the different
coding style, even though to me, Arne's version looked a lot cleaner.

> If I'm going to have:
>
> On Error GoTo 32000
>
> Ahhh, what's the use, you're probably just laughing ...
>

$ set response/mode=angry

On the plus side, and to take the opportunity to vent my anger at something
that I get more angry about whenever more details are revealed, at least
you know how to reverse the sign of a variable without having to write a
function to do it. :-( :-(

See:

https://news.ycombinator.com/item?id=38926582

Original reference:

https://www.postofficehorizoninquiry.org.uk/evidence/fuj00080690-report-eposs-pinicl-task-force

See page 17 onwards of the PDF. :-(

Innocent people went to jail because of the system this code is
a part of, and because of the coverup around it, and it took
a TV drama to really get things moving. :-(

So, yes, I may make fun of your line numbers, but at least you most
certainly know what you are doing, unlike the above people.

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.

Re: BASIC (and Horizon)

<up9eho$lqco$2@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33358&group=comp.os.vms#33358

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arne@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Mon, 29 Jan 2024 19:06:18 -0500
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <up9eho$lqco$2@dont-email.me>
References: <up8qmo$ima5$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 30 Jan 2024 00:06:17 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="8fe35c34125a0cb85580234586c8ecf6";
logging-data="715160"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/RhB5Af4687b73bnEosktar555LJkcHo="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:vcbyZc6I8mHwJBf/7fNowJ6dvLY=
In-Reply-To: <up8qmo$ima5$1@dont-email.me>
Content-Language: en-US
 by: Arne Vajhøj - Tue, 30 Jan 2024 00:06 UTC

On 1/29/2024 1:27 PM, Simon Clubley wrote:
> On the plus side, and to take the opportunity to vent my anger at something
> that I get more angry about whenever more details are revealed, at least
> you know how to reverse the sign of a variable without having to write a
> function to do it. :-( :-(
>
> See:
>
> https://news.ycombinator.com/item?id=38926582
>
> Original reference:
>
> https://www.postofficehorizoninquiry.org.uk/evidence/fuj00080690-report-eposs-pinicl-task-force
>
> See page 17 onwards of the PDF. :-(
>
> Innocent people went to jail because of the system this code is
> a part of, and because of the coverup around it, and it took
> a TV drama to really get things moving. :-(
>
> So, yes, I may make fun of your line numbers, but at least you most
> certainly know what you are doing, unlike the above people.

The code is VB6.

But none of the problems are Basic specific. It is possible
to write the same bad code in C or Fortran or whatever.

So it just shows that there are some really really bad programmers out
there.

Arne

PS: Good compilers may have detected the unreachable code. But it
is still good vs bad compiler not good vs bad language.

Re: BASIC (and Horizon)

<up9h57$fmh$1@panix1.panix.com>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33359&group=comp.os.vms#33359

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!news.chmurka.net!weretis.net!feeder6.news.weretis.net!panix!.POSTED.panix1.panix.com!panix1.panix.com!not-for-mail
From: kludge@panix.com
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: 30 Jan 2024 00:50:47 -0000
Organization: Former users of Netcom shell (1989-2000)
Lines: 19
Message-ID: <up9h57$fmh$1@panix1.panix.com>
References: <up8qmo$ima5$1@dont-email.me> <up9eho$lqco$2@dont-email.me>
Injection-Info: reader1.panix.com; posting-host="panix1.panix.com:166.84.1.1";
logging-data="847"; mail-complaints-to="abuse@panix.com"
 by: kludge@panix.com - Tue, 30 Jan 2024 00:50 UTC

=?UTF-8?Q?Arne_Vajh=C3=B8j?= <arne@vajhoej.dk> wrote:
>The code is VB6.
>
>But none of the problems are Basic specific. It is possible
>to write the same bad code in C or Fortran or whatever.
>
>So it just shows that there are some really really bad programmers out
>there.

I have worked with people who could write spaghetti Fortran in any
programming language available. Did you know that LISP has a goto?
It does.

>PS: Good compilers may have detected the unreachable code. But it
> is still good vs bad compiler not good vs bad language.

The exciting part is when they tell you not to remove the unreachable code,
because the program crashes at runtime when you do that.
--scott

Re: BASIC (and Horizon)

<up9hd3$m75n$2@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33360&group=comp.os.vms#33360

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Tue, 30 Jan 2024 00:55:00 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <up9hd3$m75n$2@dont-email.me>
References: <up8qmo$ima5$1@dont-email.me> <up9eho$lqco$2@dont-email.me>
<up9h57$fmh$1@panix1.panix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 30 Jan 2024 00:55:00 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ba17ffef95be9ddc6f864a9afa7ca434";
logging-data="728247"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/gNYZxIzJSBbj6rkMeRful"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:VVfWctQAx528XxQJVtiB9K677Hw=
 by: Lawrence D'Oliv - Tue, 30 Jan 2024 00:55 UTC

On 30 Jan 2024 00:50:47 -0000, kludge wrote:

> Did you know that LISP has a goto?

Scheme doesn’t. It has continuations, which are a cool thing that can be
used to implement control structures, exceptions and coroutines, yet make
it quite difficult to express arbitrary gotos. Win-win, really.

Re: BASIC (and Horizon)

<up9hra$m85k$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33361&group=comp.os.vms#33361

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arne@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Mon, 29 Jan 2024 20:02:35 -0500
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <up9hra$m85k$1@dont-email.me>
References: <up8qmo$ima5$1@dont-email.me> <up9eho$lqco$2@dont-email.me>
<up9h57$fmh$1@panix1.panix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 30 Jan 2024 01:02:34 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="8fe35c34125a0cb85580234586c8ecf6";
logging-data="729268"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19178NuUqjJGa5x2r8szr+b6ScTkDcWH5s="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:XH2AxkZUD4AQ9OTbfKxchGRVoWY=
Content-Language: en-US
In-Reply-To: <up9h57$fmh$1@panix1.panix.com>
 by: Arne Vajhøj - Tue, 30 Jan 2024 01:02 UTC

On 1/29/2024 7:50 PM, kludge@panix.com wrote:
> =?UTF-8?Q?Arne_Vajh=C3=B8j?= <arne@vajhoej.dk> wrote:
>> The code is VB6.
>>
>> But none of the problems are Basic specific. It is possible
>> to write the same bad code in C or Fortran or whatever.
>>
>> So it just shows that there are some really really bad programmers out
>> there.
>
> I have worked with people who could write spaghetti Fortran in any
> programming language available.

"A real Fortran programmer can write Fortran in any language"

Every time this comes up I post this Fortran/Pascal code:

PROGRAM GOTOFUN(INPUT,OUTPUT);
LABEL L731,L113,L247,L588,L761,L922,L399,L601;
VAR LBL:INTEGER;
VAR I:INTEGER;
BEGIN
L731: GOTO L113;
LBL:=399;
L113: I:=0;
WRITELN(I);
L247: LBL:=601;
IF(I<0)THEN GOTO L588 ELSE IF(I=0)THEN GOTO L922 ELSE GOTO L399;
L588: I:=I+1;
WRITELN(I);
GOTO L399;
L761: CASE(LBL)OF 399: GOTO L399; 601: GOTO L601; END;
L922: I:=I+1;
WRITELN(I);
CASE(I)OF 1: GOTO L588; 2: GOTO L399; 3: GOTO L922; END;
L399: GOTO L761;
L601: END.

:-)

Arne

Re: BASIC (and Horizon)

<upa74a$t0ce$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33363&group=comp.os.vms#33363

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: davef@tsoft-inc.com (Dave Froble)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Tue, 30 Jan 2024 02:06:06 -0500
Organization: A noiseless patient Spider
Lines: 60
Message-ID: <upa74a$t0ce$1@dont-email.me>
References: <up8qmo$ima5$1@dont-email.me> <up9eho$lqco$2@dont-email.me>
<up9h57$fmh$1@panix1.panix.com> <up9hra$m85k$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 30 Jan 2024 07:05:46 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3b87bf6af81aeebc88c96e48bd2ac76f";
logging-data="950670"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1937duFXWOfNroAt++EV1LCQbjeNhEsMt4="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:f8SgAg9clblSHzO3fdGq1wsZ0kY=
In-Reply-To: <up9hra$m85k$1@dont-email.me>
 by: Dave Froble - Tue, 30 Jan 2024 07:06 UTC

On 1/29/2024 8:02 PM, Arne Vajhøj wrote:
> On 1/29/2024 7:50 PM, kludge@panix.com wrote:
>> =?UTF-8?Q?Arne_Vajh=C3=B8j?= <arne@vajhoej.dk> wrote:
>>> The code is VB6.
>>>
>>> But none of the problems are Basic specific. It is possible
>>> to write the same bad code in C or Fortran or whatever.
>>>
>>> So it just shows that there are some really really bad programmers out
>>> there.
>>
>> I have worked with people who could write spaghetti Fortran in any
>> programming language available.
>
> "A real Fortran programmer can write Fortran in any language"
>
> Every time this comes up I post this Fortran/Pascal code:
>
> PROGRAM GOTOFUN(INPUT,OUTPUT);
> LABEL L731,L113,L247,L588,L761,L922,L399,L601;
> VAR LBL:INTEGER;
> VAR I:INTEGER;
> BEGIN
> L731: GOTO L113;
> LBL:=399;
> L113: I:=0;
> WRITELN(I);
> L247: LBL:=601;
> IF(I<0)THEN GOTO L588 ELSE IF(I=0)THEN GOTO L922 ELSE GOTO L399;
> L588: I:=I+1;
> WRITELN(I);
> GOTO L399;
> L761: CASE(LBL)OF 399: GOTO L399; 601: GOTO L601; END;
> L922: I:=I+1;
> WRITELN(I);
> CASE(I)OF 1: GOTO L588; 2: GOTO L399; 3: GOTO L922; END;
> L399: GOTO L761;
> L601: END.
>
> :-)
>
> Arne
>

I'm amused every time the GoTo bashing begins.

Not only is there nothing wrong when using a branch operation, when appropriate,
just look at the assembler listings after compilation. Branching is just about
all assembler does, as required.

Now, I won't defend what I and most consider improper use of the poor
misunderstood GoTo statement.

--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486

Re: BASIC (and Horizon)

<upb1p2$10mt0$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33368&group=comp.os.vms#33368

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: news@cct-net.co.uk (Chris Townley)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Tue, 30 Jan 2024 14:40:34 +0000
Organization: A noiseless patient Spider
Lines: 65
Message-ID: <upb1p2$10mt0$1@dont-email.me>
References: <up8qmo$ima5$1@dont-email.me> <up9eho$lqco$2@dont-email.me>
<up9h57$fmh$1@panix1.panix.com> <up9hra$m85k$1@dont-email.me>
<upa74a$t0ce$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 30 Jan 2024 14:40:34 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c9a54ce62933f5788e49b45181278e5c";
logging-data="1072032"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/qpZ2rCDgBjMfsYfFPGI55DAGMeNskkjU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:K4G9pioE3TjUMngG3813XVo6EV0=
In-Reply-To: <upa74a$t0ce$1@dont-email.me>
Content-Language: en-GB
 by: Chris Townley - Tue, 30 Jan 2024 14:40 UTC

On 30/01/2024 07:06, Dave Froble wrote:
> On 1/29/2024 8:02 PM, Arne Vajhøj wrote:
>> On 1/29/2024 7:50 PM, kludge@panix.com wrote:
>>> =?UTF-8?Q?Arne_Vajh=C3=B8j?=  <arne@vajhoej.dk> wrote:
>>>> The code is VB6.
>>>>
>>>> But none of the problems are Basic specific. It is possible
>>>> to write the same bad code in C or Fortran or whatever.
>>>>
>>>> So it just shows that there are some really really bad programmers out
>>>> there.
>>>
>>> I have worked with people who could write spaghetti Fortran in any
>>> programming language available.
>>
>> "A real Fortran programmer can write Fortran in any language"
>>
>> Every time this comes up I post this Fortran/Pascal code:
>>
>>       PROGRAM GOTOFUN(INPUT,OUTPUT);
>>       LABEL L731,L113,L247,L588,L761,L922,L399,L601;
>>       VAR LBL:INTEGER;
>>       VAR I:INTEGER;
>>       BEGIN
>> L731: GOTO L113;
>>       LBL:=399;
>> L113: I:=0;
>>       WRITELN(I);
>> L247: LBL:=601;
>>       IF(I<0)THEN GOTO L588 ELSE IF(I=0)THEN GOTO L922 ELSE GOTO L399;
>> L588: I:=I+1;
>>       WRITELN(I);
>>       GOTO L399;
>> L761: CASE(LBL)OF 399: GOTO L399; 601: GOTO L601; END;
>> L922: I:=I+1;
>>       WRITELN(I);
>>       CASE(I)OF 1: GOTO L588; 2: GOTO L399; 3: GOTO L922; END;
>> L399: GOTO L761;
>> L601: END.
>>
>> :-)
>>
>> Arne
>>
>
> I'm amused every time the GoTo bashing begins.
>
> Not only is there nothing wrong when using a branch operation, when
> appropriate, just look at the assembler listings after compilation.
> Branching is just about all assembler does, as required.
>
> Now, I won't defend what I and most consider improper use of the poor
> misunderstood GoTo statement.
>

But unless used very carefully, it can create horrible spaghetti like
code, and is also easy to screw up.

Using proper structured constructs is much better - easier to read as
well, hence better maintainability.

--
Chris

Re: BASIC (and Horizon)

<l1sne0Fi5hqU2@mid.individual.net>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33371&group=comp.os.vms#33371

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: bill.gunshannon@gmail.com (bill)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Tue, 30 Jan 2024 11:45:43 -0500
Lines: 29
Message-ID: <l1sne0Fi5hqU2@mid.individual.net>
References: <up8qmo$ima5$1@dont-email.me> <up9eho$lqco$2@dont-email.me>
<up9h57$fmh$1@panix1.panix.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net FPryKE31iaG/OtakFjelVQGxHJfkOAsRLaMcgV5dbFclDkggNq
Cancel-Lock: sha1:TG4TLdHWdb57ct6WglWKmOiAtGc= sha256:OedjjVi02akxnsezNgj7tV+u9m8bzkqE5+0Nu2bn1QI=
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <up9h57$fmh$1@panix1.panix.com>
 by: bill - Tue, 30 Jan 2024 16:45 UTC

On 1/29/2024 7:50 PM, kludge@panix.com wrote:
> =?UTF-8?Q?Arne_Vajh=C3=B8j?= <arne@vajhoej.dk> wrote:
>> The code is VB6.
>>
>> But none of the problems are Basic specific. It is possible
>> to write the same bad code in C or Fortran or whatever.
>>
>> So it just shows that there are some really really bad programmers out
>> there.
>
> I have worked with people who could write spaghetti Fortran in any
> programming language available. Did you know that LISP has a goto?
> It does.
>
>> PS: Good compilers may have detected the unreachable code. But it
>> is still good vs bad compiler not good vs bad language.
>
> The exciting part is when they tell you not to remove the unreachable code,
> because the program crashes at runtime when you do that.

Many moons ago I had to try to fix a number of programs that
crashed whenever run. Back in those days a common method was
to add statements to display variables during execution. I
had many cases where adding those statements made the program
work.

bill

Re: BASIC (and Horizon)

<upbape$10laf$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33373&group=comp.os.vms#33373

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: news@cct-net.co.uk (Chris Townley)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Tue, 30 Jan 2024 17:14:21 +0000
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <upbape$10laf$1@dont-email.me>
References: <up8qmo$ima5$1@dont-email.me> <up9eho$lqco$2@dont-email.me>
<up9h57$fmh$1@panix1.panix.com> <l1sne0Fi5hqU2@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 30 Jan 2024 17:14:22 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c9a54ce62933f5788e49b45181278e5c";
logging-data="1070415"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+lQMDf9kteMYRkVNvhjDYmGreWf47wrtk="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:XzCgf9HvN52ji+m2CPdMLGwsydo=
In-Reply-To: <l1sne0Fi5hqU2@mid.individual.net>
Content-Language: en-GB
 by: Chris Townley - Tue, 30 Jan 2024 17:14 UTC

On 30/01/2024 16:45, bill wrote:
> On 1/29/2024 7:50 PM, kludge@panix.com wrote:
>> =?UTF-8?Q?Arne_Vajh=C3=B8j?=  <arne@vajhoej.dk> wrote:
>>> The code is VB6.
>>>
>>> But none of the problems are Basic specific. It is possible
>>> to write the same bad code in C or Fortran or whatever.
>>>
>>> So it just shows that there are some really really bad programmers out
>>> there.
>>
>> I have worked with people who could write spaghetti Fortran in any
>> programming language available.  Did you know that LISP has a goto?
>> It does.
>>
>>> PS: Good compilers may have detected the unreachable code. But it
>>>      is still good vs bad compiler not good vs bad language.
>>
>> The exciting part is when they tell you not to remove the unreachable
>> code,
>> because the program crashes at runtime when you do that.
>
> Many moons ago I had to try to fix a number of programs that
> crashed whenever run.  Back in those days a common method was
> to add statements to display variables during execution.  I
> had many cases where adding those statements made the program
> work.
>
> bill

Could it have been the variables were being incorrectly being optimised
out, but adding a print statement would avoid that. I have seen that a
few times

--
Chris

Re: BASIC (and Horizon)

<l1spncFi5hpU2@mid.individual.net>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33374&group=comp.os.vms#33374

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!nntp.comgw.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: bill.gunshannon@gmail.com (bill)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Tue, 30 Jan 2024 12:24:51 -0500
Lines: 43
Message-ID: <l1spncFi5hpU2@mid.individual.net>
References: <up8qmo$ima5$1@dont-email.me> <up9eho$lqco$2@dont-email.me>
<up9h57$fmh$1@panix1.panix.com> <l1sne0Fi5hqU2@mid.individual.net>
<upbape$10laf$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net 8cVfOOQblBgNHxKaCAkJBQ6sOzbmwP+oUezgHthgvj6EIzQFPB
Cancel-Lock: sha1:AJCdKjT3Sxq5S4pF/m2H4td1JXw= sha256:E640C2Aqkn4zL+MQcPZtXqZTGvhkm/aot+S3eIued9Y=
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <upbape$10laf$1@dont-email.me>
 by: bill - Tue, 30 Jan 2024 17:24 UTC

On 1/30/2024 12:14 PM, Chris Townley wrote:
> On 30/01/2024 16:45, bill wrote:
>> On 1/29/2024 7:50 PM, kludge@panix.com wrote:
>>> =?UTF-8?Q?Arne_Vajh=C3=B8j?=  <arne@vajhoej.dk> wrote:
>>>> The code is VB6.
>>>>
>>>> But none of the problems are Basic specific. It is possible
>>>> to write the same bad code in C or Fortran or whatever.
>>>>
>>>> So it just shows that there are some really really bad programmers out
>>>> there.
>>>
>>> I have worked with people who could write spaghetti Fortran in any
>>> programming language available.  Did you know that LISP has a goto?
>>> It does.
>>>
>>>> PS: Good compilers may have detected the unreachable code. But it
>>>>      is still good vs bad compiler not good vs bad language.
>>>
>>> The exciting part is when they tell you not to remove the unreachable
>>> code,
>>> because the program crashes at runtime when you do that.
>>
>> Many moons ago I had to try to fix a number of programs that
>> crashed whenever run.  Back in those days a common method was
>> to add statements to display variables during execution.  I
>> had many cases where adding those statements made the program
>> work.
>>
>> bill
>
> Could it have been the variables were being incorrectly being optimised
> out, but adding a print statement would avoid that. I have seen that a
> few times
>

Usually it had to do with out of range access. Adding the displays
enlarged the I Area changing the location being accessed. Didn't
fix the program but made it run enough to troubleshoot once you knew
what the problem probably was.

bill

Re: BASIC (and Horizon)

<upc27a$16rqi$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33377&group=comp.os.vms#33377

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arne@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Tue, 30 Jan 2024 18:54:17 -0500
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <upc27a$16rqi$1@dont-email.me>
References: <up8qmo$ima5$1@dont-email.me> <up9eho$lqco$2@dont-email.me>
<up9h57$fmh$1@panix1.panix.com> <up9hra$m85k$1@dont-email.me>
<upa74a$t0ce$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 30 Jan 2024 23:54:18 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2a64d8f6ae6973267bcb42c81335e468";
logging-data="1273682"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX181F+3J+/R8k7dp8D+Orn6jbcvMLO+uOg0="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:zwZbSwSxyVBTc4toa5T5yi/wcTU=
In-Reply-To: <upa74a$t0ce$1@dont-email.me>
Content-Language: en-US
 by: Arne Vajhøj - Tue, 30 Jan 2024 23:54 UTC

On 1/30/2024 2:06 AM, Dave Froble wrote:
> On 1/29/2024 8:02 PM, Arne Vajhøj wrote:
>> On 1/29/2024 7:50 PM, kludge@panix.com wrote:
>>> I have worked with people who could write spaghetti Fortran in any
>>> programming language available.
>>
>> "A real Fortran programmer can write Fortran in any language"
>>
>> Every time this comes up I post this Fortran/Pascal code:
>>
>>       PROGRAM GOTOFUN(INPUT,OUTPUT);

> I'm amused every time the GoTo bashing begins.
>
> Not only is there nothing wrong when using a branch operation, when
> appropriate, just look at the assembler listings after compilation.
> Branching is just about all assembler does, as required.
>
> Now, I won't defend what I and most consider improper use of the poor
> misunderstood GoTo statement.

The IT world 50-60 years ago had a GoTo problem.

The lack of structured constructs in assembler, Fortran 66,
original Dartmouth Basic etc. had resulted in a lot of
spaghetti code.

And as a result GoTo got a very bad reputation.

The IT world today does not have a GoTo problem.

Many languages does not support GoTo, but even in the languages
that do support GoTo it is typical not a common construct.

There are actual cases where GoTo (goto in case sensitive languages)
can result in more readable code than the structured approach.

In languages without exception support then a goto down to
cleanup code can be very readable.

In languages without labeled break then a goto out of an
inner loop can be very readable.

Arne

Re: BASIC (and Horizon)

<upc3g9$7r6$1@panix2.panix.com>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33379&group=comp.os.vms#33379

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.panix2.panix.com!panix2.panix.com!not-for-mail
From: kludge@panix.com (Scott Dorsey)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: 31 Jan 2024 00:16:09 -0000
Organization: Former users of Netcom shell (1989-2000)
Lines: 13
Message-ID: <upc3g9$7r6$1@panix2.panix.com>
References: <up8qmo$ima5$1@dont-email.me> <up9eho$lqco$2@dont-email.me> <up9h57$fmh$1@panix1.panix.com> <l1sne0Fi5hqU2@mid.individual.net>
Injection-Info: reader1.panix.com; posting-host="panix2.panix.com:166.84.1.2";
logging-data="6560"; mail-complaints-to="abuse@panix.com"
 by: Scott Dorsey - Wed, 31 Jan 2024 00:16 UTC

bill <bill.gunshannon@gmail.com> wrote:
>Many moons ago I had to try to fix a number of programs that
>crashed whenever run. Back in those days a common method was
>to add statements to display variables during execution. I
>had many cases where adding those statements made the program
>work.

Yes, this is a sign of a fandango on core. In Fortran it is
likely exceeding array bounds or bad parameter passing, but in
C the possibilities to screw up with pointers are endless.
--scott
--
"C'est un Nagra. C'est suisse, et tres, tres precis."

Re: BASIC (and Horizon)

<l1tllhFi5hqU3@mid.individual.net>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33380&group=comp.os.vms#33380

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: bill.gunshannon@gmail.com (bill)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Tue, 30 Jan 2024 20:21:43 -0500
Lines: 24
Message-ID: <l1tllhFi5hqU3@mid.individual.net>
References: <up8qmo$ima5$1@dont-email.me> <up9eho$lqco$2@dont-email.me>
<up9h57$fmh$1@panix1.panix.com> <l1sne0Fi5hqU2@mid.individual.net>
<upc3g9$7r6$1@panix2.panix.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net a4t/OIzX04hZoilNKRs6gANHrotAj6LioF1uoyBF1rKAam3dZW
Cancel-Lock: sha1:2aInlLOP1MI6nsJlhF7KJt98uSg= sha256:0XVTXny079x9BgQfworV1KK0SVEoQ1msl4qMZjrgZcc=
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <upc3g9$7r6$1@panix2.panix.com>
 by: bill - Wed, 31 Jan 2024 01:21 UTC

On 1/30/2024 7:16 PM, Scott Dorsey wrote:
> bill <bill.gunshannon@gmail.com> wrote:
>> Many moons ago I had to try to fix a number of programs that
>> crashed whenever run. Back in those days a common method was
>> to add statements to display variables during execution. I
>> had many cases where adding those statements made the program
>> work.
>
> Yes, this is a sign of a fandango on core. In Fortran it is
> likely exceeding array bounds or bad parameter passing, but in
> C the possibilities to screw up with pointers are endless.

Bingo!!!

It was mostly Fortran but every once in a while some idiot
would do it in COBOL, too.

By the way, the Fortran was what you get when you have Electrical
and Mechanical engineers with too much time on their hands and you
decide to keep them busy by making them write business programs.

bill

Re: BASIC (and Horizon)

<upci9g$1cmn1$2@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33382&group=comp.os.vms#33382

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: davef@tsoft-inc.com (Dave Froble)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Tue, 30 Jan 2024 23:28:53 -0500
Organization: A noiseless patient Spider
Lines: 73
Message-ID: <upci9g$1cmn1$2@dont-email.me>
References: <up8qmo$ima5$1@dont-email.me> <up9eho$lqco$2@dont-email.me>
<up9h57$fmh$1@panix1.panix.com> <up9hra$m85k$1@dont-email.me>
<upa74a$t0ce$1@dont-email.me> <upb1p2$10mt0$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 31 Jan 2024 04:28:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3ac796c2f047dc4bec593e89ee014c13";
logging-data="1465057"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18/zPZdKMBsfYgLvDIHhZCARilCpkCT3Pg="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:2pz5gt5jBF+Y5BORXOZI6ZrmuSk=
In-Reply-To: <upb1p2$10mt0$1@dont-email.me>
 by: Dave Froble - Wed, 31 Jan 2024 04:28 UTC

On 1/30/2024 9:40 AM, Chris Townley wrote:
> On 30/01/2024 07:06, Dave Froble wrote:
>> On 1/29/2024 8:02 PM, Arne Vajhøj wrote:
>>> On 1/29/2024 7:50 PM, kludge@panix.com wrote:
>>>> =?UTF-8?Q?Arne_Vajh=C3=B8j?= <arne@vajhoej.dk> wrote:
>>>>> The code is VB6.
>>>>>
>>>>> But none of the problems are Basic specific. It is possible
>>>>> to write the same bad code in C or Fortran or whatever.
>>>>>
>>>>> So it just shows that there are some really really bad programmers out
>>>>> there.
>>>>
>>>> I have worked with people who could write spaghetti Fortran in any
>>>> programming language available.
>>>
>>> "A real Fortran programmer can write Fortran in any language"
>>>
>>> Every time this comes up I post this Fortran/Pascal code:
>>>
>>> PROGRAM GOTOFUN(INPUT,OUTPUT);
>>> LABEL L731,L113,L247,L588,L761,L922,L399,L601;
>>> VAR LBL:INTEGER;
>>> VAR I:INTEGER;
>>> BEGIN
>>> L731: GOTO L113;
>>> LBL:=399;
>>> L113: I:=0;
>>> WRITELN(I);
>>> L247: LBL:=601;
>>> IF(I<0)THEN GOTO L588 ELSE IF(I=0)THEN GOTO L922 ELSE GOTO L399;
>>> L588: I:=I+1;
>>> WRITELN(I);
>>> GOTO L399;
>>> L761: CASE(LBL)OF 399: GOTO L399; 601: GOTO L601; END;
>>> L922: I:=I+1;
>>> WRITELN(I);
>>> CASE(I)OF 1: GOTO L588; 2: GOTO L399; 3: GOTO L922; END;
>>> L399: GOTO L761;
>>> L601: END.
>>>
>>> :-)
>>>
>>> Arne
>>>
>>
>> I'm amused every time the GoTo bashing begins.
>>
>> Not only is there nothing wrong when using a branch operation, when
>> appropriate, just look at the assembler listings after compilation. Branching
>> is just about all assembler does, as required.
>>
>> Now, I won't defend what I and most consider improper use of the poor
>> misunderstood GoTo statement.
>>
>
> But unless used very carefully, it can create horrible spaghetti like code, and
> is also easy to screw up.
>
> Using proper structured constructs is much better - easier to read as well,
> hence better maintainability.
>
>

Prey tell, what structured construct will perform cleanup and exit? I always
expected a return from routines and such.

--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486

Re: BASIC (and Horizon)

<l1ujm7Ff0eoU5@mid.individual.net>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33383&group=comp.os.vms#33383

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!news.chmurka.net!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: news0009@eager.cx (Bob Eager)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: 31 Jan 2024 09:54:15 GMT
Lines: 25
Message-ID: <l1ujm7Ff0eoU5@mid.individual.net>
References: <up8qmo$ima5$1@dont-email.me> <up9eho$lqco$2@dont-email.me>
<up9h57$fmh$1@panix1.panix.com> <l1sne0Fi5hqU2@mid.individual.net>
<upc3g9$7r6$1@panix2.panix.com> <l1tllhFi5hqU3@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net mhGl9TEZbURQ3zAiywd6zARqiDkiJ+zdprZ10gVpPTnNs/0nXT
Cancel-Lock: sha1:fRYqgUW1kcTrmIcHMDalrK4bA2I= sha256:z6h1ucx65E50IjySZaoxOhdGhSzwQMvdegK+k2BmQpM=
User-Agent: Pan/0.145 (Duplicitous mercenary valetism; d7e168a
git.gnome.org/pan2)
 by: Bob Eager - Wed, 31 Jan 2024 09:54 UTC

On Tue, 30 Jan 2024 20:21:43 -0500, bill wrote:

> On 1/30/2024 7:16 PM, Scott Dorsey wrote:
>> bill <bill.gunshannon@gmail.com> wrote:
>>> Many moons ago I had to try to fix a number of programs that crashed
>>> whenever run. Back in those days a common method was to add
>>> statements to display variables during execution. I had many cases
>>> where adding those statements made the program work.
>>
>> Yes, this is a sign of a fandango on core. In Fortran it is likely
>> exceeding array bounds or bad parameter passing, but in C the
>> possibilities to screw up with pointers are endless.
>
> Bingo!!!
>
> It was mostly Fortran but every once in a while some idiot would do it
> in COBOL, too.

We had a machine that ran FORTRAN for the physics department. One guy had
a program that crashed the machine. As in, the microcode halted. That was
an array bounds error.

Full story:

http://www.bobeager.uk/anecdotes.html#hwhack

Re: BASIC (and Horizon)

<updcv8$1frdh$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33385&group=comp.os.vms#33385

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: news@cct-net.co.uk (Chris Townley)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Wed, 31 Jan 2024 12:03:51 +0000
Organization: A noiseless patient Spider
Lines: 78
Message-ID: <updcv8$1frdh$1@dont-email.me>
References: <up8qmo$ima5$1@dont-email.me> <up9eho$lqco$2@dont-email.me>
<up9h57$fmh$1@panix1.panix.com> <up9hra$m85k$1@dont-email.me>
<upa74a$t0ce$1@dont-email.me> <upb1p2$10mt0$1@dont-email.me>
<upci9g$1cmn1$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 31 Jan 2024 12:03:52 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="919fab9bf8ff6f13538f36031348dbda";
logging-data="1568177"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Cvug926Uga27vJKV+XYfgXXuYt449RR8="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:/bvF6jE0+Hg7NJe8XY9Nw461qJQ=
In-Reply-To: <upci9g$1cmn1$2@dont-email.me>
Content-Language: en-GB
 by: Chris Townley - Wed, 31 Jan 2024 12:03 UTC

On 31/01/2024 04:28, Dave Froble wrote:
> On 1/30/2024 9:40 AM, Chris Townley wrote:
>> On 30/01/2024 07:06, Dave Froble wrote:
>>> On 1/29/2024 8:02 PM, Arne Vajhøj wrote:
>>>> On 1/29/2024 7:50 PM, kludge@panix.com wrote:
>>>>> =?UTF-8?Q?Arne_Vajh=C3=B8j?=  <arne@vajhoej.dk> wrote:
>>>>>> The code is VB6.
>>>>>>
>>>>>> But none of the problems are Basic specific. It is possible
>>>>>> to write the same bad code in C or Fortran or whatever.
>>>>>>
>>>>>> So it just shows that there are some really really bad programmers
>>>>>> out
>>>>>> there.
>>>>>
>>>>> I have worked with people who could write spaghetti Fortran in any
>>>>> programming language available.
>>>>
>>>> "A real Fortran programmer can write Fortran in any language"
>>>>
>>>> Every time this comes up I post this Fortran/Pascal code:
>>>>
>>>>       PROGRAM GOTOFUN(INPUT,OUTPUT);
>>>>       LABEL L731,L113,L247,L588,L761,L922,L399,L601;
>>>>       VAR LBL:INTEGER;
>>>>       VAR I:INTEGER;
>>>>       BEGIN
>>>> L731: GOTO L113;
>>>>       LBL:=399;
>>>> L113: I:=0;
>>>>       WRITELN(I);
>>>> L247: LBL:=601;
>>>>       IF(I<0)THEN GOTO L588 ELSE IF(I=0)THEN GOTO L922 ELSE GOTO L399;
>>>> L588: I:=I+1;
>>>>       WRITELN(I);
>>>>       GOTO L399;
>>>> L761: CASE(LBL)OF 399: GOTO L399; 601: GOTO L601; END;
>>>> L922: I:=I+1;
>>>>       WRITELN(I);
>>>>       CASE(I)OF 1: GOTO L588; 2: GOTO L399; 3: GOTO L922; END;
>>>> L399: GOTO L761;
>>>> L601: END.
>>>>
>>>> :-)
>>>>
>>>> Arne
>>>>
>>>
>>> I'm amused every time the GoTo bashing begins.
>>>
>>> Not only is there nothing wrong when using a branch operation, when
>>> appropriate, just look at the assembler listings after compilation.
>>> Branching
>>> is just about all assembler does, as required.
>>>
>>> Now, I won't defend what I and most consider improper use of the poor
>>> misunderstood GoTo statement.
>>>
>>
>> But unless used very carefully, it can create horrible spaghetti like
>> code, and
>> is also easy to screw up.
>>
>> Using proper structured constructs is much better - easier to read as
>> well,
>> hence better maintainability.
>>
>>
>
> Prey tell, what structured construct will perform cleanup and exit?  I
> always expected a return from routines and such.
>

It would depend on what is needing to be done

--
Chris

Re: BASIC (and Horizon)

<20240131155230.00000457@yahoo.com>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33386&group=comp.os.vms#33386

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: already5chosen@yahoo.com (Michael S)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Wed, 31 Jan 2024 15:52:30 +0200
Organization: A noiseless patient Spider
Lines: 65
Message-ID: <20240131155230.00000457@yahoo.com>
References: <up8qmo$ima5$1@dont-email.me>
<up9eho$lqco$2@dont-email.me>
<up9h57$fmh$1@panix1.panix.com>
<up9hra$m85k$1@dont-email.me>
<upa74a$t0ce$1@dont-email.me>
<upb1p2$10mt0$1@dont-email.me>
<upci9g$1cmn1$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Injection-Info: dont-email.me; posting-host="dde7e6588c421492c1bae181782363df";
logging-data="1612964"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19yO+fxrd1jOwc9GIwlVwJQkzgaxlF9/FI="
Cancel-Lock: sha1:JJtrqIQFTxSePAVyRTEdQSH4vAE=
X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
 by: Michael S - Wed, 31 Jan 2024 13:52 UTC

On Tue, 30 Jan 2024 23:28:53 -0500
Dave Froble <davef@tsoft-inc.com> wrote:

>
> Prey tell, what structured construct will perform cleanup and exit?
> I always expected a return from routines and such.
>

One option is named construct and named break.
Example below is from Go (golang) tutorial. Ada has something very
similar.

Loop:
for n := 0; n < len(src); n += size {
switch {
case src[n] < sizeOne:
if validateOnly {
break
}
size = 1
update(src[n])

case src[n] < sizeTwo:
if n+1 >= len(src) {
err = errShortInput
break Loop
}
if validateOnly {
break
}
size = 2
update(src[n] + src[n+1]<<shift)
}
}

Another option is defer clause.
From the same tutorial:

// Contents returns the file's contents as a string.
func Contents(filename string) (string, error) {
f, err := os.Open(filename)
if err != nil {
return "", err
}
defer f.Close() // f.Close will run when we're finished.

var result []byte
buf := make([]byte, 100)
for {
n, err := f.Read(buf[0:])
result = append(result, buf[0:n]...) // append is discussed
later. if err != nil {
if err == io.EOF {
break
}
return "", err // f will be closed if we return here.
}
}
return string(result), nil // f will be closed if we return here.
}

The third option, the one I like least (an understatement) is use of
exceptions. Despite my personal preferences, it's quite popular.

Re: BASIC (and Horizon)

<updog4$1itf7$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33387&group=comp.os.vms#33387

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arne@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Wed, 31 Jan 2024 10:20:35 -0500
Organization: A noiseless patient Spider
Lines: 227
Message-ID: <updog4$1itf7$1@dont-email.me>
References: <up8qmo$ima5$1@dont-email.me> <up9eho$lqco$2@dont-email.me>
<up9h57$fmh$1@panix1.panix.com> <up9hra$m85k$1@dont-email.me>
<upa74a$t0ce$1@dont-email.me> <upb1p2$10mt0$1@dont-email.me>
<upci9g$1cmn1$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 31 Jan 2024 15:20:37 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2a64d8f6ae6973267bcb42c81335e468";
logging-data="1668583"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX196QB/PnZWp+DR/IsNo2fmdrXIfn2MZPhQ="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:RzzwIktKdAw6rUS0tT00ZgBFo8U=
Content-Language: en-US
In-Reply-To: <upci9g$1cmn1$2@dont-email.me>
 by: Arne Vajhøj - Wed, 31 Jan 2024 15:20 UTC

On 1/30/2024 11:28 PM, Dave Froble wrote:
> On 1/30/2024 9:40 AM, Chris Townley wrote:
>> On 30/01/2024 07:06, Dave Froble wrote:
>>> I'm amused every time the GoTo bashing begins.
>>>
>>> Not only is there nothing wrong when using a branch operation, when
>>> appropriate, just look at the assembler listings after compilation.
>>> Branching
>>> is just about all assembler does, as required.
>>>
>>> Now, I won't defend what I and most consider improper use of the poor
>>> misunderstood GoTo statement.
>>>
>>
>> But unless used very carefully, it can create horrible spaghetti like
>> code, and
>> is also easy to screw up.
>>
>> Using proper structured constructs is much better - easier to read as
>> well,
>> hence better maintainability.
>
> Prey tell, what structured construct will perform cleanup and exit?  I
> always expected a return from routines and such.

Let me try and show some examples.

In VB.NET.

Te first two examples could be done in VMS Basic (obviously
procedural not object oriented) but the last can not.

First with goto:

Imports System

Namespace GoToDemo
Public NotInheritable Class Luck
Private Shared rng As New Random()
Public Shared Function InLuck() As Boolean
Return rng.NextDouble() > 0.2
End Function
End Class
Public Class X
Private id As String
Private Sub New(id As String)
Me.id = id
Console.WriteLine("X {0} created", id)
End Sub
Public Shared Function Create(id As String) As X
If Luck.InLuck() Then
Return New X(id)
Else
Return Nothing
End If
End Function
Public Sub Close()
Console.WriteLine("X {0} closed", id)
End Sub
End Class
Public Class Program
Public Shared Sub Main(args As String())
Dim o1 As X = X.Create("A")
If o1 Is Nothing Then
Console.WriteLine("Error creating A")
GoTo lbl_done
End If
Dim o2 As X = X.Create("B")
If o2 Is Nothing Then
Console.WriteLine("Error creating B")
GoTo lbl_close1
End If
' 20 lines
Console.WriteLine("Part 1")
If Not Luck.InLuck() Then
Console.WriteLine("Error during execution")
GoTo lbl_close2
End If
' 20 lines
Console.WriteLine("Part 2")
lbl_close2:
o2.Close()
lbl_close1:
o1.Close()
lbl_done:
Console.ReadKey(True)
End Sub
End Class
End Namespace

It is with goto, but I don't think it is a bad use of goto. It just
jumps down to the cleanup code in case of an error.

Next traditional blocks:

Imports System

Namespace BlocksDemo
Public NotInheritable Class Luck
Private Shared rng As New Random()
Public Shared Function InLuck() As Boolean
Return rng.NextDouble() > 0.2
End Function
End Class
Public Class X
Private id As String
Private Sub New(id As String)
Me.id = id
Console.WriteLine("X {0} created", id)
End Sub
Public Shared Function Create(id As String) As X
If Luck.InLuck() Then
Return New X(id)
Else
Return Nothing
End If
End Function
Public Sub Close()
Console.WriteLine("X {0} closed", id)
End Sub
End Class
Public Class Program
Public Shared Sub Main(args As String())
Dim o1 As X = X.Create("A")
If o1 IsNot Nothing Then
Dim o2 As X = X.Create("B")
If o2 IsNot Nothing Then
' 20 lines
Console.WriteLine("Part 1")
If Luck.InLuck() Then
' 20 lines
Console.WriteLine("Part 2")
Else
Console.WriteLine("Error during execution")
End If
o2.Close()
Else
Console.WriteLine("Error creating B")
End If
o1.Close()
Else
Console.WriteLine("Error creating A")
End If
Console.ReadKey(True)
End Sub
End Class
End Namespace

No goto's. But I do not consider the code more readable than the
version with goto's. It sort of unnecessarily stretch out the
core logic.

And now the modern way with exceptions:

Imports System

Namespace ExceptionsDemo
Public NotInheritable Class Luck
Private Shared rng As New Random()
Public Shared Function InLuck() As Boolean
Return rng.NextDouble() > 0.2
End Function
End Class
Public Class XException
Inherits Exception
Public Sub New(msg As String)
MyBase.New(msg)
End Sub
End Class
Public Class X
Implements IDisposable
Private id As String
Public Sub New(id As String)
If Luck.InLuck() Then
Me.id = id
Console.WriteLine("X {0} created", id)
Else
Throw New XException("Error creating " & id)
End If
End Sub
Public Sub Dispose() Implements IDisposable.Dispose
Console.WriteLine("X {0} closed", id)
End Sub
End Class
Public Class Program
Public Shared Sub Main(args As String())
Try
Using o1 As New X("A")
Using o2 As New X("B")
' 20 lines
Console.WriteLine("Part 1")
If Not Luck.InLuck() Then
Throw New XException("Error during execution")
End If
' 20 lines
Console.WriteLine("Part 2")
End Using
End Using
Catch ex As XException
Console.WriteLine(ex.Message)
End Try
Console.ReadKey(True)
End Sub
End Class
End Namespace

Which I think is pretty nice. No goto's but still a compact
core logic.

For the not VB.NET knowledgable:

Using o1 As New X("A")
...
End Using

calls o1.Dispose() when the block is exited no matter how it
is exited - normal or exception does not matter Dispose is
always called.

Arne

Re: BASIC (and Horizon)

<updr42$1jcmi$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33388&group=comp.os.vms#33388

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: seaohveh@hoffmanlabs.invalid (Stephen Hoffman)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Wed, 31 Jan 2024 11:05:22 -0500
Organization: HoffmanLabs LLC
Lines: 105
Message-ID: <updr42$1jcmi$1@dont-email.me>
References: <up8qmo$ima5$1@dont-email.me> <up9eho$lqco$2@dont-email.me> <up9h57$fmh$1@panix1.panix.com> <up9hra$m85k$1@dont-email.me> <upa74a$t0ce$1@dont-email.me> <upb1p2$10mt0$1@dont-email.me> <upci9g$1cmn1$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="ab1e5a197bc335510ff1ed62e3b9b8f3";
logging-data="1684178"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/bwHXJv5xv0cdH660dYroYMYo0dyVqaRQ="
User-Agent: Unison/2.2
Cancel-Lock: sha1:CWcOvKYvo4gzf+QR/lko0cT37wU=
 by: Stephen Hoffman - Wed, 31 Jan 2024 16:05 UTC

On 2024-01-31 04:28:53 +0000, Dave Froble said:

> On 1/30/2024 9:40 AM, Chris Townley wrote:
>> On 30/01/2024 07:06, Dave Froble wrote:
>>> On 1/29/2024 8:02 PM, Arne Vajhøj wrote:
>>>> On 1/29/2024 7:50 PM, kludge@panix.com wrote:
>>>>> =?UTF-8?Q?Arne_Vajh=C3=B8j?= <arne@vajhoej.dk> wrote:
>>>>>> The code is VB6.
>>>>>>
>>>>>> But none of the problems are Basic specific. It is possible
>>>>>> to write the same bad code in C or Fortran or whatever.
>>>>>>
>>>>>> So it just shows that there are some really really bad programmers out
>>>>>> there.
>>>>>
>>>>> I have worked with people who could write spaghetti Fortran in any
>>>>> programming language available.
>>>>
>>>> "A real Fortran programmer can write Fortran in any language"
>>>>
>>>> Every time this comes up I post this Fortran/Pascal code:
>>>>
>>>> PROGRAM GOTOFUN(INPUT,OUTPUT);
>>>> LABEL L731,L113,L247,L588,L761,L922,L399,L601;
>>>> VAR LBL:INTEGER;
>>>> VAR I:INTEGER;
>>>> BEGIN
>>>> L731: GOTO L113;
>>>> LBL:=399;
>>>> L113: I:=0;
>>>> WRITELN(I);
>>>> L247: LBL:=601;
>>>> IF(I<0)THEN GOTO L588 ELSE IF(I=0)THEN GOTO L922 ELSE GOTO L399;
>>>> L588: I:=I+1;
>>>> WRITELN(I);
>>>> GOTO L399;
>>>> L761: CASE(LBL)OF 399: GOTO L399; 601: GOTO L601; END;
>>>> L922: I:=I+1;
>>>> WRITELN(I);
>>>> CASE(I)OF 1: GOTO L588; 2: GOTO L399; 3: GOTO L922; END;
>>>> L399: GOTO L761;
>>>> L601: END.
>>>>
>>>> :-)
>>>>
>>>> Arne
>>>>
>>>
>>> I'm amused every time the GoTo bashing begins.
>>>
>>> Not only is there nothing wrong when using a branch operation, when
>>> appropriate, just look at the assembler listings after compilation. Branching
>>> is just about all assembler does, as required.
>>>
>>> Now, I won't defend what I and most consider improper use of the poor
>>> misunderstood GoTo statement.
>>>
>>
>> But unless used very carefully, it can create horrible spaghetti like code, and
>> is also easy to screw up.
>>
>> Using proper structured constructs is much better - easier to read as well,
>> hence better maintainability.
>>
>
> Prey tell, what structured construct will perform cleanup and exit? I
> always expected a return from routines and such.

BASIC has its own variation on the classic TRY / THROW / CATCH /
FINALLY syntax:
WHEN ERROR IN
protected-statement [protected-statement,...]
USE
handler-statement [handler-statement,...]
END WHEN

But I'm mildly surprised it's lacking an ATEXIT or ilk. (I thought it
had that now, but I'm clearly mis-remembering.) I've used $dclexh and
ilk in various apps, or coded the app to release at rundown. (Not that
I prefer to have to implement manual cleanup, much as I'd like to avoid
explicitly deallocating memory in C. Garbage collection is so much
nicer, outside of kernel mode or other special app or context
requirements.)
Classic BASIC, Fortran, and C tend to be pretty bad at this
error-handling stuff (it's kinda been grafted on) without a fair amount
of work by the developer, and quite possibly with platform-specific
calls ($dclexh, etc) added. (Yes, I know about setjmp, atexit(), etc.
in C, and some other error-related syntax.) And yes, in BASIC, that
GOTO is one of the common ways to deal with errors, but I'd usually go
WHEN ERROR IN where I can. Or whatever other TRY / THROW / CATCH /
FINALLY / ATEXIT exists in the particular implementation.

And as for that earlier BASIC line number gibe, I'm sure most folks
working with BASIC on OpenVMS nowadays are using labels, as the labels
are just vastly more descriptive.

I've long thought this: "If the ERR function is used before an error
occurs or after an error is handled, the results are undefined" was
silly. UB? Seriously? Return some analog to SS$_NORMAL. Poof. No UB.

--
Pure Personal Opinion | HoffmanLabs LLC

Re: BASIC (and Horizon)

<updrqb$1q$1@panix2.panix.com>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33389&group=comp.os.vms#33389

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.panix2.panix.com!panix2.panix.com!not-for-mail
From: kludge@panix.com (Scott Dorsey)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: 31 Jan 2024 16:17:15 -0000
Organization: Former users of Netcom shell (1989-2000)
Lines: 14
Message-ID: <updrqb$1q$1@panix2.panix.com>
References: <up8qmo$ima5$1@dont-email.me> <upb1p2$10mt0$1@dont-email.me> <upci9g$1cmn1$2@dont-email.me> <20240131155230.00000457@yahoo.com>
Injection-Info: reader1.panix.com; posting-host="panix2.panix.com:166.84.1.2";
logging-data="6986"; mail-complaints-to="abuse@panix.com"
 by: Scott Dorsey - Wed, 31 Jan 2024 16:17 UTC

Michael S <already5chosen@yahoo.com> wrote:
>
>The third option, the one I like least (an understatement) is use of
>exceptions. Despite my personal preferences, it's quite popular.

Exceptions can be very elegant or very inelegant... and it is entirely
possible to have an exception that doesn't clean anything up at all and
just exits and lets the operating system deal with the memory. On many
systems this is a great idea because being able to exit quickly on a failure
is more important than people give it credit for. On some other systems
that have memory management issues it can lead to leakage.
--scott
--
"C'est un Nagra. C'est suisse, et tres, tres precis."

Re: BASIC (and Horizon)

<upe35d$1kofo$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33390&group=comp.os.vms#33390

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!news.chmurka.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: clubley@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Wed, 31 Jan 2024 18:22:37 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <upe35d$1kofo$1@dont-email.me>
References: <up8qmo$ima5$1@dont-email.me> <up9eho$lqco$2@dont-email.me> <up9h57$fmh$1@panix1.panix.com> <up9hra$m85k$1@dont-email.me> <upa74a$t0ce$1@dont-email.me> <upb1p2$10mt0$1@dont-email.me> <upci9g$1cmn1$2@dont-email.me> <updog4$1itf7$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 31 Jan 2024 18:22:37 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d00c7ed4b92fad7cdf9b4fde84fd08ec";
logging-data="1729016"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19jaH98budgC5WCSC4FJ2kq/U7XWD1yoTM="
User-Agent: slrn/0.9.8.1 (VMS/Multinet)
Cancel-Lock: sha1:Isbra49rx9T0gcVPF9yxwzDda+c=
 by: Simon Clubley - Wed, 31 Jan 2024 18:22 UTC

On 2024-01-31, Arne Vajhøj <arne@vajhoej.dk> wrote:
>
> For the not VB.NET knowledgable:
>
> Using o1 As New X("A")
> ...
> End Using
>
> calls o1.Dispose() when the block is exited no matter how it
> is exited - normal or exception does not matter Dispose is
> always called.
>

Unless there is a power failure or a system crash.

I wonder how many people think of that one when assuming that their
state reset code will _always_ run after execution of the routine
has started. :-)

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.

Re: BASIC (and Horizon)

<upe3dn$1kr2b$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33391&group=comp.os.vms#33391

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: davef@tsoft-inc.com (Dave Froble)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Wed, 31 Jan 2024 13:27:57 -0500
Organization: A noiseless patient Spider
Lines: 83
Message-ID: <upe3dn$1kr2b$1@dont-email.me>
References: <up8qmo$ima5$1@dont-email.me> <up9eho$lqco$2@dont-email.me>
<up9h57$fmh$1@panix1.panix.com> <up9hra$m85k$1@dont-email.me>
<upa74a$t0ce$1@dont-email.me> <upb1p2$10mt0$1@dont-email.me>
<upci9g$1cmn1$2@dont-email.me> <updcv8$1frdh$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 31 Jan 2024 18:27:03 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3ac796c2f047dc4bec593e89ee014c13";
logging-data="1731659"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+HpOVFW2HeB43fngFS0IrkyPmop78tfDM="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:Yuurb4KpawkCWcb6I+Mu/sFhEuU=
In-Reply-To: <updcv8$1frdh$1@dont-email.me>
 by: Dave Froble - Wed, 31 Jan 2024 18:27 UTC

On 1/31/2024 7:03 AM, Chris Townley wrote:
> On 31/01/2024 04:28, Dave Froble wrote:
>> On 1/30/2024 9:40 AM, Chris Townley wrote:
>>> On 30/01/2024 07:06, Dave Froble wrote:
>>>> On 1/29/2024 8:02 PM, Arne Vajhøj wrote:
>>>>> On 1/29/2024 7:50 PM, kludge@panix.com wrote:
>>>>>> =?UTF-8?Q?Arne_Vajh=C3=B8j?= <arne@vajhoej.dk> wrote:
>>>>>>> The code is VB6.
>>>>>>>
>>>>>>> But none of the problems are Basic specific. It is possible
>>>>>>> to write the same bad code in C or Fortran or whatever.
>>>>>>>
>>>>>>> So it just shows that there are some really really bad programmers out
>>>>>>> there.
>>>>>>
>>>>>> I have worked with people who could write spaghetti Fortran in any
>>>>>> programming language available.
>>>>>
>>>>> "A real Fortran programmer can write Fortran in any language"
>>>>>
>>>>> Every time this comes up I post this Fortran/Pascal code:
>>>>>
>>>>> PROGRAM GOTOFUN(INPUT,OUTPUT);
>>>>> LABEL L731,L113,L247,L588,L761,L922,L399,L601;
>>>>> VAR LBL:INTEGER;
>>>>> VAR I:INTEGER;
>>>>> BEGIN
>>>>> L731: GOTO L113;
>>>>> LBL:=399;
>>>>> L113: I:=0;
>>>>> WRITELN(I);
>>>>> L247: LBL:=601;
>>>>> IF(I<0)THEN GOTO L588 ELSE IF(I=0)THEN GOTO L922 ELSE GOTO L399;
>>>>> L588: I:=I+1;
>>>>> WRITELN(I);
>>>>> GOTO L399;
>>>>> L761: CASE(LBL)OF 399: GOTO L399; 601: GOTO L601; END;
>>>>> L922: I:=I+1;
>>>>> WRITELN(I);
>>>>> CASE(I)OF 1: GOTO L588; 2: GOTO L399; 3: GOTO L922; END;
>>>>> L399: GOTO L761;
>>>>> L601: END.
>>>>>
>>>>> :-)
>>>>>
>>>>> Arne
>>>>>
>>>>
>>>> I'm amused every time the GoTo bashing begins.
>>>>
>>>> Not only is there nothing wrong when using a branch operation, when
>>>> appropriate, just look at the assembler listings after compilation. Branching
>>>> is just about all assembler does, as required.
>>>>
>>>> Now, I won't defend what I and most consider improper use of the poor
>>>> misunderstood GoTo statement.
>>>>
>>>
>>> But unless used very carefully, it can create horrible spaghetti like code, and
>>> is also easy to screw up.
>>>
>>> Using proper structured constructs is much better - easier to read as well,
>>> hence better maintainability.
>>>
>>>
>>
>> Prey tell, what structured construct will perform cleanup and exit? I always
>> expected a return from routines and such.
>>
>
> It would depend on what is needing to be done
>

Final cleanup, if required, and exit the program.

Knew a guy that would us a gosub to go to the END statement. Drove me nuts.

--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486

Re: BASIC (and Horizon)

<upe3ib$1kker$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33392&group=comp.os.vms#33392

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!nntp.comgw.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arne@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Wed, 31 Jan 2024 13:29:30 -0500
Organization: A noiseless patient Spider
Lines: 76
Message-ID: <upe3ib$1kker$1@dont-email.me>
References: <up8qmo$ima5$1@dont-email.me> <upb1p2$10mt0$1@dont-email.me>
<upci9g$1cmn1$2@dont-email.me> <20240131155230.00000457@yahoo.com>
<updrqb$1q$1@panix2.panix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 31 Jan 2024 18:29:31 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2a64d8f6ae6973267bcb42c81335e468";
logging-data="1724891"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19dbqpHrHZk1NHB4zVlHlsFit8PXNsVSxk="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Xpx5WfGjMWc8sFxOdu3UcG6a/GQ=
Content-Language: en-US
In-Reply-To: <updrqb$1q$1@panix2.panix.com>
 by: Arne Vajhøj - Wed, 31 Jan 2024 18:29 UTC

On 1/31/2024 11:17 AM, Scott Dorsey wrote:
> Michael S <already5chosen@yahoo.com> wrote:
>>
>> The third option, the one I like least (an understatement) is use of
>> exceptions. Despite my personal preferences, it's quite popular.
>
> Exceptions can be very elegant or very inelegant... and it is entirely
> possible to have an exception that doesn't clean anything up at all and
> just exits and lets the operating system deal with the memory. On many
> systems this is a great idea because being able to exit quickly on a failure
> is more important than people give it credit for. On some other systems
> that have memory management issues it can lead to leakage.

It is probably a bit easier to implement exceptions in languages
with garbage collection and a lot easier for developers to avoid
memory leak bugs.

$ type mem.cpp
#include <iostream>
#include <string>

using namespace std;

class X
{ private:
string id;
public:
X(string id) { this->id = id; cout << "Allocate " << id << endl; }
virtual ~X() { cout << "Deallocate " << id << endl; }
};

void f2()
{ throw "Houston we have a problem";
}

void f1()
{ X o2("o2");
X *o3 = new X("o3");
f2();
delete o3;
}

int main()
{ try
{
X o1("o1");
f1();
}
catch(char *ex)
{
cout << ex << endl;
}
return 0;
}

$ cxx mem.cpp
$ cxxlink mem
link mem
$ run mem
Allocate o1
Allocate o2
Allocate o3
Deallocate o2
Deallocate o1
Houston we have a problem
$

We see that o2 did get deallocated, but o3 did not get deallocated.

Arne

Re: BASIC (and Horizon)

<upe438$1kker$2@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33393&group=comp.os.vms#33393

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arne@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Wed, 31 Jan 2024 13:38:32 -0500
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <upe438$1kker$2@dont-email.me>
References: <up8qmo$ima5$1@dont-email.me> <up9eho$lqco$2@dont-email.me>
<up9h57$fmh$1@panix1.panix.com> <up9hra$m85k$1@dont-email.me>
<upa74a$t0ce$1@dont-email.me> <upb1p2$10mt0$1@dont-email.me>
<upci9g$1cmn1$2@dont-email.me> <updog4$1itf7$1@dont-email.me>
<upe35d$1kofo$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 31 Jan 2024 18:38:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2a64d8f6ae6973267bcb42c81335e468";
logging-data="1724891"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19seYVLfIchW+ml4J2JEI4EpMauvJZIfeU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:AhNifMgiskPYSsPIJ6pOIeADqwY=
In-Reply-To: <upe35d$1kofo$1@dont-email.me>
Content-Language: en-US
 by: Arne Vajhøj - Wed, 31 Jan 2024 18:38 UTC

On 1/31/2024 1:22 PM, Simon Clubley wrote:
> On 2024-01-31, Arne Vajhøj <arne@vajhoej.dk> wrote:
>> For the not VB.NET knowledgable:
>>
>> Using o1 As New X("A")
>> ...
>> End Using
>>
>> calls o1.Dispose() when the block is exited no matter how it
>> is exited - normal or exception does not matter Dispose is
>> always called.
>
> Unless there is a power failure or a system crash.

I guess that is also a form of exit.

:-)

> I wonder how many people think of that one when assuming that their
> state reset code will _always_ run after execution of the routine
> has started. :-)

Probably none. But it probably does not matter either.

The construct is used to free unmanaged resources in the
process. Open files, open network connections like database
connections, unmanaged memory etc.. All stuff that goes
away if the process is gone.

I have never seen the construct used to reset an out
of process state (persisted state). And I have seen
a lot of C#, VB.NET, Java, Python etc. code using the
construct.

If there is a need for a consistent out of process
state (persisted state), then it has to be transactions.

Arne

Re: BASIC (and Horizon)

<upeb9s$f7i$1@reader1.panix.com>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33394&group=comp.os.vms#33394

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail
From: cross@spitfire.i.gajendra.net (Dan Cross)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Wed, 31 Jan 2024 20:41:32 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <upeb9s$f7i$1@reader1.panix.com>
References: <up8qmo$ima5$1@dont-email.me> <20240131155230.00000457@yahoo.com> <updrqb$1q$1@panix2.panix.com> <upe3ib$1kker$1@dont-email.me>
Injection-Date: Wed, 31 Jan 2024 20:41:32 -0000 (UTC)
Injection-Info: reader1.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80";
logging-data="15602"; mail-complaints-to="abuse@panix.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: cross@spitfire.i.gajendra.net (Dan Cross)
 by: Dan Cross - Wed, 31 Jan 2024 20:41 UTC

In article <upe3ib$1kker$1@dont-email.me>,
Arne Vajhøj <arne@vajhoej.dk> wrote:
>On 1/31/2024 11:17 AM, Scott Dorsey wrote:
>> Michael S <already5chosen@yahoo.com> wrote:
>>>
>>> The third option, the one I like least (an understatement) is use of
>>> exceptions. Despite my personal preferences, it's quite popular.
>>
>> Exceptions can be very elegant or very inelegant... and it is entirely
>> possible to have an exception that doesn't clean anything up at all and
>> just exits and lets the operating system deal with the memory. On many
>> systems this is a great idea because being able to exit quickly on a failure
>> is more important than people give it credit for. On some other systems
>> that have memory management issues it can lead to leakage.
>
>It is probably a bit easier to implement exceptions in languages
>with garbage collection and a lot easier for developers to avoid
>memory leak bugs.
>
>$ type mem.cpp
>#include <iostream>
>#include <string>
>
>using namespace std;
>
>class X
>{
>private:
> string id;
>public:
> X(string id) { this->id = id; cout << "Allocate " << id << endl; }
> virtual ~X() { cout << "Deallocate " << id << endl; }
>};
>
>void f2()
>{
> throw "Houston we have a problem";
>}
>
>void f1()
>{
> X o2("o2");
> X *o3 = new X("o3");
> f2();
> delete o3;
>}
>
>int main()
>{
> try
> {
> X o1("o1");
> f1();
> }
> catch(char *ex)
> {
> cout << ex << endl;
> }
> return 0;
>}
>
>$ cxx mem.cpp
>$ cxxlink mem
>link mem
>$ run mem
>Allocate o1
>Allocate o2
>Allocate o3
>Deallocate o2
>Deallocate o1
>Houston we have a problem
>$
>
>We see that o2 did get deallocated, but o3 did not get deallocated.

This is well-known in older C++ code; since C++11 one should be
using `std::unique_ptr<T>` to avoid this sort of issue. Code
using an older dialect could look at something like the
venerable ScopeGuard as a defensive technique to guard against
leaks.
https://www.drdobbs.com/article/print?articleId=184403758&siteSectionName=cpp

- Dan C.

Pages:1234
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor