Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: public API (methods) first in classes #8

Closed
vicb opened this issue May 21, 2015 · 1 comment
Closed

[Question]: public API (methods) first in classes #8

vicb opened this issue May 21, 2015 · 1 comment

Comments

@vicb
Copy link
Contributor

vicb commented May 21, 2015

IMO having public API before private methods in class is nice.

Could this be automatically changed by clang-format ?
(an other question is do we really want to do this, open for debate).

@vicb vicb changed the title [Question]: public API first [Question]: public API first in classes May 21, 2015
@vicb vicb changed the title [Question]: public API first in classes [Question]: public API (methods) first in classes May 21, 2015
@mprobst
Copy link
Contributor

mprobst commented May 21, 2015

Moving code around (not just whitespace) is a pretty invasive change. I think that code authors often express intent or grouping by their code ordering, e.g. have a public method and then all its helpers, then have another public method and its helpers, and so on.

I remember tools like Eclipse used to support moving methods around in Java code, but I think that feature never got popular or commonly used, for exactly these reasons.

So I don't think moving around code like that is a good idea. On top of that, the current infrastructure/approach taken in clang-format would make this very hard to do.

@mprobst mprobst closed this as completed May 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants