Impressed

Jonathan M Davis jmdavisProg at gmx.com
Thu Jul 26 17:25:37 PDT 2012


On Thursday, July 26, 2012 17:18:38 H. S. Teoh wrote:
> On Fri, Jul 27, 2012 at 01:59:12AM +0200, Stuart wrote:
> > I'm quite new to D, and I've just been reading the guides. I just
> > wanted to say I'm very impressed with some of the features I'm reading
> > about. Slices, closures, the scope keyword(!!!), class variable
> > initialisers, anonymous array literals, array concatenation,
> > synchronisation... even decent exception support is a breath of fresh
> > air compared to C++.
> 
> I think certain usages of the scope keyword is being phased out?
> (Somebody else can clarify this.)

scope on local variables is going to be deprecated, because it's unsafe. scope 
on function parameters and scope statements are here to stay.

> [...]
> 
> > Why does D have GOTO? I haven't used GOTO in over a decade, because
> > it's truly evil.
> 
> You don't have to use it. In my experience with C++ and D, I've never
> needed to use goto. (I do use it sometimes in C mainly because error
> handling is so horrible in C otherwise.)

If you're using goto much in code, then you're doing somethnig wrong, but it 
would be a problem for a systems language _not_ to have a goto statement. On 
rare occasions (especially when writing low level code), they end up being 
very useful.

Now, D has made goto even less necessary than it is in most languages (e.g. it 
has labeled break and labeled continue which go to a label in a loop), but the 
language should still have it.

- Jonathan M Davis


More information about the Digitalmars-d mailing list