Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

<moshez> ok, I will not marry Jo-Con-El's cow.


computers / comp.os.vms / Re: 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
Re: BASIC (and Horizon)

<upg71f$s2j$1@reader1.panix.com>

  copy mid

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

  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: Thu, 1 Feb 2024 13:41:03 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <upg71f$s2j$1@reader1.panix.com>
References: <up8qmo$ima5$1@dont-email.me> <upeokq$1o97f$1@dont-email.me> <upetth$14m$1@reader1.panix.com> <upg5s6$2346b$1@dont-email.me>
Injection-Date: Thu, 1 Feb 2024 13:41:03 -0000 (UTC)
Injection-Info: reader1.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80";
logging-data="28755"; 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 - Thu, 1 Feb 2024 13:41 UTC

In article <upg5s6$2346b$1@dont-email.me>,
Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> wrote:
>On 2024-01-31, Dan Cross <cross@spitfire.i.gajendra.net> wrote:
>>
>> I would argue this is more idiomatic, shorter, simpler, easier
>> to both read and to reason about, and uses fewer variables.
>>
>
>I agree and this is the general style I use, but with one difference.
>In my code, I always, always, use braces in an if() statement, even
>if the conditional code is only a single statement. For example:
>
> const bool parsed_ok = PyArg_ParseTuple(args, "Os", &items, &msg);
> if (!parsed_ok)
> {
> return NULL;
> }
>
>I think that makes it more clear and removes any possibility of future
>code changes accidentally not adding the braces at that time.

That's fine. Indeed, many modern languages mandate braces in
around the bodies of conditionals and loops as part of the base
syntax of the language (Go and Rust both do). I didn't bother
because I only made the minimal changes to that crank's code.

>[And yes, about the above indentation, Simon _is_ indeed a Whitesmiths
>person. :-)]

From, Henry Spencer's, "The Ten Commandments for C Programmers":

|8. Thou shalt make thy program's purpose and structure clear to
|thy fellow man by using the One True Brace Style, even if thou
|likest it not, for thy creativity is better used in solving
|problems than in creating beautiful new impediments to
|understanding.

It is somewhat odd to me how contentious this is after so many
years, but I kind of get how attached one can be to a particular
code style. When I worked at Google, I thought the mandated
style for C++ code was hideously ugly; after a few weeks, I
stopped noticing. When `clang-format` came along, it was great
because it essentially eliminated all of the stupid style things
from reviews. Go and Rust (and other modern languages)
effectively ended this as an issue by shipping with code
formatters and making people use them.

The bottom line for me, for C/C++ code, is that I don't care
what style one uses, as long as one is consistent; it is
shocking the extent to which divergent styles within a code base
can increase cognitive load.

- Dan C.

Re: BASIC (and Horizon)

<upha4g$29a95$1@dont-email.me>

  copy mid

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

  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: Thu, 1 Feb 2024 18:40:00 -0500
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <upha4g$29a95$1@dont-email.me>
References: <up8qmo$ima5$1@dont-email.me> <upegdc$1n0je$1@dont-email.me>
<upeklu$1nil8$7@dont-email.me> <upeokq$1o97f$1@dont-email.me>
<upetth$14m$1@reader1.panix.com> <upg5s6$2346b$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 1 Feb 2024 23:40:00 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6bfecf76bbd74aa7068b59eca01e1ef0";
logging-data="2402597"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+2jLlSEwdM0ZGNorEzR+JjDjEkgoqSej4="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:CFBHgBet0w4XqGW7hpL5xdSgTVc=
In-Reply-To: <upg5s6$2346b$1@dont-email.me>
Content-Language: en-US
 by: Arne Vajhøj - Thu, 1 Feb 2024 23:40 UTC

On 2/1/2024 8:21 AM, Simon Clubley wrote:
> On 2024-01-31, Dan Cross <cross@spitfire.i.gajendra.net> wrote:
>> I would argue this is more idiomatic, shorter, simpler, easier
>> to both read and to reason about, and uses fewer variables.
>
> I agree and this is the general style I use, but with one difference.
> In my code, I always, always, use braces in an if() statement, even
> if the conditional code is only a single statement. For example:
>
> const bool parsed_ok = PyArg_ParseTuple(args, "Os", &items, &msg);
> if (!parsed_ok)
> {
> return NULL;
> }
>
> I think that makes it more clear and removes any possibility of future
> code changes accidentally not adding the braces at that time.

That is a common coding convention.

Including the original SUN Java coding convention from 1999.

Arne

Re: BASIC (and Horizon)

<uphb9l$2916e$9@dont-email.me>

  copy mid

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

  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: Thu, 1 Feb 2024 23:59:49 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <uphb9l$2916e$9@dont-email.me>
References: <up8qmo$ima5$1@dont-email.me> <upegdc$1n0je$1@dont-email.me>
<upeklu$1nil8$7@dont-email.me> <upeokq$1o97f$1@dont-email.me>
<upetth$14m$1@reader1.panix.com> <upg5s6$2346b$1@dont-email.me>
<upha4g$29a95$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 1 Feb 2024 23:59:49 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2132941f276938b37dd44911619c6d41";
logging-data="2393294"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/tLeRfsM3T8Vp1qWQ03P45"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:8elFGOk8pYsPuL/NacmZwoSYZxw=
 by: Lawrence D'Oliv - Thu, 1 Feb 2024 23:59 UTC

On Thu, 1 Feb 2024 18:40:00 -0500, Arne Vajhøj wrote:

>> const bool parsed_ok = PyArg_ParseTuple(args, "Os", &items, &msg);
>> if (!parsed_ok)
>> {
>> return NULL;
>> }
>>
> That is a common coding convention.

How do you handle nesting? Remember this part?

if (PyDict_SetItem(tempresult, first, second) < 0)
break;

If you did a return instead at that point, it would leak memory.

Note also the handover of ownership after all successful allocations, at
the end of the block:

} /*for*/
if (PyErr_Occurred())
break;
/* all done */
result = tempresult;
tempresult = NULL; /* so I don’t dispose of it yet */

This way, the cleanup at the end does not need to distinguish between
success and failure returns:

Py_XDECREF(tempresult);
return
result;

Re: BASIC (and Horizon)

<uphhe9$aoc$1@panix2.panix.com>

  copy mid

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

  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: 2 Feb 2024 01:44:41 -0000
Organization: Former users of Netcom shell (1989-2000)
Lines: 25
Message-ID: <uphhe9$aoc$1@panix2.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-Info: reader1.panix.com; posting-host="panix2.panix.com:166.84.1.2";
logging-data="239"; mail-complaints-to="abuse@panix.com"
 by: Scott Dorsey - Fri, 2 Feb 2024 01:44 UTC

=?UTF-8?Q?Arne_Vajh=C3=B8j?= <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.

True, but "dispose of all memory belonging to this process" should not be
a big deal on a demand-paged machine. There are some architectures where
it can be, though.
--scott

--
"C'est un Nagra. C'est suisse, et tres, tres precis."

Re: BASIC (and Horizon)

<uphk35$2akla$1@dont-email.me>

  copy mid

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

  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: Thu, 1 Feb 2024 21:29:57 -0500
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <uphk35$2akla$1@dont-email.me>
References: <up8qmo$ima5$1@dont-email.me> <20240131155230.00000457@yahoo.com>
<updrqb$1q$1@panix2.panix.com> <upe3ib$1kker$1@dont-email.me>
<uphhe9$aoc$1@panix2.panix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 2 Feb 2024 02:29:57 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6bfecf76bbd74aa7068b59eca01e1ef0";
logging-data="2445994"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/eil5sjuAY0zjTq0MpY5jUroMgKabTlF4="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:5khBpy16wocDdH2g5oL0WbUbxBQ=
Content-Language: en-US
In-Reply-To: <uphhe9$aoc$1@panix2.panix.com>
 by: Arne Vajhøj - Fri, 2 Feb 2024 02:29 UTC

On 2/1/2024 8:44 PM, Scott Dorsey wrote:
> =?UTF-8?Q?Arne_Vajh=C3=B8j?= <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.
>
> True, but "dispose of all memory belonging to this process" should not be
> a big deal on a demand-paged machine. There are some architectures where
> it can be, though.

The issue is not if the process goes away but if the process
continue after execution flow has dropped back a number of levels
on the call stack.

The C++ code I posted did exit, but main could have called
f1 again after catching the exception. Maybe doing it
a billion times leaking one object for every call.

Arne

Re: BASIC (and Horizon)

<uphkr8$2angn$1@dont-email.me>

  copy mid

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

  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: Thu, 1 Feb 2024 21:43:42 -0500
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <uphkr8$2angn$1@dont-email.me>
References: <up8qmo$ima5$1@dont-email.me> <upee11$1mjib$7@dont-email.me>
<upegdc$1n0je$1@dont-email.me> <upejl0$1nkl5$1@dont-email.me>
<upervk$oam$1@reader1.panix.com> <upf4q6$1tp4r$1@dont-email.me>
<3c16a3a0f6100e01b49cf3de3d3411f051b23cab.camel@munted.eu>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 2 Feb 2024 02:42:48 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3e3cf523430cfb2110d316f3c9323780";
logging-data="2448919"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+bJNnIg0kTr9p4A2r9XK8ZT6UsPiDwh/c="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:0WsyvDQSZInYZTjXICXCDHyZsYA=
In-Reply-To: <3c16a3a0f6100e01b49cf3de3d3411f051b23cab.camel@munted.eu>
 by: Dave Froble - Fri, 2 Feb 2024 02:43 UTC

On 2/1/2024 3:43 AM, Single Stage to Orbit wrote:
> On Wed, 2024-01-31 at 22:57 -0500, Dave Froble wrote:
>>
>> GoTo can be dangerous ...
>> Learn good programming habits ...
>
> Linux uses goto in the kernel a lot. Should I throw it in the bin?
>

Pitch it because it's Linux, not because of the goto

:-)

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

<uphl8k$2aqjo$1@dont-email.me>

  copy mid

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

  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: Thu, 1 Feb 2024 21:49:56 -0500
Organization: A noiseless patient Spider
Lines: 77
Message-ID: <uphl8k$2aqjo$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> <20240131155230.00000457@yahoo.com>
<upee11$1mjib$7@dont-email.me> <upegdc$1n0je$1@dont-email.me>
<upeklu$1nil8$7@dont-email.me> <upeokq$1o97f$1@dont-email.me>
<upf0r9$1t7cn$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 2 Feb 2024 02:49:56 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6bfecf76bbd74aa7068b59eca01e1ef0";
logging-data="2452088"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18YlY/0SdHPI7vvum+PWoszsNHeFtT0v94="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:j4OMvxBHTeExunrerY5ooy++neE=
In-Reply-To: <upf0r9$1t7cn$1@dont-email.me>
Content-Language: en-US
 by: Arne Vajhøj - Fri, 2 Feb 2024 02:49 UTC

On 1/31/2024 9:49 PM, Lawrence D'Oliveiro wrote:
> On Wed, 31 Jan 2024 19:29:14 -0500, Arne Vajhøj wrote:
>> That code would look a lot cleaner if the do while(false) loop got
>> removed and the relevant breaks got replaced by goto's.
>
> Show us how you would do it. I can take you through my code step by step,
> block by block, if that will help.

It is pretty simple.

do {
allocate(o1);
...
if(...) break;
...
} while(false);
deallocate(o1);

can be done as:

allocate(o1);
...
if(...) goto cleanup;
...
cleanup:
deallocate(o1);

The first piece of code is pretty bad as it confuses the
reader by using a loop and the break is not very
self documenting.

The second piece of code is straight forward to read
despite using goto.

It gets even more clear in the nested case.

do {
allocate(o1);
...
if(...) break;
...
flag = FALSE;
do {
allocate(o2)
...
if(...) {
flag = TRUE;
break;
}
...
}
deallocate(o2)
if(flag) break;
...
} while(false);
deallocate(o1);

vs:

allocate(o1);
...
if(...) goto cleanup_1;
...
allocate(o2);
...
if(...) goto cleanup_1_and_2;
...
cleanup_1_and_2:
deallocate(o2);
cleanup_1:
deallocate(o1);

The nested do while loop is a big mess. The goto solution
is still simple.

Arne

Re: BASIC (and Horizon)

<uphmh0$2en91$1@dont-email.me>

  copy mid

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

  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: Thu, 1 Feb 2024 22:11:20 -0500
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <uphmh0$2en91$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>
<upedpu$1mjib$6@dont-email.me> <upegm7$1n0je$2@dont-email.me>
<upekfj$1nil8$6@dont-email.me> <upepeb$1ofg2$1@dont-email.me>
<upf0u1$1t7cn$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 2 Feb 2024 03:11:28 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6bfecf76bbd74aa7068b59eca01e1ef0";
logging-data="2579745"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18mD2XPgiORp5XJdnXDsBtiB9JZvSuTrbQ="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:PCzf3xOsuh/sUIGrx0QVT7PvGNM=
In-Reply-To: <upf0u1$1t7cn$2@dont-email.me>
Content-Language: en-US
 by: Arne Vajhøj - Fri, 2 Feb 2024 03:11 UTC

On 1/31/2024 9:50 PM, Lawrence D'Oliveiro wrote:
> On Wed, 31 Jan 2024 19:42:50 -0500, Arne Vajhøj wrote:
>> C# is primarily for business applications.
>
> Never heard of it being used for anything important. For example,
> Microsoft would never use it itself in Office.

It is correct that MS never rewrote MSO from C++ to C#.
They did port VS to C# though.

But C# is all over. Finance, e-commerce, government etc..

The one C# app that I suspect that everyone here has used
is Wikipedia search. Wikipedia choose to do their search
using Lucene.NET instead of normal Lucene (Java based).

Arne

Re: BASIC (and Horizon)

<upho1p$2f0cp$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!news.hispagatos.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: Thu, 1 Feb 2024 22:38:21 -0500
Organization: A noiseless patient Spider
Lines: 107
Message-ID: <upho1p$2f0cp$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> <20240131155230.00000457@yahoo.com>
<upee11$1mjib$7@dont-email.me> <upegdc$1n0je$1@dont-email.me>
<upeklu$1nil8$7@dont-email.me> <upeokq$1o97f$1@dont-email.me>
<upf0r9$1t7cn$1@dont-email.me> <uphl8k$2aqjo$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 2 Feb 2024 03:37:29 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3e3cf523430cfb2110d316f3c9323780";
logging-data="2589081"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/RZNObz9IUGHtohg6c7uOTJRQ/VKf0uQg="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:eOoIfKmPabn9y6+adKQsELTURD8=
In-Reply-To: <uphl8k$2aqjo$1@dont-email.me>
 by: Dave Froble - Fri, 2 Feb 2024 03:38 UTC

On 2/1/2024 9:49 PM, Arne Vajhøj wrote:
> On 1/31/2024 9:49 PM, Lawrence D'Oliveiro wrote:
>> On Wed, 31 Jan 2024 19:29:14 -0500, Arne Vajhøj wrote:
>>> That code would look a lot cleaner if the do while(false) loop got
>>> removed and the relevant breaks got replaced by goto's.
>>
>> Show us how you would do it. I can take you through my code step by step,
>> block by block, if that will help.
>
> It is pretty simple.
>
> do {
> allocate(o1);
> ...
> if(...) break;
> ...
> } while(false);
> deallocate(o1);
>
> can be done as:
>
> allocate(o1);
> ...
> if(...) goto cleanup;
> ...
> cleanup:
> deallocate(o1);
>
> The first piece of code is pretty bad as it confuses the
> reader by using a loop and the break is not very
> self documenting.
>
> The second piece of code is straight forward to read
> despite using goto.
>
> It gets even more clear in the nested case.
>
> do {
> allocate(o1);
> ...
> if(...) break;
> ...
> flag = FALSE;
> do {
> allocate(o2)
> ...
> if(...) {
> flag = TRUE;
> break;
> }
> ...
> }
> deallocate(o2)
> if(flag) break;
> ...
> } while(false);
> deallocate(o1);
>
> vs:
>
> allocate(o1);
> ...
> if(...) goto cleanup_1;
> ...
> allocate(o2);
> ...
> if(...) goto cleanup_1_and_2;
> ...
> cleanup_1_and_2:
> deallocate(o2);
> cleanup_1:
> deallocate(o1);
>
> The nested do while loop is a big mess. The goto solution
> is still simple.
>
> Arne
>

Well, I'd use:

Select <something>
Case = "1"
Some code
Case = "2"
Some other code
End Select

No need for the dreaded GoTo statement ...

But even that can be abused.

Got a friend that got carried away with Select and indenting.

When the Select statements got nested a dozen times, and indents became 8-10
tabs, and the code for each CASE was several pages long ...

If the damn code was going to be so massive and complex, he should have just
branched/performed/whatever to a separate place to do all that work.

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

<uphofn$2eqm4$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.hispagatos.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: Thu, 1 Feb 2024 22:44:56 -0500
Organization: A noiseless patient Spider
Lines: 82
Message-ID: <uphofn$2eqm4$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> <20240131155230.00000457@yahoo.com>
<upee11$1mjib$7@dont-email.me> <upegdc$1n0je$1@dont-email.me>
<upeklu$1nil8$7@dont-email.me> <upeokq$1o97f$1@dont-email.me>
<upf0r9$1t7cn$1@dont-email.me> <uphl8k$2aqjo$1@dont-email.me>
<upho1p$2f0cp$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 2 Feb 2024 03:44:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6bfecf76bbd74aa7068b59eca01e1ef0";
logging-data="2583236"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/arw67tr0N38BTwjueBR9z1cRSCyZ23S8="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Cuj0PRDZV5QS/gywvH09SHF8LjE=
Content-Language: en-US
In-Reply-To: <upho1p$2f0cp$1@dont-email.me>
 by: Arne Vajhøj - Fri, 2 Feb 2024 03:44 UTC

On 2/1/2024 10:38 PM, Dave Froble wrote:
> On 2/1/2024 9:49 PM, Arne Vajhøj wrote:
>> It gets even more clear in the nested case.
>>
>>     do {
>>         allocate(o1);
>>         ...
>>         if(...) break;
>>         ...
>>         flag = FALSE;
>>         do {
>>             allocate(o2)
>>             ...
>>             if(...) {
>>                 flag = TRUE;
>>                 break;
>>             }
>>             ...
>>         }
>>         deallocate(o2)
>>         if(flag) break;
>>         ...
>>     } while(false);
>>     deallocate(o1);
>>
>> vs:
>>
>>     allocate(o1);
>>     ...
>>     if(...) goto cleanup_1;
>>     ...
>>     allocate(o2);
>>     ...
>>     if(...) goto cleanup_1_and_2;
>>     ...
>> cleanup_1_and_2:
>>     deallocate(o2);
>> cleanup_1:
>>     deallocate(o1);
>>
>> The nested do while loop is a big mess. The goto solution
>> is still simple.
>
> Well, I'd use:
>
> Select <something>
>     Case = "1"
>         Some code
>     Case = "2"
>         Some other code
> End Select

