Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Baby On Board.


devel / comp.lang.c / Re: No, C is not a simple language

SubjectAuthor
o Re: No, C is not a simple languageChris M. Thomasson

1
Re: No, C is not a simple language

<s6b1a3$152b$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16019&group=comp.lang.c#16019

  copy link   Newsgroups: comp.lang.c++ comp.lang.c
Path: i2pn2.org!i2pn.org!aioe.org!NBiuIU74OKL7NpIOsbuNjQ.user.gioia.aioe.org.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++,comp.lang.c
Subject: Re: No, C is not a simple language
Date: Wed, 28 Apr 2021 00:02:28 -0700
Organization: Aioe.org NNTP Server
Lines: 61
Message-ID: <s6b1a3$152b$1@gioia.aioe.org>
References: <s5dtao$1aj9$1@gioia.aioe.org> <s5f4u8$1t7u$1@gioia.aioe.org>
NNTP-Posting-Host: NBiuIU74OKL7NpIOsbuNjQ.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.10.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Chris M. Thomasson - Wed, 28 Apr 2021 07:02 UTC

On 4/17/2021 10:12 AM, Manfred wrote:
> (cross-posting to comp.lang.c to let the heat fire up)
>
> On 4/17/2021 7:56 AM, Juha Nieminen wrote:
>> I know that this is probably going to piss off avid C programmers,
>> but I don't really care all that much.
>
> Excellent start
>
> [...]
>>
>> I myself happen to know both languages quite well, and in fact I
>> program in both languages as my profession, and I would say that
>> I am very knowledgeable and proficient in both languages and have
>> no trouble in developing in either one. I am of the strong opinion
>> that no, C is not a "simple" language, and that C++ makes so many
>> things so much simpler, easier and safer.
>>
>> I was reminded of this in a quite concrete manner recently when I was
>> trying to help a beginner programmer who had decided to try his hands
>> on C, and wanted to create a simple text editor, which would read a
>> text file, allow the user to edit the text in several ways, and to
>> save the file.
>>
>> It quite quickly turned very frustrating for *both* of us ...
>
> The first comment that comes to mind is that probably part of the
> frustration stems from your approach (no offense) to try and use in C a
> design that would be suitable for C++ instead. Despite their name, the
> two are quite different languages. The similarities are about their
> runtime footprint, not about how they are used.
>
> For example, at a first glance the design of string object is not that
> great for C.
> A common pattern that pops to the mind is to use opaque structs (see
> e.g. FILE*), and have something like:
>
> typedef struct string_t STRING;
>
> STRING* alloc_string(); // creates the empty string
> STRING* set_string(STRING* s, const char* value);
> void free_string(STRING* s);
> STRING* concat_string(STRING* s1, STRING* s2);
> ...
>
> This way there would be no ambiguity about how the STRING object has to
> be used.
> And yes, in C you have to do all yourself - C is a low level language,
> and it is meant for low level stuff. It is hardly the right tool for
> anything meant to interface with a human user - it is (still) great for
> system programming and back-end processing, IMO.
>
> As second, I agree with Jacob that a text editor is a simple tool, but
> it is not easy to make expecially for a beginner.
>
>
> [snip]

Wrt using GC as the everlasting crutch:

https://youtu.be/ao-Sahfy7Hg

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor