dynamic classes and duck typing

dsimcha dsimcha at yahoo.com
Tue Dec 1 18:08:10 PST 2009


== Quote from Walter Bright (newshound1 at digitalmars.com)'s article
> D has three: RAII, scope guard, and try-catch-finally. As far as I'm
> concerned, the only reason t-c-f isn't taken out to the woodshed and
> shot is to make it easy to translate code from other languages to D.

I've literally never written a finally block in my life in D because scope
statements and RAII are just that good.  Does anyone, other than a few beginners
who were unaware of scope guards, use finally?  I'm half-tempted to say we should
just axe it.  It's an error prone legacy feature that's completely useless for any
purpose except writing Java or C# code in D.  Since we're looking to lighten the
spec, ditching finally would do so, and it would encourage converts from Java and
C# to learn a better way of doing clean-up code.



More information about the Digitalmars-d mailing list