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

Revisit assignment alignment #15

Open
colinodell opened this issue Aug 10, 2021 · 2 comments
Open

Revisit assignment alignment #15

colinodell opened this issue Aug 10, 2021 · 2 comments

Comments

@colinodell
Copy link
Member

Currently, this coding standard requires that all consecutive assignments be vertically aligned by their operator:

$width  = 1900;
$height = 1080;
$foo                  = 'bar';
$someLongVariableName = 'baz';

While this is (subjectively) nice in the first example, it's a bit ugly in the second - it causes developers to either produce messier-looking code or to use less-meaningful names to avoid the extra spaces:

$foo  = 'bar';
$slvn = 'baz';

I therefore propose removing the enforcement of this rule from this standard.

The question I'd like to ask our users is whether this alignment should still be allowed not enforced. This would mean that all three examples above would be considered valid. Alternatively, we could enforce having exactly one space on each side of the operator.

Does anyone have a strong preference here?

@colinodell
Copy link
Member Author

Additional thoughts behind this change: https://twitter.com/colinodell/status/1422952176918347786

@GarrettAlbright
Copy link

I'd prefer to see it done away with but it's not a complete dealbreaker.

Just like in your tweet, the current rules required me to do this, which looks particularly strange.

        $sql   .= ' ORDER BY start DESC';
        $return = [];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants