The design principles of D (aka The D Manifesto)
Michal Minich
michal.minich at gmail.com
Sun Jun 13 11:49:44 PDT 2010
On Sun, 13 Jun 2010 18:01:23 +0000, dsimcha wrote:
> The one that seems to resonate most strongly throughout the design of D
> is "thou shalt not need to write boilerplate code". The inclusion of
> features such as mixins, properties, ranges, highly streamlined operator
> overloading and a template system much more powerful than C++'s means
> that if you're writing lots boilerplate code in D, there's probably a
> template function, struct or class of some kind that you need to write
> that will do it for you. Contrast this to Java, where boilerplate code
> is so prevalent that IDE features are designed specifically to write it
> for you, or to C++, where people insist that having to write tons of
> boilerplate to do even the simplest thing is just the price you pay for
> flexibility.
Very good point IMO. By using opposite word "DRY", it could be said that
D is designed to you keep you programs DRY, and makes it very easy and
natural thing to do. If one finds himself repeating code, he should
consult docs, or ask on NG.
One important thing I can think out right now is that it is natural for D
to have safe abstractions. Either by creating them upon built-in types
like arrays and strings or by using compile time techniques for advanced
type checking.
Also, it might be good remind C programmers that exceptions are generally
preferred error handling mechanism in D.
More information about the Digitalmars-d
mailing list