While I agree that using auto makes it easier for the code writer, this
particular comment of mine was motivated by the following snippet elsewhere
in our code:



auto foundObject
            = XMLHandle(*listingResultXml)
            .FirstChildElement("ListBucketResult")
            .FirstChildElement("Contents")
            .ToElement();


Now at the time of writing it was no doubt clear for the writer of this
code what the type of foundObject was. However, for someone coming to the
code fresh it is quite tedious to go to process of finding the type of the
end result when simply putting the type instead of auto would have had
immediate documentation value. Now there are some cases when using auto is
not big deal as in


On Tue, May 20, 2014 at 5:35 PM, Mark S. Weiss <notifications@github.com>wrote:

> In rtbkit/plugins/bidder_interface/http_bidder_interface.cc:
>
> >  }
> >
> >  void HttpBidderInterface::send(std::shared_ptr<PostAuctionEvent> const & event) {
> >  }
> >
> > +void HttpBidderInterface::tagRequest(OpenRTB::BidRequest &request,
> > +                                     const std::map<std::string, BidInfo> &bidders) const
> > +{
> > +
> > +    for (const auto &bidder: bidders) {
> > +        const auto &agentConfig = bidder.second.agentConfig;
>
> This is a public open source project designed to last for years and be
> used by thousands. As such, yes, my position is that we should optimize for
> reading of code, not writing of code.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/datacratic/rtbkit/pull/27/files#r12869704>
> .
>