Type safety + auto = win!
David Nadlinger
see at klickverbot.at
Fri Jul 27 15:25:46 PDT 2012
You might want to turn this into a blog post. This way it'd much
better usable for … ehm … propaganda purposes than a forum
entry. Just sayin'. ;)
David
On Friday, 27 July 2012 at 22:18:56 UTC, Nathan M. Swan wrote:
> A story:
>
> Playing around with functional programming, I started trying to
> implement interesting functions in Lisp. It all went well until
> "permute", a function which isn't that complicated but involves
> lists, lists of lists, and lists of lists of lists. This was so
> confusing and complicated that I gave up.
>
> More recently, I tried it again in Haskell. It took less than
> twenty minutes! The reason was Haskell's type declarations,
> which made it so much easier to think about what was going in
> and out.
>
> How this relates to D:
>
> The type system can often get annoying, and become a pain (e.g.
> Java), hence the popularity of dynamic typing
> (Python/Ruby/Ecmascript). But when thinking about complicated
> algorithms and systems, they are a great structuring force.
> Which is part of why I love D: "auto" and "Variant" lets you
> forget about a lot of it, but you can still be explicit when it
> is important.
>
> My two cents,
> NMS
More information about the Digitalmars-d
mailing list