Phobos examples and auto

Walter Bright newshound2 at digitalmars.com
Sat Nov 5 13:17:03 PDT 2011


On 11/5/2011 12:49 PM, Andrei Alexandrescu wrote:
> On 11/5/11 1:48 PM, Walter Bright wrote:
>> I agree.
>
> It's tricky. One simple fact that's been verified again and again is that
> documentation examples tend to be used a lot. They effectively are powerful
> style influencers for people learning the language.
>
> If we avoid "auto" in documentation examples but we do use it in everyday code,
> we effectively foster a style that's foreign and non-idiomatic to newcomers.
>
> Sample code should mimic real code. If real code would use auto, sample code
> should use auto.

Also a great point. The issue I have with auto in the library doc is I want to 
know what the function is returning. For example, is it a range or an int?


More information about the Digitalmars-d mailing list