mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Bannier <benjamin.bann...@mesosphere.io>
Subject Re: Review Request 58043: Cleanup usage of namespace-qualified identifiers.
Date Mon, 03 Apr 2017 09:06:34 GMT


> On March 30, 2017, 10:36 a.m., Benjamin Bannier wrote:
> > src/checks/checker.cpp
> > Line 1 (original), 1 (patched)
> > <https://reviews.apache.org/r/58043/diff/1/?file=1679973#file1679973line1>
> >
> >     Since you focus on `std::string` and `testing::WithParamInterface` in this patch,
could you make sure we have consistent `using` decls and stripped namespace qualifiers everywhere
in the code base? We do not always us `using` decls for everything (sometimes it would just
be confusing or cause clashes), but we should be able to treat the ones you tackle here consistently.
> >     
> >         % git grep std::string src | grep -v 'using' | grep -v '.hpp:' | wc -l
> >           94
> >           
> >         % git grep testing::WithParamInterface src | grep -v 'using' | wc -l
> >           8
> 
> Neil Conway wrote:
>     I'm not sure I agree with always adding `using` for all instances of a given identifier
in the codebase -- if a `.cpp` file only uses `std::string` once, I think we need to require
that they add `using std::string;`.
>     
>     A few places were using a fully-qualified identifier quite a few times, which I agree
makes sense to replace with `using` instead. This review fixes the worst offenders: https://reviews.apache.org/r/58084/

> I'm not sure I agree with always adding using for all instances of a given identifier
in the codebase -- if a .cpp file only uses std::string once, I think we need to require that
they add using std::string;.

I assume you meant _do **not** need_ above?

I believe tieing the use of `using` decls to the number of users of that identifier in the
file doesn't scale well and leads to inconsistencies; much simpler would be to _always_ consistently
use `using` decls for certain symbols like e.g., `string` when they are introduced in implementation
files, indepdently of the numeber of users.


- Benjamin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58043/#review170549
-----------------------------------------------------------


On March 29, 2017, 9:43 p.m., Neil Conway wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58043/
> -----------------------------------------------------------
> 
> (Updated March 29, 2017, 9:43 p.m.)
> 
> 
> Review request for mesos and Benjamin Bannier.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Cleanup usage of namespace-qualified identifiers.
> 
> 
> Diffs
> -----
> 
>   src/checks/checker.cpp 314354cc374b453ec12e25e3d4730a92697468cf 
>   src/tests/default_executor_tests.cpp 6dadd8937eb6809bcb0aca55fab1cb7f17c3262f 
> 
> 
> Diff: https://reviews.apache.org/r/58043/diff/1/
> 
> 
> Testing
> -------
> 
> `make check`
> 
> 
> Thanks,
> 
> Neil Conway
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message