OscarGodson / HTML6

A spec to HTML6
http://html6spec.com
169 stars 25 forks source link

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

Open exabrial opened 9 years ago

exabrial commented 9 years ago

Two things: 1) Quotes should be required around attributes, like this:

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

2) 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 commented 9 years ago

Why?

exabrial commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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.