Are there any default dmd optimizations

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Feb 26 12:49:42 PST 2013


On Tue, Feb 26, 2013 at 09:41:09PM +0100, Andrej Mitrovic wrote:
> On 2/26/13, H. S. Teoh <hsteoh at quickfur.ath.cx> wrote:
> > Most just have outdated comments (if at all!)
> 
> Some projects even maintain documentation *separately* from the
> codebase, which leads to a ton of outdated stuff. For example look at
> the list of documentation fixes I made for wxWidgets:
> http://trac.wxwidgets.org/query?reporter=drey&order=priority

I thought that was the norm? Especially in the realm of open source, the
problem of docs mismatching implementation is sadly very prevalent.

The thing is, when code comments are so poor, nobody would even imagine
using them as user-consumable docs. And so docs are written separately.
But coders love to code; docs are in another format in another subdir,
who cares about updating it when you just have a 1-line fix?

It's a totally different ball game when the ddoc comments are staring
you in the face, right in the source code, crying out "update me! update
me!".

I'm not pretending that it solves the mismatch problem entirely, of
course. You *can* still change the code without updating the ddocs. But
you're much more likely to update it because it's right there in front
of you, not somewhere else in some obscure subdirectory, out of sight
and out of mind. I'd even say having the ddocs embedded in the code
*shames* you into updating it, in much the same way as built-in unittest
blocks shames you into writing them (so much so, that just this past few
days, upon revisiting some of my earlier D code, I was horrified at the
huge swaths of unittest-free code -- writing unittests have become such
a habit to me now -- and now I feel too ashamed to not start writing
unittests for that code).


T

-- 
Many open minds should be closed for repairs. -- K5 user


More information about the Digitalmars-d mailing list