Re: Loops (was Re: do { quit; } else { })

Liste des GroupesRevenir à cl c 
Sujet : Re: Loops (was Re: do { quit; } else { })
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.c
Date : 22. Apr 2025, 08:54:36
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vu7hvu$5cl0$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 21.04.2025 17:36, bart wrote:
On 21/04/2025 14:51, Waldek Hebisch wrote:
>
[ sqlite3.c code ]
 
You have to analyse it first. The kind of loop this expresses is:

No. That's just *your* _transcription_ of the original code

   p = startvalue()
 
   while (p) {
      <body>
      p = nextvalue()
   }
 
Notice how I chose to express it: it reflects how I would describe it in
English:

You are *not* describing _the task_, you are merely translating the
_chosen commands_ of the procedural language [that you have chosen]

 
   * Set P to Start Value
   * While P isn't Null:
     * Execute the body
     * Set P to Next Value

Whatever programming language and constructs you use, this is not
more than a rephrasing the used language constructs (as opposed to
the task).

(It's not surprising; you can observe that folks that are familiar
only with imperative languages tend to this sort of fallacy.)

So, how would /you/ describe it in English? (Or in any language if like,
as the ordering is more important.)

Iterate over the elements and sequentially perform <the task> on
the elements. Or a bit more formally

  iterate (elements, task)

in some functional programming language. Or any other variant on
any abstraction level that is appropriate.

[...]
 
However I see that nobody in this group has any objective interest in
language ergonomics and aesthetics.

Nonsense.

They more interested in defending 'their' language.

Nonsense.

Janis


Date Sujet#  Auteur
17 Mar 26 o 

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal