Single vs double-quotes

107 views
Skip to first unread message

Hampton

unread,
Nov 29, 2007, 6:02:32 PM11/29/07
to ha...@googlegroups.com
Choosing to use single-quotes was only because i think they look nicer
in a document.
In fact, you might even take it far enough to say its a continuation
on the statement
of minimalism that Haml pushes towards (we need the second quote?).

But, whatever. In the end, it was a tossup. I was unaware that XML requires a
double quote. And I guess that using single-quote as a *default* (changeable!)
means that I can't correctly claim that Haml is an XHTML generator. Though,
I've also never seen an XML parser have a problem with single-quotes.

I find the whole thing pedantic and a bit wonky. I mean, who really
gives a fuck? It can be parsed and its widely used. That should be enough.

I would say that I am pro-standards and pro-convention... but only
when it matters.
I get very frustrated and angry when people get obsessed with the specifics
rather than the spirit of something. In fact, I'll say I think its
pretty fucking lame.

Have angered the gods of the Internet because some sweaty dude in a tie at a
committee meeting chose double-quotes and decided that single-quotes are
forbidden. That dude can fuck-off.

If everyone in the community wants the default changed, I will change it.
However, I think most people care about that kind of detail as much as I do....
and I rather like that we stand in defiance of what I consider to be a nit-picky
bit of standard.

So, let the +1's begin for double-quotes if people feel strongly.

-hampton.

s.ross

unread,
Nov 29, 2007, 6:45:05 PM11/29/07
to ha...@googlegroups.com
Do the effing (X)HTML validators spit up chunks when you use single
quotes? If not then what's the diff? If so, some people coding for
people who require W3C valid (X)HTML will have a problem. That
affects sweaty little dudes in ties who administer things like
accessibility rules and crap like that.

+1 for Hampton!
0 for double-quotes

Tom Stuart

unread,
Nov 30, 2007, 3:53:26 AM11/30/07
to ha...@googlegroups.com
On 29 Nov 2007, at 23:02, Hampton wrote:
> I was unaware that XML requires a double quote.

So was I, but I've read the XML specification, so it's not for lack of
interest. Where are double quotes required? What issue are you
responding to here? The spec's section on attribute literal syntax (http://www.w3.org/TR/REC-xml/#IDANUDS
) explicitly says that they can be single- or double-quoted (and
therefore can't contain literal double- and single-quote characters
respectively) which is the way I've always understood it, but perhaps
I'm missing something obvious.

That being said, it's my personal preference to use double-quotes in
XML wherever possible -- perhaps just because they're less likely to
appear in attribute values, so fewer entity references are required --
and for that reason (+ laziness) I'd be pleased to see Haml's default
changed to double-quotes. I think it's just the less surprising
option, particularly since I'm sure there are plenty of newbies who
don't realise apostrophes are allowed at all.

Cheers,
-Tom

Mislav Marohnić

unread,
Nov 30, 2007, 4:43:25 AM11/30/07
to ha...@googlegroups.com
--- SINGLE QUOTES --------
--- FIGHT THE MACHINE --

Daniel Brumbaugh Keeney

unread,
Nov 30, 2007, 4:55:59 AM11/30/07
to ha...@googlegroups.com


I, too, have read the XML specifications and missed this requirement.
However, I always use double quotes, not because of some
specification, but because it's the language convention.
I was once helping someone new to Ruby. They were fairly resistant to
the idea of do..end blocks, instead preferring {...}. I was insistent
about using the former, not because of some specification, but because
of language conventions. Double quotes should be used by default in
HTML, XHTML, XML, etc.

Daniel Brumbaugh Keeney

myobie

unread,
Nov 30, 2007, 7:17:20 AM11/30/07
to Haml
My opinion is that single quotes is a fine default, but that it should
be made clearer that it's changeable upfront so people are not
surprised.

If you have a default of single quotes, you can still claim to be an
XHTML generator. If someone has a problem with single quotes, let them
change the default. Heck, let them us %'s for all I care. It's a ruby
plugin, if they care enough they can override anything. However, some
people care enough to speak loudly, but not fix their problem. If this
is the case, do not be discouraged.

I agree with your sentiments about nitpickyness, but consider that we
all have little things we nitpick about; for some it's xhtml quotes I
suppose ;)



Nathan Herald
+1 single (ot -1 double, whichever is appropriate)

sbtodd

unread,
Nov 30, 2007, 11:41:24 AM11/30/07
to Haml
I noticed that HAML had single quotes and was pleased. I have had to
override some Rails link_to so that the HTML it generated could go
into
Javascript code. So I vote to keep single quotes.

Jared Roussel

unread,
Nov 30, 2007, 12:47:51 PM11/30/07
to Haml
You need to go with the standards. End of story. The whole "I make my
own standards" routine is what got us into the mess with the screwed
up box model and the browser hacks in the first place. This is also
going to hinder the progression of Haml. People (and departments) will
use any and everything as reasons not to integrate a technology. But
the real question is - what does it hurt to change a single quote to a
double quote? They are both one ASCII character, and it doesn't affect
the simplicity of Haml as we're talking about the XHTML rendering, not
the Haml syntax.
Reply all
Reply to author
Forward
0 new messages