That code does something completely different.

> But even that can be abused.
>
> Got a friend that got carried away with Select and indenting.
>
> When the Select statements got nested a dozen times, and indents became
> 8-10 tabs, and the code for each CASE was several pages long ...
>
> If the damn code was going to be so massive and complex, he should have
> just branched/performed/whatever to a separate place to do all that work.

To quote from Linux kernel coding style doc:

<quote>
Now, some people will claim that having 8-character indentations makes
the code move too far to the right, and makes it hard to read on a
80-character terminal screen. The answer to that is that if you need
more than 3 levels of indentation, you’re screwed anyway, and should fix
your program.

In short, 8-char indents make things easier to read, and have the added
benefit of warning you when you’re nesting your functions too deep. Heed
that warning.
</quote>

Arne

Re: BASIC (and Horizon)

<uphs6r$2fg0v$2@dont-email.me>

  copy mid

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

  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: Fri, 2 Feb 2024 04:48:28 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <uphs6r$2fg0v$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>
<upedpu$1mjib$6@dont-email.me> <upegm7$1n0je$2@dont-email.me>
<upekfj$1nil8$6@dont-email.me> <upepeb$1ofg2$1@dont-email.me>
<upf0u1$1t7cn$2@dont-email.me> <uphmh0$2en91$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 2 Feb 2024 04:48:28 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2132941f276938b37dd44911619c6d41";
logging-data="2605087"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+oAD0UZzLLRSmoFDp5g5RV"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:xedXYCR3Ac5TgRQ4agItASlzyKM=
 by: Lawrence D'Oliv - Fri, 2 Feb 2024 04:48 UTC

On Thu, 1 Feb 2024 22:11:20 -0500, Arne Vajhøj wrote:

> On 1/31/2024 9:50 PM, Lawrence D'Oliveiro wrote:
>
>> On Wed, 31 Jan 2024 19:42:50 -0500, Arne Vajhøj wrote:
>
>>> C# is primarily for business applications.
>>
>> Never heard of it being used for anything important. For example,
>> Microsoft would never use it itself in Office.
>
> It is correct that MS never rewrote MSO from C++ to C#.
> They did port VS to C# though.

Maybe, but VS Code takes an entirely different tack, using Electron (the
Chromium engine + TypeScript/JavaScript) instead. Wonder why?

> But C# is all over. Finance, e-commerce, government etc..

All that stuff that’s now in the cloud?

Re: BASIC (and Horizon)

<uphsad$2fg0v$3@dont-email.me>

  copy mid

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

  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: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Fri, 2 Feb 2024 04:50:22 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <uphsad$2fg0v$3@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> <20240131155230.00000457@yahoo.com>
<upee11$1mjib$7@dont-email.me> <upegdc$1n0je$1@dont-email.me>
<upeklu$1nil8$7@dont-email.me> <upeokq$1o97f$1@dont-email.me>
<upf0r9$1t7cn$1@dont-email.me> <uphl8k$2aqjo$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 2 Feb 2024 04:50:22 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2132941f276938b37dd44911619c6d41";
logging-data="2605087"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Y+o4fj4C3ZvhVFBGTRK4C"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:UJKzqKZvFKKnHao+OR/6lAvt1BY=
 by: Lawrence D'Oliv - Fri, 2 Feb 2024 04:50 UTC

On Thu, 1 Feb 2024 21:49:56 -0500, Arne Vajhøj wrote:

> The nested do while loop is a big mess.

Looks like you are adding a whole lot more lines of code in the form of
jumps and places to jump to, and flags to control what to do when you get
there. Adding a bit of a combinatorial explosion in possible cases that
have to be verified somehow.

In short, you are making a bigger mess.

Re: BASIC (and Horizon)

<uphsbk$2fg0v$4@dont-email.me>

  copy mid

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

  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: Fri, 2 Feb 2024 04:51:01 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <uphsbk$2fg0v$4@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> <20240131155230.00000457@yahoo.com>
<upee11$1mjib$7@dont-email.me> <upegdc$1n0je$1@dont-email.me>
<upeklu$1nil8$7@dont-email.me> <upeokq$1o97f$1@dont-email.me>
<upf0r9$1t7cn$1@dont-email.me> <uphl8k$2aqjo$1@dont-email.me>
<upho1p$2f0cp$1@dont-email.me> <uphofn$2eqm4$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 2 Feb 2024 04:51:01 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2132941f276938b37dd44911619c6d41";
logging-data="2605087"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+UVTJV4I3xanCSNdB7J9UO"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:r+26Yomlk639fpojrZ3pBgeMMMA=
 by: Lawrence D'Oliv - Fri, 2 Feb 2024 04:51 UTC

On Thu, 1 Feb 2024 22:44:56 -0500, Arne Vajhøj wrote:

> To quote from Linux kernel coding style doc:
>
> <quote>
> Now, some people will claim that having 8-character indentations makes
> the code move too far to the right, and makes it hard to read on a
> 80-character terminal screen. The answer to that is that if you need
> more than 3 levels of indentation, you’re screwed anyway, and should fix
> your program.

I think this is a load of nonsense.

Re: BASIC (and Horizon)

<4c3c735fc45e1152e991f04621a27ef3617a4db7.camel@munted.eu>

  copy mid

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

  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: alex.buell@munted.eu (Single Stage to Orbit)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Fri, 02 Feb 2024 10:36:47 +0000
Organization: One very high maintenance cat
Lines: 13
Message-ID: <4c3c735fc45e1152e991f04621a27ef3617a4db7.camel@munted.eu>
References: <up8qmo$ima5$1@dont-email.me> <upee11$1mjib$7@dont-email.me>
<upegdc$1n0je$1@dont-email.me> <upejl0$1nkl5$1@dont-email.me>
<upervk$oam$1@reader1.panix.com> <upf4q6$1tp4r$1@dont-email.me>
<3c16a3a0f6100e01b49cf3de3d3411f051b23cab.camel@munted.eu>
<uphkr8$2angn$1@dont-email.me>
Reply-To: alex.buell@munted.eu
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: dont-email.me; posting-host="16de265f7b8a1bf78c6863ac99847c49";
logging-data="2713363"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19J4k54UksKeb9QeOQ2ifOAWdt8v98uMpk="
User-Agent: Evolution 3.50.2
Cancel-Lock: sha1:MYWcvIOnsC0OezdX4NO+TRdHk1M=
In-Reply-To: <uphkr8$2angn$1@dont-email.me>
Autocrypt: addr=alex.buell@munted.eu; prefer-encrypt=mutual;
keydata=mQGiBESBdzQRBADZG8wvppAgI8NwvsAxedwBtLw7q6JjAisK91A7pF7zNpHtEHQhN4blBelLYHE48l12D2HzmMM+ZsI7cMCT/iOo1HdvWILoyg5nLNh2owaRYspg4DZRee4KefYrhyEl96THy19VK09sXAe42tmtZJNo+OJ+0lkPEapStyIlSJrHiwCggm70g64yVDu+47pBXvfLn8tifbsEALbT65XgZPETlJ7GWJAI82X/ZlaUx7EOMXKxX2LzWFJEadbHXsKi3zlKuneNGU8pwQNHVXN0wfHi/kRw5f4TrButZl4kDK8h3sP27awLWXHPCTfJXEOzihvmBdX23JcvXMWmGwI+5nzlSUj5jXRj8QFRxGrwbGEK1yHms/ja9cbDA/9+AOrHttUrvRSovBrt0XGCTxjBswtTnpZjfCJv8RdvAWfhaGxf7gz7kAlNRnQI4N8Uv0QT8uPy6ZHdabyPW/8WsOxdWXwLcfExDvx8PGzn2Z6z6mjV9ziVp2xco0nzs7wneHqnzSgZLgoFg3Yy49MpDJwGEfQnANjnAhonW9z+x7Q7QWxleCBCdWVsbCAoTWFpbiBFLW1haWwgQWRkcmVzcykgPGFsZXguYnVlbGxAbXVudGVkLm9yZy51az6IXwQTEQIAIAIbAwYLCQgHAwIEFQIIAwQWAgMBAh4BAheABQJTXnyNAAoJEBP0zXMUgl+OIdUAnRLVsqLvC2OcDnSl0AqFqLnuX+MmAJjf5M0x826cEjl7zw1YyDhgn7qdtCFBbGV4IEJ1ZWxsIDxhbGV4LmJ1ZWxsQG11bnRlZC5ldT6IZgQTEQIAJgIbAwcLCQgHAwIBBhUIAgkKCwQWAgMBAh4BAheABQJTXnyNAhkBAAoJEBP0zXMUgl+O+RoAnj1uoAheC30ecr4yoh6avHEhL/llAJ9Qo1iwHVMpXRRhK+cHvRXKpfrK57kEDQREgXnxEBAAySb93hrH28AtA5sPE
pwF+Chy+xK5KISe4f7HJQpwWNgPCFJVFfldNUJdk2skCeFlmHCn81fzVx1tewE0xx6nsqPgBugjIukmY/14jp4ysr6g+xqxMhdQqW1gPPssuztn8GEk5c/nLr3R3uZYoeLNxWxGOm0agpepMeMduFHcVQWqZ2UwgOcg1ytPtedAzyyQzbNuxENIPj/SF9jCPoqZJlN8eh3p8m2HuWp317YA8bUD/f+wJDvqADraxjXr2Nq0YRdgTr/+ajQdHJx+j4jUary0FM2C9I9jlljdb776uYr5qo4Ame9I11f+/g3IiZcIejRDqd5P41JjzzEX+f5wLpqvdHC/i8940bbhE2wi+Gh+cTOX25x6zRtb0uxzPsaLhCdOAEcZvuK8afKyNo0/Ptgpc/qO5p+EdY4mX7KIrbCKADobzlO9Ny+dSaY7/IGJIXASjPunQlBsMRWixzEe6I/zKUAmjCEW1La9nOmY/9r37rfY0yRS5HdDzZLrZQz4UdtdK7mkfFAPpdT0BIRoVYo8VbtPwgqCAm3h7lcbEjSmmzzxBcp35jQmTkJl4yszgYG1c+IQ+YSeqmMbdqdKaSMU3fq0agCJGvQzOAzSEt2wClXBzqBU0lH7/rfLh5khk/BGYLbCFRkNypZdcbi+Dim7asXgEvkkwfyySbmux7MAAwUP/2cja0PGvAfwr3Z+LifcVZa+b/Zn4Ro+FxgJ3TKwWk8i9L5j4xPErwDTucnhEAoBtv79wfFlpo/iKUuMy4Jcs/d6iWz+8TFQRHB3xzPZqAYvMxN9bzlIwSVnwrvi2ocnwiZZqA/KZo+a9i1Q0R/1I19fwXQtuYEW0dWyqdxS4NdUUIujEf9sefUiRVhDXe3ra2g7W2oOmRJJ3kDGZpM8wKNIwyQeHlVjuPVdwEOyp8xCZqPIAWTWl6CdcLi1m5sO0+BRQjCqkv8wdQODgheQ3qeHRQdrag57tSJ3rtmnvQgz2/Ref4q2mk478/fHtskGyPauhn
oM21NnHfo7RohDWVnYxAbHrErJjrym5yRxgWN0ccrsoeza/8m+G+my78KFVUtoTn9QmDDtaHrp7I2XGZ4r8rpvtCBxg4IFUqHg0ESI2/4pHw8n4uyD9e7yuZ+0zsLzMhloNEZ8ABe2/peVeir9eEVGqXTmixiLgVvPkTBi6xa4FmTqG3m0woUz8BXzCT1hoHtTPQ4UxGgcp8ITPUy1dJKUsqqY1uPSuLA06tGPQj7w/0j1HTuyct5NNHFDpDvrQdi/qr4CEk3WVWAEiv+d07DumSKnb6k5OySXSK128/oE2FXKsM1gNgFpK2SqEqfylxpAtJmRWNcV7Dyaqci22xRgBnU9X5iC2N9eXvaliEkEGBECAAkFAkSBefECGwwACgkQE/TNcxSCX46DQQCdH57pYA1kE373R9WsUN6+OXpqD8gAn0oKFduLKG48YhT7256Jo/7ZDeSU
 by: Single Stage to Orbi - Fri, 2 Feb 2024 10:36 UTC

On Thu, 2024-02-01 at 21:43 -0500, Dave Froble wrote:
> > > GoTo can be dangerous ...
> > > Learn good programming habits ...
> >
> > Linux uses goto in the kernel a lot. Should I throw it in the bin?
> >
>
> Pitch it because it's Linux, not because of the goto

Oo them's flammable words. :-D
--
Tactical Nuclear Kittens

Re: BASIC (and Horizon)

<upinnl$2jlsr$1@dont-email.me>

  copy mid

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

  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: Fri, 2 Feb 2024 07:38:14 -0500
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <upinnl$2jlsr$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>
<upedpu$1mjib$6@dont-email.me> <upegm7$1n0je$2@dont-email.me>
<upekfj$1nil8$6@dont-email.me> <upepeb$1ofg2$1@dont-email.me>
<upf0u1$1t7cn$2@dont-email.me> <uphmh0$2en91$1@dont-email.me>
<uphs6r$2fg0v$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 2 Feb 2024 12:38:13 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6bfecf76bbd74aa7068b59eca01e1ef0";
logging-data="2742171"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19iVK1NQ/tsvIguhHLB/XgwNFecvA+2yoM="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:dtRSDKEemxd/b0MfCNJRPsZlQQ4=
Content-Language: en-US
In-Reply-To: <uphs6r$2fg0v$2@dont-email.me>
 by: Arne Vajhøj - Fri, 2 Feb 2024 12:38 UTC

On 2/1/2024 11:48 PM, Lawrence D'Oliveiro wrote:
> On Thu, 1 Feb 2024 22:11:20 -0500, Arne Vajhøj wrote:
>
>> On 1/31/2024 9:50 PM, Lawrence D'Oliveiro wrote:
>>
>>> On Wed, 31 Jan 2024 19:42:50 -0500, Arne Vajhøj wrote:
>>
>>>> C# is primarily for business applications.
>>>
>>> Never heard of it being used for anything important. For example,
>>> Microsoft would never use it itself in Office.
>>
>> It is correct that MS never rewrote MSO from C++ to C#.
>> They did port VS to C# though.
>
> Maybe, but VS Code takes an entirely different tack, using Electron (the
> Chromium engine + TypeScript/JavaScript) instead. Wonder why?

VSC was intended to compete with Atom on Windows/Linux/macOS. VSC
was released before .NET Core. So MS did not have much of a choice.

>> But C# is all over. Finance, e-commerce, government etc..
>
> All that stuff that’s now in the cloud?

A lot of it.

But C# does not care if if the hardware it runs on is
bought or rented.

Arne

Re: BASIC (and Horizon)

<upinvc$2jlsq$1@dont-email.me>

  copy mid

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

  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: Fri, 2 Feb 2024 07:42:22 -0500
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <upinvc$2jlsq$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>
<upedpu$1mjib$6@dont-email.me> <upegm7$1n0je$2@dont-email.me>
<upekfj$1nil8$6@dont-email.me> <upepeb$1ofg2$1@dont-email.me>
<upf0u1$1t7cn$2@dont-email.me> <uphmh0$2en91$1@dont-email.me>
<uphs6r$2fg0v$2@dont-email.me> <upinnl$2jlsr$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 2 Feb 2024 12:42:20 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6bfecf76bbd74aa7068b59eca01e1ef0";
logging-data="2742170"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19WESqY7+5MpHWmOH2lqccmQcvJ8BCcrp8="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:MtNEpiixlLiKFeXPbRYUeKsoOk4=
Content-Language: en-US
In-Reply-To: <upinnl$2jlsr$1@dont-email.me>
 by: Arne Vajhøj - Fri, 2 Feb 2024 12:42 UTC

On 2/2/2024 7:38 AM, Arne Vajhøj wrote:
> On 2/1/2024 11:48 PM, Lawrence D'Oliveiro wrote:
>> On Thu, 1 Feb 2024 22:11:20 -0500, Arne Vajhøj wrote:
>>> It is correct that MS never rewrote MSO from C++ to C#.
>>> They did port VS to C# though.
>>
>> Maybe, but VS Code takes an entirely different tack, using Electron (the
>> Chromium engine + TypeScript/JavaScript) instead. Wonder why?
>
> VSC was intended to compete with Atom on Windows/Linux/macOS. VSC
> was released before .NET Core. So MS did not have much of a choice.

Correction: they had lots of choices, but C# was just not one of them.

Arne

Re: BASIC (and Horizon)

<upioq0$2jlsr$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.hispagatos.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: Fri, 2 Feb 2024 07:56:33 -0500
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <upioq0$2jlsr$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> <20240131155230.00000457@yahoo.com>
<upee11$1mjib$7@dont-email.me> <upegdc$1n0je$1@dont-email.me>
<upeklu$1nil8$7@dont-email.me> <upeokq$1o97f$1@dont-email.me>
<upf0r9$1t7cn$1@dont-email.me> <uphl8k$2aqjo$1@dont-email.me>
<upho1p$2f0cp$1@dont-email.me> <uphofn$2eqm4$1@dont-email.me>
<uphsbk$2fg0v$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 2 Feb 2024 12:56:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6bfecf76bbd74aa7068b59eca01e1ef0";
logging-data="2742171"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ym90CAdrriWPNLVfm9GwUwd+OjRhmpmw="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:IQ09I/7lUWoQeq4J0FPcEb6AB78=
Content-Language: en-US
In-Reply-To: <uphsbk$2fg0v$4@dont-email.me>
 by: Arne Vajhøj - Fri, 2 Feb 2024 12:56 UTC

On 2/1/2024 11:51 PM, Lawrence D'Oliveiro wrote:
> On Thu, 1 Feb 2024 22:44:56 -0500, Arne Vajhøj wrote:
>> To quote from Linux kernel coding style doc:
>>
>> <quote>
>> Now, some people will claim that having 8-character indentations makes
>> the code move too far to the right, and makes it hard to read on a
>> 80-character terminal screen. The answer to that is that if you need
>> more than 3 levels of indentation, you’re screwed anyway, and should fix
>> your program.
>
> I think this is a load of nonsense.

Apparently Linus doesn't think so.

And while few may have worded is this blunt, then it is
generally accepted that deep nesting is a code smell and
should be refactored and code moved out to functions/methods.

The specifics may depend a little on the language. 3 may
make sense in C, but VB.NET may justify a higher value
(namespace and class add levels before even getting started
and try catch blocks plus using statements also tend to
add more levels without the levels impacting flow).

Arne

Re: BASIC (and Horizon)

<upiriv$2kale$1@dont-email.me>

  copy mid

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

  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: Fri, 2 Feb 2024 08:44:00 -0500
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <upiriv$2kale$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> <20240131155230.00000457@yahoo.com>
<upee11$1mjib$7@dont-email.me> <upegdc$1n0je$1@dont-email.me>
<upeklu$1nil8$7@dont-email.me> <upeokq$1o97f$1@dont-email.me>
<upf0r9$1t7cn$1@dont-email.me> <uphl8k$2aqjo$1@dont-email.me>
<uphsad$2fg0v$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 2 Feb 2024 13:43:59 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6bfecf76bbd74aa7068b59eca01e1ef0";
logging-data="2763438"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19GXaeF2agdlgYr7uVzK4SsfEZrtpSVnNU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:p4/1jgSDyAKDZ4qECr1XxqVE8+k=
Content-Language: en-US
In-Reply-To: <uphsad$2fg0v$3@dont-email.me>
 by: Arne Vajhøj - Fri, 2 Feb 2024 13:44 UTC

On 2/1/2024 11:50 PM, Lawrence D'Oliveiro wrote:
> On Thu, 1 Feb 2024 21:49:56 -0500, Arne Vajhøj wrote:
>> The nested do while loop is a big mess.
>
> Looks like you are adding a whole lot more lines of code in the form of
> jumps and places to jump to, and flags to control what to do when you get
> there. Adding a bit of a combinatorial explosion in possible cases that
> have to be verified somehow.

I "added" lines so that the total number of lines "increased" from
7 to 6 in the one-level example and from 20 to 12 in the two-level
example.

Arne

Re: BASIC (and Horizon)

<upiru5$cqi$1@reader1.panix.com>

  copy mid

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

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!news.1d4.us!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!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: Fri, 2 Feb 2024 13:49:57 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <upiru5$cqi$1@reader1.panix.com>
References: <up8qmo$ima5$1@dont-email.me> <upf0r9$1t7cn$1@dont-email.me> <uphl8k$2aqjo$1@dont-email.me> <uphsad$2fg0v$3@dont-email.me>
Injection-Date: Fri, 2 Feb 2024 13:49:57 -0000 (UTC)
Injection-Info: reader1.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80";
logging-data="13138"; 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 - Fri, 2 Feb 2024 13:49 UTC

In article <uphsad$2fg0v$3@dont-email.me>,
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>On Thu, 1 Feb 2024 21:49:56 -0500, Arne Vajhøj wrote:
>
>> The nested do while loop is a big mess.
>
>Looks like you are adding a whole lot more lines of code in the form of
>jumps and places to jump to, and flags to control what to do when you get
>there. Adding a bit of a combinatorial explosion in possible cases that
>have to be verified somehow.
>
>In short, you are making a bigger mess.

Again, for this example, the code needs neither goto nor
the abstruse loop structure you wrote. See my earlier
post for details.

- Dan C.

Re: BASIC (and Horizon)

<upis9l$2kald$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!news.hispagatos.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: Fri, 2 Feb 2024 08:56:06 -0500
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <upis9l$2kald$1@dont-email.me>
References: <up8qmo$ima5$1@dont-email.me> <upf0r9$1t7cn$1@dont-email.me>
<uphl8k$2aqjo$1@dont-email.me> <uphsad$2fg0v$3@dont-email.me>
<upiru5$cqi$1@reader1.panix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 2 Feb 2024 13:56:05 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6bfecf76bbd74aa7068b59eca01e1ef0";
logging-data="2763437"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18PAt4QPiJiRmX78OmDwx0OiU09+4IOlZg="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:aeENANscW8lKc93Cxxhydetrmqc=
Content-Language: en-US
In-Reply-To: <upiru5$cqi$1@reader1.panix.com>
 by: Arne Vajhøj - Fri, 2 Feb 2024 13:56 UTC

On 2/2/2024 8:49 AM, Dan Cross wrote:
> In article <uphsad$2fg0v$3@dont-email.me>,
> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>> On Thu, 1 Feb 2024 21:49:56 -0500, Arne Vajhøj wrote:
>>> The nested do while loop is a big mess.
>>
>> Looks like you are adding a whole lot more lines of code in the form of
>> jumps and places to jump to, and flags to control what to do when you get
>> there. Adding a bit of a combinatorial explosion in possible cases that
>> have to be verified somehow.
>>
>> In short, you are making a bigger mess.
>
> Again, for this example, the code needs neither goto nor
> the abstruse loop structure you wrote. See my earlier
> post for details.

He cut so much that the context was not obvious.

But his post was a reply to my post with generic
.... blocks.

It is true the first specific example he provided
did not need to solve this problem if it was
restructured a little.

Arne

Re: BASIC (and Horizon)

<upj1pp$j9a$1@reader1.panix.com>

  copy mid

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

  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: Fri, 2 Feb 2024 15:30:01 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <upj1pp$j9a$1@reader1.panix.com>
References: <up8qmo$ima5$1@dont-email.me> <uphsad$2fg0v$3@dont-email.me> <upiru5$cqi$1@reader1.panix.com> <upis9l$2kald$1@dont-email.me>
Injection-Date: Fri, 2 Feb 2024 15:30:01 -0000 (UTC)
Injection-Info: reader1.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80";
logging-data="19754"; 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 - Fri, 2 Feb 2024 15:30 UTC

In article <upis9l$2kald$1@dont-email.me>,
Arne Vajhøj <arne@vajhoej.dk> wrote:
>On 2/2/2024 8:49 AM, Dan Cross wrote:
>> In article <uphsad$2fg0v$3@dont-email.me>,
>> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>>> On Thu, 1 Feb 2024 21:49:56 -0500, Arne Vajhøj wrote:
>>>> The nested do while loop is a big mess.
>>>
>>> Looks like you are adding a whole lot more lines of code in the form of
>>> jumps and places to jump to, and flags to control what to do when you get
>>> there. Adding a bit of a combinatorial explosion in possible cases that
>>> have to be verified somehow.
>>>
>>> In short, you are making a bigger mess.
>>
>> Again, for this example, the code needs neither goto nor
>> the abstruse loop structure you wrote. See my earlier
>> post for details.
>
>He cut so much that the context was not obvious.
>
>But his post was a reply to my post with generic
>... blocks.

This seems to be his MO: when presented with an
argument that disconfirms one of his preconceptions,
ignore it and respond to something else, usually
a strawman of his own creation.

>It is true the first specific example he provided
>did not need to solve this problem if it was
>restructured a little.

Yes. I suspect most of his code similarly.

- Dan C.

Re: BASIC (and Horizon)

<upjnlj$2p9jn$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!news.swapon.de!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: Fri, 2 Feb 2024 16:43:15 -0500
Organization: HoffmanLabs LLC
Lines: 36
Message-ID: <upjnlj$2p9jn$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> <updr42$1jcmi$1@dont-email.me> <upedmp$1mjib$5@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="196fa99a6daabb9fd1910c46b7a24048";
logging-data="2926199"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19XmCBjbRly76YYTjhIOe5/a237lOeICeY="
User-Agent: Unison/2.2
Cancel-Lock: sha1:W67EHgHLsWlBHBBYGczpK6QAQkU=
 by: Stephen Hoffman - Fri, 2 Feb 2024 21:43 UTC

On 2024-01-31 21:22:33 +0000, Lawrence D'Oliveiro said:

> On Wed, 31 Jan 2024 11:05:22 -0500, Stephen Hoffman wrote:
>
>> (Not that I prefer to have to implement manual cleanup, much as I'd
>> like to avoid explicitly deallocating memory in C.
>
> Note that free(3) is defined as idempotent; freeing a NULL pointer is a
> harmless no-op. That simplifies things a lot.

Pragmatically, the difference between (pseudo-code) free(xyz) where xyz
is nulllptr or ((void*)0) or whatever, and the same brute-force if
(xyz) free(xyz); code, or a macro of same, is negligible.

No, that free ignores a null doesn't simplify the bookkeeping. There
are other languages that are easier here.

Though semi-similarly, sending a null at a method in Objective C can be
useful. And can be a source of confusion and bugs.

On OpenVMS, using VM zones reduces the memory management bookkeeping in
some contexts, as the whole zone can be freed in one shot. This
technique can be handy for command parsers, where you know you're done
with ~everything parsing-related when you're parsing the next command.

There are other trade-offs that can make this effort easier, not the
least of which is garbage collection.

Apropos of nothing, asctime() and ctime() are now (C23) deprecated.

And some semi-related reading: https://jorengarenar.github.io/blog/less-known-c

--
Pure Personal Opinion | HoffmanLabs LLC

Re: BASIC (and Horizon)

<upk4if$96r$1@panix2.panix.com>

  copy mid

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

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!rocksolid2!news.neodome.net!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: 3 Feb 2024 01:23:27 -0000
Organization: Former users of Netcom shell (1989-2000)
Lines: 34
Message-ID: <upk4if$96r$1@panix2.panix.com>
References: <up8qmo$ima5$1@dont-email.me> <upe3ib$1kker$1@dont-email.me> <uphhe9$aoc$1@panix2.panix.com> <uphk35$2akla$1@dont-email.me>
Injection-Info: reader1.panix.com; posting-host="panix2.panix.com:166.84.1.2";
logging-data="17230"; mail-complaints-to="abuse@panix.com"
 by: Scott Dorsey - Sat, 3 Feb 2024 01:23 UTC

In article <uphk35$2akla$1@dont-email.me>,
=?UTF-8?Q?Arne_Vajh=C3=B8j?= <arne@vajhoej.dk> wrote:
>On 2/1/2024 8:44 PM, Scott Dorsey wrote:
>> =?UTF-8?Q?Arne_Vajh=C3=B8j?= <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.
>>
>> True, but "dispose of all memory belonging to this process" should not be
>> a big deal on a demand-paged machine. There are some architectures where
>> it can be, though.
>
>The issue is not if the process goes away but if the process
>continue after execution flow has dropped back a number of levels
>on the call stack.

Yes, but that's a different problem. I'm talking about an "abort and get
the hell out of there" routine.
--scott

--
"C'est un Nagra. C'est suisse, et tres, tres precis."

Re: BASIC (and Horizon)

<upk61d$2r6q8$10@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!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: Sat, 3 Feb 2024 01:48:30 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <upk61d$2r6q8$10@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> <updr42$1jcmi$1@dont-email.me>
<upedmp$1mjib$5@dont-email.me> <upjnlj$2p9jn$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 3 Feb 2024 01:48:30 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="30ce9394578c0c104a3323bda7e13968";
logging-data="2988872"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19wSUm+VthgS2GOmkfgBWQk"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:uxNAV6K2V5qcCPfekgmO/RHSKa0=
 by: Lawrence D'Oliv - Sat, 3 Feb 2024 01:48 UTC

On Fri, 2 Feb 2024 16:43:15 -0500, Stephen Hoffman wrote:

> No, that free ignores a null doesn't simplify the bookkeeping.

It does though, in the code example I have posted elsewhere. You can just
put a sequence of unconditional free(3) calls, which is much shorter than
useless things like

if (ptr)
free(ptr);

which I see all too often.

By the way, the C++ “delete” statement is similarly specified to treat an
attempt to dispose of a NULL pointer as a harmless no-op.

Re: BASIC (and Horizon)

<875xz531dd.fsf@eder.anydns.info>

  copy mid

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

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: a_eder_muc@web.de (Andreas Eder)
Newsgroups: comp.os.vms
Subject: Re: BASIC (and Horizon)
Date: Sat, 03 Feb 2024 18:26:38 +0100
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <875xz531dd.fsf@eder.anydns.info>
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
Injection-Info: dont-email.me; posting-host="28621a001065170fbdd0c2ff7a9bcc01";
logging-data="3397047"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18OsbxHb37sbu6MrL1G4EPe"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:euuZuFdOKNNPE3+2tn2IXrtspSY=
sha1:EtA/zf/toKcfD1eW86RPSfUIOPQ=
 by: Andreas Eder - Sat, 3 Feb 2024 17:26 UTC

On Di 30 Jan 2024 at 11:45, bill <bill.gunshannon@gmail.com> 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

So it was a Heisenbug :-)

'Andreas


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

Pages:1234
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor