Liste des Groupes | Revenir à cl c |
On 14.04.2025 17:22, bart wrote:
(It's nonsense to make up an "argument" for 'goto'.)The fastest bytecode interpreters in C, at present rely on using 'computed goto' (although along with label pointers, an extension).
And that's the kind of remark that shows you haven't a clue about ergonomic language design. Why deliberately design a feature with so many extra, undetectable, error opportunities?This is the kind of error I was making all the time (writing the firstThat first of all means that you are obviously a sloppy programmer.
line, copying it, but forgetting to convert all the variables):
>
for(i=0; i < M; ++i)
for(j=0; j < N; ++i)
(There's something I've heard about in the 1990's, "PSP", "PersonalThat's brilliant, thanks. So when I'm finding it incredibly error-prone to write my applications in 100% assembly, it's nothing at all to do with the poor choice of language, I'm just incredibly sloppy, and that web-site will help me!
Software Process"[*], that might help you increase your success rate
by reducing common errors you make.)
[*] https://en.wikipedia.org/wiki/Personal_software_process
I agree with Wirth. Anything unusual can be trivially expressed with WHILE. Most languages support WHILE, and so can express anything that C's FOR loop can.>This number, I think, may be close to reality. - I want to remind
Here, it is not an advantage. I once asked David Brown how many of his
for-loops were simple iteration; I think he said 98.5%.
that N. Wirth gave such informal statistics as rationale for Pascal
only supporting for-loops with increment and decrement values of 1.
Now that is strange. - Before[*] you argued on a 'while' example:Do you understand WHY it was a poor choice? Clearly not. It was poor choice because you used WHILE to implement a simple iteration of 'i' over 'a' to b'. That is *exactly* what FOR should be used for.
"That would be a poor use of 'while'. And bizarre, to use
'while' for iteration, but 'for' for loops that are best
written as while!"
There's a few properties that you have problems with that lie notSo, in your opinion, that issue I had was 100% my fault, and 0% due to poor language design?
within the language but are inherent part of your personality. -
You clearly exposed two of them; above your problem of handling
your copy/paste programming errors ("PSP")
Even for 99.9% of loops where you increment by one? Yikes!Yes. - Either i++ or i+=2 or z*=10 or r<<=4 or ...>>>
* C needs you to specify how to increment the loop index
Of course; another advantage! (And this is common in many
programming languages, older and newer ones.)
You need to tell the computer how to count? OK!
You say OK but you don't see the obvious applications, do you?It's very simple:
That doesn't make the crude and limited Fortran 'for' loopIt is yet another advantage that C doesn't have, and which other languages have had to introduce.
any better only because it has a "100 continue" or "end do".
Having end-tags doesn't make Fortran a good language or its 'do'Why? It works and it's simple. You need 4 things to denote a loop header with an index variable:
loop a good syntax.
(Both are poor design choices. Leave off one # or CO, and everthing gets out of step. And it means you can't comment out code that contains comments. See it's not just C I can criticise.)(Note: Algol68 comments need a trailing # too.)Yes, I know. I added that '#' for posting only. (Despite '#' is
[pairwise] usable in the Genie context I'm nonetheless using
the classical and portable CO ... CO in my programs instead.)
(Oh, right, and obviously also about your language/preferences.)You tried to assert some superiority by describing Algol68 features, but forgot that my language was originally based on Algol68 syntax. Obviously tweaked to get bad parts out.
The whole "C" language is "primitive" (in some respects) ifYes. (Why do I find it suprising to see you admit that?)
compared to other HLLs.
Where you think a terse DO OD is best others might prefer to seeHuh? Empty {} blocks occur in C too; they don't need a comment. Maybe the contents are yet to be written, or are commented out.
it documented DO # nothing to do # OD and are delighted if that
"comment" is even standardized by a clear 'NOP' as in DO SKIP OD .
Les messages affichés proviennent d'usenet.