Skip to content

Don't allow whitespace everywhere #259

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

Closed
stasm opened this issue May 12, 2022 · 3 comments
Closed

Don't allow whitespace everywhere #259

stasm opened this issue May 12, 2022 · 3 comments
Labels
resolve-candidate This issue appears to have been answered or resolved, and may be closed soon. syntax Issues related with syntax or ABNF

Comments

@stasm
Copy link
Collaborator

stasm commented May 12, 2022

@markusicu wrote in #230 (comment):

Please don't allow whitespace everywhere. Traditional programming languages are super loose with spaces, but then people debate and enforce style guides for where to put them. Looking at my example above, I suggest not allowing spaces where I didn't put any. (For example, not around the =.)

@stasm stasm added the syntax Issues related with syntax or ABNF label May 12, 2022
@stasm
Copy link
Collaborator Author

stasm commented May 23, 2022

We shouldn't punish users when they don't get the whitespace right because (my hypothesis is that) people don't give whitespace the same amount of thought as they do to non-whitespace content. Whitespace is the padding between more interesting content. That's why in my work so far I've attempted to design a syntax in which all whitespace outside translatable content is not significant. Whether you write {$arg :func opt=val} or {$arg :func opt = val}, it should work the same way.

That said, I'm all for agreeing on a standard style guide and encouraging the use of linters. My personal preference for how to format placeholders is {$arg :func opt=val}, for example.

@markusicu
Copy link
Member

I agree that {$arg :func opt=val} is good. I am just lobbying for not allowing additional spaces in that placeholder. More optional spaces lead to sub-optimal readability and style fights.

I feel most-to-least strongly in this order:

  • not allowing spaces between the $/: prefixes and the argument/function names
  • not allowing spaces around =
  • not allowing spaces after the placeholder start {
  • not allowing spaces before the placeholder end }

@aphillips aphillips added the resolve-candidate This issue appears to have been answered or resolved, and may be closed soon. label Apr 10, 2023
@aphillips
Copy link
Member

We've discussed this in the adoption of the abnf and that part of the spec appears to define where whitespace is allowed (we are somewhat permissive). Is there any reason to revisit that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolve-candidate This issue appears to have been answered or resolved, and may be closed soon. syntax Issues related with syntax or ABNF
Projects
None yet
Development

No branches or pull requests

3 participants