You're missing part of it....
James, where John had had "had", had had "had had"; "had had" had had a better effect on the teacher.
I always get a little annoyed when a sentence paints me into a corner where I have no choice but to write "that that" or "had had", sometimes I reformulate the sentence, other times I'll drop one of the "thats" because most people don't even notice and sometimes I say, "**** it" and leave it as is.
Reminds me of a joke my friend messaged to me a few weeks ago that his mathematician brother in law told to him. Except he remembered it incorrectly. This is what he sent:
"Three mathematicians walk into a bar. Bartender asks them, "does anybody want a beer?" The first mathematician says, "I don't know." The second also says, "I don't know." The third says, "yes.""
Now, he's texting these to me to see if I get them, because he doesn't. Because I'm always talking about math and logic as keys to understanding the universe, blah blah blah, he thinks I will be able to help understand. But I'm a bit stumped on this one. But the more I look at it, the more I realize it's a logic riddle. It has something to do with the first two guys not knowing, leading to the third guy being affirmative. So now I'm wondering if he recited the joke correctly. So I google search it, and sure enough, one incorrect word changes the entire joke (well, really two, because they're actually supposed to be logicians, not mathematicians; although that's not really significant). And so it goes:
"Three logicians walk into a bar. Bartender asks them, "does everybody want a beer?" The first one says, "I don't know." The second also says, "I don't know." The third says, "yes.""
One word makes a big difference. I messaged him back, "you not only suck at math, but communications."
Of course, the funny thing is, if you change the word to "anybody," you essentially come up with the opposite form of the joke.