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

The attribute brackets #1307

Closed
valtido opened this issue Dec 3, 2013 · 10 comments
Closed

The attribute brackets #1307

valtido opened this issue Dec 3, 2013 · 10 comments

Comments

@valtido
Copy link
Contributor

valtido commented Dec 3, 2013

Hi Guys,

I have a question regarding the attributes round brackets...

Why was the decision to use (href="#") as oppose to [href="#"]

I would strongly recommend to use the square brackets as this is most commonly used in CSS selectors, jQuery and other languages use [] to reference the attribute list.

Or at the very list, we could have the option to add that ourselves, or change preferences.

But I strongly believe it only makes sense to support both for the time being, depricate the () introduce the [] and then when a new version is out (a year or so down the the line) remove the ()

Any thoughts on this ?

@lydell
Copy link

lydell commented Dec 3, 2013

I asked once (#735), but didn't get an answer to why it was chosen.

@vendethiel
Copy link
Contributor

It's because it's so much easier for french people to type :D.
I guess it's because haml had it.

@ForbesLindesay
Copy link
Member

Yes, @visionmedia is right that we definitely don't want two syntaxes for the same thing here. In some ways changing to the [] does seem nicer as it fits with CSS, but it does feel very late to make such a drastic change.

@valtido
Copy link
Contributor Author

valtido commented Dec 4, 2013

@ForbesLindesay I feel that depricating it now, and removing it 1 year down the line... it's a decent transition...

Or have a fallback if all hell goes loose

@valtido
Copy link
Contributor Author

valtido commented Dec 10, 2013

@ForbesLindesay so any light on this?

@valtido
Copy link
Contributor Author

valtido commented Dec 20, 2013

@ForbesLindesay is this question open for discussion ?

@ForbesLindesay
Copy link
Member

I think I'm going to leave it out for this release. It's a big change to make this close to the deadline. It is open for discussion for v2.0.0 and could be made in a backwards compatible (mostly) way by just allowing people to use either or (providing they match).

@vendethiel
Copy link
Contributor

-1 for [] because it's harder to type on my keyboard :p (azerty. I find the position of [] on qwerty keyboards pretty bad too, even if I forget often to hold shift to type (), but that's just by habit)

@ForbesLindesay
Copy link
Member

I just don't think this change is worthwhile at the moment. Being more like CSS would be kind of nice, but I think it's fine as it is with the minor variation.

@valtido
Copy link
Contributor Author

valtido commented Mar 3, 2014

I know this ticket is closed... but how about a setting/flag, where a user can override, what they should use [] or ().

Something like a config file, or just like we set app.locals.pretty = true

This is very easy to change the default, and if there is a problem, you can change the flag very easily if you are on the old version.

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

4 participants