Hacker Newsnew | past | comments | ask | show | jobs | submit | kspiteri's commentslogin

"To my mother, Ayn Rand and my daughter" is not ambiguous without the Oxford comma, but would be with it.


Good example.

Without the Oxford comma, it is unambiguous because we know that the comma cannot be making an appositive phrase, because if it was that phrase would include "Ayn Rand and my daughter". We know that your mother cannot be your daughter, so that cannot be intended part of an appositive phrase.

Note, though, that it is only unambiguous without the Oxford comma because we know that one's mother cannot be one's daughter. So in some sense it actually is ambiguous grammatically but we can resolve the ambiguity by using knowledge beyond grammar. (I don't know if punctuation counts as grammar, but I'm counting it in this comment).

As with my examples, the ambiguity stems from comma being both a list separator and a separator for parts of appositive phrases.

If we were to write appositive phrases like I suggested (using parenthesis instead of commas), and always use the Oxford comma, it would become "To my mother, Ayn Rand, and my daughter" and would be grammatically unambiguous. We would not need to know the meaning of the words to parse it. We would only need to know their grammatical categories.


I think you're quite right that mixing different separator uses of the same punctuation character is a source of ambiguity. This is where em-dashes and parentheticals shine.

It's also a good idea to rephrase to avoid the ambiguity. E.g.,

    To my mother, Ayn Rand; and also to my daughter, and God.
or

    To my mother, to Ayn Rand, to my daughter, and to God.
It's not always possible to just sprinkle a comma to disambiguate, so don't just do that. Use other punctuation. Add punctuation diversity to your writing -- make it clearer and more fun for you to write, and others to read.

The trick is to notice these issues as you write. Of course, that's not always easy, and it's particularly difficult when speaking, but at least it's not usually expected when speaking.


When speaking, we will also often address it by changing intonation and shortening pauses to indicate that we're interjecting something rather than continuing a list. E.g. in this case adding pressure to "Ayn Rand" and shortening or cutting the pause implied by the first comma if we want to imply they're one and the same:

To my mother Ayn Rand, my daughter, and God.

And if we sense ambiguity we'll often similarly extend subsequent pauses to clearly separate list items.

We'll also often add body language to make the emphasis on connections even stronger.

I'm guessing a lot of ambiguous written lists are ambiguous because people have written the words roughly how they'd said them, and tried to follow grammar rules without thinking about the extra cues they're leaving out that'd be there if speaking.


It is ambiguous without external context; and is used to demarcate the last item in the list (at least that's what I was taught in school in the UK).

For example:

  To joe blogs, the pope, my cat and ferrari.
So the Pope is called Joe and is a cat?

Let's think for a moment. How would I write that if Pope Joe was my Cat?

  To joe blogs (the pope and my cat) and ferrari.
And for your example, if I only had the comma to punctuate then this is the only way I could write it unambiguously:

  To my mother Ayn Rand, and my daughter.
I think that this whole thread is an excellent argument against any attempts to encode any sort of rule set in a language wholly incapable of encoding it unambiguously.


Whether or not it's ambiguous doesn't matter much to me. It's confusing. That sentence is bad writing, Oxford comment or no. The goal of language is to understand others and be understood yourself. This kind of formal analysis doesn't help with that goal.

I think we would benefit from a simplified, formalized version of English for things like documentation and legalese. Does something like that already exist?


Why not just rewrite it to

"To my mother, my daughter, and Ayn Rand" or

"To my mother, my daughter and Ayn Rand".


That seems ambiguous to me. Is the mother Ayn Rand or not?

The presence of the Oxford comma, or lack thereof doesn't seem to affect the ambiguity.


> "To my mother, Ayn Rand and my daughter"

- Ayn Rand can't be in apposition of my mother as there's no comma setting Ayn Rand off from my daughter

- Similarly, Ayn Rand and my daughter are not in apposition

- my daughter and my mother are mutually exclusive

This is described in more detail here:

https://en.wikipedia.org/wiki/Serial_comma#Ambiguity

> "To my mother, Ayn Rand, and my daughter"

Adding the Oxford comma creates ambiguity between my mother and Ayn Rand, unless the speaker is Ayn Rand's daughter.


But here we're using semantics to disambiguate. It works, sure, but it works in fewer cases than punctuating/rephrasing to avoid the ambiguity grammatically rather than semantically.

Semantic disambiguation also imposes a higher cognitive load on the reader -- sometimes that's the point (high-brow writin'). But you should consider the poor reader. After all, you want to be read and understood.


Sure, which is why I mentioned the exception. The whole point of the example is to show there are cases where the Oxford comma alone doesn’t prevent ambiguity in all cases. I’m not arguing that the Oxford comma is silly. I’m just explaining how the example can be ambiguous. Language is messy and wonderful and frustrating and fun!


It only says the mother is Ayn Rand if the comma after mother is taken as making an appositive phrase. There is no later comma to end the appositive phrase, so we'd have to take "Ayn Rand and my daughter" and so it would be saying that his mother is both Ayn Rand and his daughter.

That's not possible so we can rule out the comma making an appositive phrase, and see that it must be a list comma, and we've got no ambiguity.

Putting in the Oxford comma makes it so we could interpret "My mother, Ayn Rand," as an appositive phrase, and we have ambiguity.


You just need a constant number of pointers. This requires O(log n) scratch space because a pointer can be stored in O(log n) space.


Not if N=1 ;)

(A constant amount is of course independent of N anyway!)


> Not if N=1 ;)

> (A constant amount is of course independent of N anyway!)

When using O notation, we're doing asymptotic analysis and n can be arbitrarily large. If you have an arbitrarily large pointer, you cannot store the pointer in a constant number of bits. If your pointer is 64-bits long, you're cannot handle n > 2^64. That is why I said you need O(log n) rather than O(1).


A common implicit assumption in complexity analysis is that machine words can hold O(lg n) bits, and that those words can be operated on in constant time.

Lots and lots of algorithms gain an extra lg(n) factor if you drop that assumption.

e.g. http://blog.computationalcomplexity.org/2009/05/shaving-logs...


Well, that's certainly an unusual way of looking at it! Pointers are usually assumed to be "large enough" when you do this sort of analysis, with the data being assumed to fit into the available address space (if you're even thinking about such issues). But I see your thinking now!


If you can use templates, the decision of which function to call can be done at compile time and you don't need virtual calls. Virtual calls are useful when the decision must be done at runtime.


Article just seems like "I misused some feature X and it was slower than something else."


no it's not. it's more like, the most common dispatch pattern used in C++ (and most other OO languages) as a factor of 7x performance penalty over the less widely embraced alternative. The popularity of the former methods is partly due to the ignorance of programmers to its performance implications. I have seen huge code bases that had to be retired because of their over reliance on OO, and dynamic dispatch.


> I have seen huge code bases that had to be retired because of their over reliance on OO, and dynamic dispatch.

What were they replaced with?


I think this is the first site I came across that is easier to read as source.


Ha, true. It's not too bad actually.


I usually watch soap operas to learn how different people live. It's a pity they messed up the one about start ups.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: