From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HTML_FONT_LOW_CONTRAST,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10981 invoked from network); 6 Jul 2021 13:06:48 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 6 Jul 2021 13:06:48 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 385BC9CA24; Tue, 6 Jul 2021 23:06:46 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 9D8A49C9F2; Tue, 6 Jul 2021 23:05:50 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (1024-bit key; unprotected) header.d=ccc.com header.i=@ccc.com header.b="U4oI+PSO"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id C769A9C9F2; Tue, 6 Jul 2021 23:05:47 +1000 (AEST) Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) by minnie.tuhs.org (Postfix) with ESMTPS id F03E99C9F0 for ; Tue, 6 Jul 2021 23:05:46 +1000 (AEST) Received: by mail-qv1-f51.google.com with SMTP id c5so863914qvu.11 for ; Tue, 06 Jul 2021 06:05:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccc.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DOGgv//8xQz0x9L6II4+0trTaHpfqyJrZ/3hE6zrZAQ=; b=U4oI+PSOjGzmKoqyRwMqOgPdr/jvNjynBa5AjJOsGlmHdA6dZgJ7pxWZ+uCKbPFRLR TZQd/Wyb8RWg3RBw/ft8N89OkBCWdQQ3+SuD1MoOVGn1mPT0WSMxCRdjsam6p4GEoJH5 hjTC/j0G1o964mINA2XJW57SoHX6GTEnC/QOQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DOGgv//8xQz0x9L6II4+0trTaHpfqyJrZ/3hE6zrZAQ=; b=ULZAIqkb8nbY75Q+KKTrR3yWa4Y0035au4iTEA9AXFVrqrmZUG/Kj0ILR0AoiVL32F SEcYUNEV56mF5ZEK7nBbqyt//dmHv+J3eYZy5/Oxp4lfciSHte2cSMWQVS/f9ShZ+ob+ WwM1QWO1d0dXUCAd3KIg/ylr16rMIgoDJcqezUaLsRI/HLdId45ck18D9AdM/GUPh4/R d/lw529HZm6V3DSFjVHTKq1zUu/Zi3q7Slu0uxULWBpQbgai9alcjP/jbFgBEAZFCwMR yGWLM6CWKYGpNK8BvOgBiUuVagh3YrUuJ7JO6N6H8uB6PkXcqN7UIsqQ7kc4OGZvjRxZ IZGQ== X-Gm-Message-State: AOAM532bUGxLLZiKKrQtpJ3tBS7tm8lnnhQdg2VtIo4krjWCXW00Daio 82Op6IZS08x0SNFvoDwXIIU0CFHn8DlOOr+1Ne15Ag== X-Google-Smtp-Source: ABdhPJxg2YK4qdB1gGJg3KTdvCOzAB2F5pHs7T2SM7KTj+PsRRLvXUqz1rRv2dk5VbFI3WhxwcqcXrzBboRQlyQhqLA= X-Received: by 2002:a0c:e087:: with SMTP id l7mr17980259qvk.22.1625576745971; Tue, 06 Jul 2021 06:05:45 -0700 (PDT) MIME-Version: 1.0 References: <20210702213648.GW817@mcvoy.com> <20210705002119.GL817@mcvoy.com> <20210705034751.GU817@mcvoy.com> <20210705134522.nzyIC%steffen@sdaoden.eu> In-Reply-To: From: Clem Cole Date: Tue, 6 Jul 2021 09:05:19 -0400 Message-ID: To: Dan Stromberg Content-Type: multipart/alternative; boundary="0000000000007fc36805c67414db" Subject: Re: [TUHS] Is C obsolete? (was Re: [tuhs] The Unix shell: a 50-year view) X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: The Unix Heritage Society mailing list Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --0000000000007fc36805c67414db Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Exactly my point - *theory vs practice*. It can be a petri dish, but that is *not necessarily* a bad thing. Different extended Pascal/Mod-2* et al *= all 'fixed' the string data type in some manner (not even saying the different solutions are good or bad). But it always comes back to what was (*is*) theory *vs*. practice. As others have pointed out. In the case of Strings, you either made them more like C strings or you made them basically useless - because, in practice, the null-terminated string works pretty darned well for production code and can be made to be secure, but the programmer can not be lazy. Hey, I personally look like Pascal for what it is and I still think it's the best teaching tool, particularly with Clancy and Cooper's book for beginning programmers. I personally learned both languages around the same time, but I had already been writing in a number of assemblers, BASIC, Fortran, Algol-W, SAIL, and BLISS before I saw either. I've more written way more C code than any other language --- why because it works and as a professional, I know how to properly use it. As bwk says in that same document which I pointed to earlier, "comparing C and Pascal is the same as trying to compare a jetfighter with a Piper Cub." As my former Marine pilot B-I-L reminds me, he did not start pilot training in Whidbey Island on jets - he worked his way up and showed he was competent before the Navy made it easier for him to kill himself (and those around him). BTW: the Navy does not tend to try to land small prop planes on the USS Kennedy either. As my B-I-L says for all of his day and night landings on same, he always somewhat scared the cr*p out him but he was always careful to remember what he had been taught (and he says he never had to use the 3 wire). The bottom line becomes learning to pick and then using the proper tool for the job and respect what is for and the constraints associated with using it. Clem =E1=90=A7 On Tue, Jul 6, 2021 at 12:35 AM Dan Stromberg wrote: > > On Mon, Jul 5, 2021 at 2:29 PM Clem Cole wrote: > >> >> On Mon, Jul 5, 2021 at 4:16 PM Dan Stromberg wrote= : >> >>> A null-terminated array of char is a petri dish. A proper string type >>> is more like a disinfectant. >>> >> Hrrmpt.... maybe (in theory), but I can say that never seen it really >> work in practice -- bwk in Why Pascal is Not My Favorite Programming >> Language describes much >> of the practical realities of this sort of choice: >> > > I think language designers since Pascal have learned from Pascal's mistak= e > there. > > Supposedly even Borland's TurboPascal had better strings than vanilla > Pascal. > --0000000000007fc36805c67414db Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Exactly my point - theory=C2=A0vs practice.=C2= =A0 It can be a petri=C2=A0dish, but that is not necessarily = a bad thing.=C2=A0 Different extended Pascal/Mod-2 et al all 'fi= xed' the=C2=A0string data type in some manner (not even saying the diff= erent=C2=A0solutions are good or bad).=C2=A0 But it always comes back to wh= at was (*is*) theory vs. practice.=C2=A0 As others have pointed out.= =C2=A0 In the case of Strings, you either made them more like C strings or = you made them basically useless - because, in practice, the null-terminated= string works pretty darned well for production code and can be made=C2=A0t= o be secure,=C2=A0but the programmer can not be lazy.

= Hey, I personally look like Pascal for what it is and I still think it'= s the best teaching tool, particularly with Clancy and Cooper's book fo= r beginning programmers.=C2=A0 I personally learned both languages around t= he same time, but I had already been writing in a number of assemblers, BAS= IC, Fortran, Algol-W, SAIL, and BLISS before I saw either.=C2=A0 I've m= ore written way more C code than any other language --- why because it work= s and as a professional, I know how to properly use it.

<= div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif= ">As bwk says in that same document which I pointed to earlier, "compa= ring C and Pascal is the same as trying to compare a jetfighter with a Pipe= r Cub."=C2=A0 As my former Marine pilot B-I-L reminds me, he did not s= tart pilot training=C2=A0in Whidbey=C2=A0Island on jets - he worked his way= up and showed he was competent=C2=A0before the Navy made it easier for him= to kill himself (and those around him).=C2=A0 BTW: the Navy does not tend = to try to land small prop planes on the USS Kennedy either.=C2=A0 As my B-I= -L=C2=A0says for all of his day and night landings on same, he always somew= hat scared the cr*p out him but he was always careful to remember what he h= ad been taught (and he says he never had to use the 3 wire).

The bottom line becomes learning to pick and then using the proper t= ool for the job and respect what is for and the constraints associated with= using it.

Clem
3D""=E1=90=A7
On Tue, = Jul 6, 2021 at 12:35 AM Dan Stromberg <drsalists@gmail.com> wrote:

On Mon, Jul 5, 2= 021 at 2:29 PM Clem Cole <clemc@ccc.com> wrote:

On Mon, Jul 5, 2021 at 4:16 PM Dan Stromberg = <drsalists@gmai= l.com> wrote:
A null-terminated array of char is a= petri dish.=C2=A0 A proper string type is more like a disinfectant.
Hrrmpt.... maybe (in theory), but I can say that never seen it really work= in practice --=C2=A0 bwk in=C2=A0Why Pascal is Not My Favorite Programmi= ng Language=C2=A0describes=C2=A0much of the practical realities of this= sort of choice:

I think = language designers since Pascal have learned from Pascal's mistake ther= e.

Supposedly even Borland's TurboPascal had b= etter strings than vanilla Pascal.
--0000000000007fc36805c67414db--