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

Attribute Quotes should be required and we should either pick Double Quotes or Single as a standard #41

Open
exabrial opened this issue Dec 4, 2014 · 5 comments

Comments

@exabrial
Copy link

exabrial commented Dec 4, 2014

Two things:

  1. Quotes should be required around attributes, like this:

<div class="hello"></div>

  1. Second, we should pick either double " or single '. I would think double makes more sense, since people tend to use single quotes in JavaScript.

Thoughts?

@cshaa
Copy link
Contributor

cshaa commented Dec 4, 2014

Why?

@exabrial
Copy link
Author

exabrial commented Dec 4, 2014

The biggest reason I can think of is simplification... give people one way to do things to reduce the learning curve. So either make them required, or not required. Lets agree to use single quotes, or double quotes. This simplifies the parsing code in browsers. Anyone new will see a unified way of doing things in tutorials and examples. It also reduces the list of "reserved characters" in the specification, which is a concept non-tech people may not be familiar with.

@cshaa
Copy link
Contributor

cshaa commented Dec 4, 2014

And also reduces freedom. Some want to use quoteless attributes (eg. me), some hate it (so they just ignore it). There's no real reason for removing this functionality. If you want to have just one way to do things, write in XHTML. However, programmers hate it because of this.

But thank you for your idea :)

Btw, I don't think non-tech people are the target group...

@exabrial
Copy link
Author

exabrial commented Dec 4, 2014

It's a useless freedom that crowds the spec is my point :) The choice between " and ' is arbitrary. Both are keystrokes on key away from each other on the keyboard. Just pick one and stick with it, one is not better than the other, but having mixed standards is less better than have a clear standard.

@zoffixznet
Copy link

The choice between " and ' is arbitrary.

Not always. If the attribute's value contains either quotes, you just switch which ones you use to quote the value, instead of messing about with escapes.

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

3 participants