Liste des Groupes | Revenir à cl c |
bart <bc@freeuk.com> wrote:t iteration goes over all elements in the hash table.
BTW2: When looking at 'for' loop you are supposed to see pattern,That's one of the disadvantages of using the same, often /inappropriate/ keyword for every kind of pattern.
without need to track all steps.
The intent of 'for' is to iterate over some collection. Each ofSure, but ALL ON THE SAME LINE? All within the same parentheses? Putting multiple things on the same line is usually frowned upon. Look at these ludicrous examples:
A, B, C is needed to know the collection.
I've seen plenty of for-loops that start with 'for (;...)'; that doesn't seem to worry anyone! Which is not surprising; nobody seems to care anything here.Especially A, which is only executed once, after which it's no longerWithout A you do not know range of iteration.
part of the loop.
How complicated was a 1950s Fortran compiler? A 1964 BASIC interpreter?I expect you also either think that:In 1975 C version was better: it allowed flexible loops using very
>
for (ch = 0; ch <= 255; ++ch)
>
is better than: 'do ch = 0, 255', or is much more tolerant of it than I am.
simple compiler.
But saying that C is bad rarely brings someting new, people hereAnd yet, even within the limitations of C, people favour writing appalling code, when it could be much cleaner. So (1) they don't care; and (2) try to justify that bad code as being better.
know most of C warts and have ways to cope with them. If they
thought that some other language is really better they would use
it instead of C. FYI, I do probably majority of my coding in
different languages.
Les messages affichés proviennent d'usenet.