Does D have too many features?

Don Clugston dac at nospam.com
Mon Apr 30 00:44:30 PDT 2012


On 30/04/12 05:45, H. S. Teoh wrote:
> On Sun, Apr 29, 2012 at 04:40:37PM +0200, Jacob Carlborg wrote:
> [...]
>> * Do-while loops, how useful are those actually?

I grepped through the DMD source once, looking for how often Walter uses 
do..while. The answer: exactly zero.

>
> OK, that got me all riled up about looping constructs, and now I'm
> provoked to rant:
>
> Since the advent of structured programming, looping constructs have
> always been somewhat b0rken. Yes they worked very well, they are clean,
> powerful, gets rid of almost all cases of needing goto's, etc.. But the
> point of a loop is that *the entry point does not always correspond with
> the exit point (where the loop condition is tested)*. The problem with
> both do-loops and while-loops is that they are just straitjacketed
> versions of a more general looping construct.

Completely agree. Forth is one of the few languages which got it right.

BEGIN
....
cond WHILE
...
REPEAT



More information about the Digitalmars-d mailing list