willzhang05 / twitter-location-test

Testing prediction of location with the Twitter API
MIT License
0 stars 0 forks source link

Take better advantage of stdlib #3

Open pefoley2 opened 8 years ago

pefoley2 commented 8 years ago

string command should really be a stringbuffer. Don't re-invent the wheel, use std::pair, not struct attribs.

ghost commented 8 years ago

I don't really agree; the name std::pair is vague at best, and fails to provide customizable functionality. Of course you could attempt to remedy this issue by writing something like:

typedef std::pair<std::string, std::string> whatever; but the names "first" and "second" also aren't very descriptive either. For that reason I almost never use std::pair, unless I am seriously pressed for time (I usually never am). In any case, it's a matter of personal preference, and probably shouldn't be marked as an issue.

pefoley2 commented 8 years ago

There's a reason we have libraries, it's almost never advisable to open-code something that has been part of the stdlib for decades. I see no compelling reason to have a custom struct.