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

Blocks should have one blank line at the beginning and the end #350

Closed
andyfleming opened this issue Dec 1, 2015 · 5 comments

Comments

@andyfleming
Copy link

commented Dec 1, 2015

I see that the padding-blocks rule was based on the padded blocks rule in ESLint.

It states:

Some style guides require block statements to start and end with blank lines. The goal is to improve readability by visually separating the block content and the surrounding code.

   if (a) {

        b();

   }

Since it's good to have a consistent code style, you should either always write padded blocks or never do it.

I would propose that code is more readable with single-line-padding inside blocks. Why did we decide to enforce no padding as opposed to single-line padding?

@dcousens

This comment has been minimized.

Copy link
Member

commented Dec 2, 2015

Well, I'll counter-propose your proposal and say it makes it less readable.
I guess that puts us back at the status quo. Welp, I guess we'll just stick with the decision already done.

@dcousens dcousens added the question label Dec 2, 2015

@andyfleming

This comment has been minimized.

Copy link
Author

commented Dec 2, 2015

Haha, fair enough.

I ended up using the standard extension for ESLint instead.

After reading more, I understand that the point of standard is to just choose something. While I generally support that notion and the idea that consistency across projects is nice, I think usability has to come first. ESLint is the right fit for us. We'll use standard as the starting point, and adjust from there.

Using ESLint directly actually opens up integrations in the JetBrains editors too. So even if I were going to use standard as-is, I would probably install it via the ESLint plugin instead.

@andyfleming andyfleming closed this Dec 2, 2015

@dcousens

This comment has been minimized.

Copy link
Member

commented Dec 2, 2015

Awesome, the way you've resolved it is exactly how it should be 👍 . Even if its only a few additions of your own, it means if someone has used standard before, they'll be most of the way there before they even start.

@dcousens

This comment has been minimized.

Copy link
Member

commented Dec 2, 2015

After reading more, I understand that the point of standard is to just choose something.

Unfortunately, style is something where you do just have to choose something, as its usability/readability is absolutely in the eye of the beholder.

I suspect we'd of otherwise converged on a solution back in the 60's for all this.

Don't get me wrong, the style choices in standard weren't randomly chosen, it just simply doesn't appeal to everyone.

@andyfleming

This comment has been minimized.

Copy link
Author

commented Dec 2, 2015

Even if its only a few additions of your own, it means if someone has used standard before, they'll be most of the way there before they even start.

I agree. I think it's beneficial to try to keep close.

Don't get me wrong, the style choices in standard weren't randomly chosen, it just simply doesn't appeal to everyone.

That's fair. The block spacing was the only change that felt out of place to me.

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.