Hit return too early in the last comment :-)

...is not a big deal as for instance if we have:

std::vector<int> someList;

auto iter = someList.find(1);

instead of

std::vector<int>::const_iterator iter = someList.find(1);

No doubt it will require some judgement for the grey areas in between but
IMO it's worthwhile to keep the readability angle in mind.

Just my $0.02 worth

Sunil




On Tue, May 20, 2014 at 6:24 PM, Sunil Rottoo <sunil@datacratic.com> wrote:

> 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>
>> .
>>
>
>