3 ms·
Many control flow instructions can be expressed as other instructions. The idea of the article was to promote higher level, less ambiguous and less ubiquitous i
by pyrale 3y ago
Many control flow instructions can be expressed as other instructions. The idea of the article was to promote higher level, less ambiguous and less ubiquitous instructions.
Sure, you can express a for-loop in terms of goto. But when you read a for-loop, there are many things you're guaranteed won't happen that could with a goto. In that sense, it takes less attention to make a good for-loop. And a for-loop iterating over a collection also takes less attention than one with a manually-crafted iteration check.
That's the whole point of the article: lower-level instructions should be wrapped in higher-level instruction, more specialized and with less footguns.