If you are forced to simplify C# keywords that can be used for looping, choose only one you want to preserve.
- for
- do-while
- while
- goto-label-if
- foreach
Is there any performance consideration regarding your decision?
Actually I don’t know the internal mechanism of them, so here I want interview those of you know the details. However, someone already closed it. So sad!
goto-label-ifis not actually looping. And you missedforeach.CS theory states, that you only need
whileto express everything else (even conditional statements), so I’ll preserve it. If you were to invent truly minimal imperative programming language, subroutine calls andwhileloop will suffice.