D vs C++

bearophile bearophileHUGS at lycos.com
Sat Dec 25 21:45:42 PST 2010


Walter Bright:

> I thought the idea that break and continue were bad died about 25 years ago. 
> Pascal didn't allow them, and pretty much everyone hated the workaround of 
> having to use flag variables.

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. But unless you are using very strict coding guidelines, you can use them where not using them produces worse code. Computed gotos are worse than normal gotos, but they too are sometimes useful (there is right now a person that asks for them in D.learn).

Bye,
bearophile


More information about the Digitalmars-d mailing list