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

Add high-level theory/guiding principles #1178

Open
lencioni opened this issue Nov 17, 2016 · 1 comment
Open

Add high-level theory/guiding principles #1178

lencioni opened this issue Nov 17, 2016 · 1 comment

Comments

@lencioni
Copy link
Contributor

Most people don't have the time or energy to read through the entire style guide and internalize it. Additionally, there are always going to be gaps that we haven't explicitly handled.

For both of these cases, I think it would be nice to add a few concise guiding principles to the document. This would allow people to essentially "memorize these 6 ideas and you will know what to do 99% of the time."

I don't know what these principles are or should be, but I figured I would get the discussion started here.

@ljharb
Copy link
Collaborator

ljharb commented Nov 17, 2016

Love this idea. Some initial thoughts:

  1. prefer explicit > implicit, in comparisons, coercions, names, etc.
  2. when (/[/{ through )/]/} (i'll call them openers and closers after this) doesn't fit on one line, the opener should end the line; the closer should be the first non-whitespace character on a new line; the indentation level of the "line with the closer" should match the beginning of the "line with the opener"; and each item in the comma-separated list (when applicable) should be on a line by itself with a trailing comma.
  3. Avoid mutation whenever possible.

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