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

pointer and ref are middle aligned #19

Open
mpreisler opened this issue Jun 4, 2018 · 3 comments
Open

pointer and ref are middle aligned #19

mpreisler opened this issue Jun 4, 2018 · 3 comments

Comments

@mpreisler
Copy link
Member

It's a personal preference but I will go ahead and complain about it anyway :-P

Consider this:
a * b - at first glance you are not sure if it's a multiplied by b or a pointer to a stored in b.
a & b - bitwise and or ref?
const a & b

IMO stick to industry standards, nobody cares if it's a *b or a* b but a * b is super rare and weird... I personally prefer a* b but as long as it's not in the middle I am fine and can read it quickly.

@matejak
Copy link
Collaborator

matejak commented Jul 10, 2018

As you have mentioned, there are reasons why left-align as well as reasons for right-aligning. My view is that every reason why to right-align is a reason why not to left-align, and vice versa. Having the operator in the middle doesn't shouldn't mislead anyone, unlike e.g. int* i, j;. I think that it is a matter of taste, so try give it a go.
There is a astyle runner resources/utilities/run-astyle.sh, so switching from one way to the other should be rather easy, and if it will keep causing you pain for a long time, feel free to submit a PR that changes that.

@mpreisler
Copy link
Member Author

It's like driving on the left side of the road vs right side of the road. Middle would be best and would work best for everyone :-D

@matejak
Copy link
Collaborator

matejak commented Jul 10, 2018

On a one-way road, why not :-)

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