D vs C++

spir denis.spir at gmail.com
Sun Dec 26 03:16:11 PST 2010


On Sun, 26 Dec 2010 00:45:42 -0500
bearophile <bearophileHUGS at lycos.com> wrote:

> You need to add some shades of grey to your palette. break, continue and goto are bad, and it's better to limit their usage.

You need to soften your rocks of certitudes, Bearophile.

	cycle
	   (action0)
	    if condition continue/break
	    action

is a common scheme. Existence of continue/break allows simple, clear, correct expression of this scheme. By "correct", I mean they mirror what they mean. Without them, we are left to _wrong_, or even more wrong, convolutions that do not easily show the sense of the code.
Either there is no structured programming structure to idiom for that, or it is precisely using those magic keywords. Lua has no continue: it is a pain and a constant request (even if far less often needed than break).
Byt I agree the originally posted code did not require it.

Denis
-- -- -- -- -- -- --
vit esse estrany ☣

spir.wikidot.com



More information about the Digitalmars-d mailing list