User talk:Idrougge: Difference between revisions

m
→‎Loops/For: expanded the wording and explanation.
m (→‎adding other examples: added some comments concerning egoless programming.)
m (→‎Loops/For: expanded the wording and explanation.)
 
(One intermediate revision by the same user not shown)
Line 200:
 
I just noticed that the text of the Rosetta Code task &nbsp; ''palindrome detection'' &nbsp; had changed (apparently, some time ago), so I deleted my 2<sup>nd</sup> REXX version and re-did version 1 to comply with the new task's requirements. &nbsp; Even after the wording in the task prologue and task requirements changed, it still seems a bit fuzzy and slightly contradictory (see the talk section). &nbsp; But, it was the author's first attempt at a Rosetta Code task, so there's that. &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 02:45, 14 September 2015 (UTC)
 
 
== Loops/For ==
 
The Rosetta Code task requirement(s) &nbsp; '''Loops/For''' &nbsp; states:
 
Show how two loops may be nested within each other,
with the number of iterations performed by the
inner &nbsp;<big>'''for'''</big>&nbsp; loop being controlled by the
outer &nbsp;<big>'''for'''</big>&nbsp; loop.
 
 
(The highlighting was added by me. &nbsp; Note that both inner and outer loops are both '''FOR''' loops.)
 
This particular Rosetta Code task isn't about using the simplest '''DO''' loop, &nbsp; but to demonstrate how the outer '''DO''' loop with a '''FOR''' construct is to control the inner '''DO''' loop with a '''FOR''' construct. &nbsp; I do agree that the inner '''DO''' loop can be coded more simpler, &nbsp; (and indeed, it could've even been coded without a '''DO''' loop), &nbsp; but the task's requirements dictated/directed otherwise. &nbsp; I don't know if the task's author had in mind '''DO''' loops or '''FOR''' loops, &nbsp; but I interpreted the author's intent as a '''DO''' loop with a '''FOR''' keyword to control the number of iterations, &nbsp; which is the closest construct that REXX has to mimic a '''FOR''' statement that is used in other computer programming languages. &nbsp; &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 19:49, 4 June 2020 (UTC)