A summary of D's design principles

dsimcha dsimcha at yahoo.com
Wed Sep 15 12:09:08 PDT 2010


== Quote from Andrei Alexandrescu (SeeWebsiteForEmail at erdani.org)'s article
> A coworker asked me where he could find a brief document of D's design
> principles. This was after I'd mentioned the "no function hijacking" stance.
> I think it would be a great idea if the up-and-coming
> www.d-programming-language.org contained such a document.
> Ideas for what it could contain? I know we discussed this once in the
> past, but couldn't find the discussion.
> Andrei

1.  Thou shalt not write boilerplate code.  If thou must write boilerplate code,
thy language doth not provide sufficient abstraction capabilities.

2.  We're consenting adults, but we're not suicidal maniacs.  Safety matters, but
in the end the programmer knows best.

3.  Generic solutions must be as fast as equivalent hand-coded solutions.

4.  If the compiler knows it, there should be an easy way for the programmer to
introspect it.

5.  User defined types must have access to all features of builtin types.

6.  Costly abstractions are a dime a dozen.  Abstractions that can be used in
performance-critical code are a real achievement.

7.  Practicality beats purity.  (Shamelessly stolen from Python, but perhaps even
more applicable to D.)


More information about the Digitalmars-d mailing list