In English, there seem to be two different ways to indicate the speaker in direct speech:
"I like this," John said.
"I like this," said John.
Is one of these better? Or is there a rule when one or the other way would be applied? Do they carry a specific connotation?
I'm not a native speaker, so in some cases, this inverted word order seems strange to me. For example:
"How does it work?" John interrupted quickly.
"How does it work?" interrupted John quickly.
The latter sounds weird to me. Is it correct, or does it also sound weird to native speakers? I.e. would the former version be preferable? Or are they both equally valid?

I have several English grammar books, but strangely enough, none of them describe any of this.