Phobos examples and auto

Walter Bright newshound2 at digitalmars.com
Sat Nov 5 11:48:56 PDT 2011


On 11/5/2011 10:42 AM, Steve Teale wrote:
> There's a growing tendency in Phobos documentation to use auto.
>
> auto now = Clock.currTime();
>
> Now I can understand that when the RHS is some obscure template, whose
> type might not be immediately obvious, the user should possibly be
> encouraged to RTFM. But if the outcome is deterministic I just have the
> feeling that documentation should provide information rather than hiding
> it.
>
> OK, in Jonathan's example, this is preceded by a sentence that says that
> the result is a SysTime. But the auto made me forget, and wonder what it
> was, rather than reinforcing the preceding sentence.
>
> I realize that this is probably a trivial point, but at the same time, in
> documentation, clarity is wonderful.

I agree.


More information about the Digitalmars-d mailing list