Titles and job descriptions before names are compound modifiers. Here’s an extract from an email I sent internally a while ago on this topic:
When there is a nonrestrictive modifier (set off by a comma or commas), the sentence has to be syntactically coherent without it. News media often make the mistake of confusing nonrestrictive modifiers with noun heads preceded by attributive nouns. Here’s an example: “The article was written by noted pharmacist, Trish Rawn.” This is not proper. It’s not a properly constructed phrase with a nonrestrictive modifier, because “pharmacist” is not a sufficient noun phrase: “The article was written by noted pharmacist.” It needs a “the”. But if we haven’t already specified that there’s a noted pharmacist, it’s a restrictive modifier, because we’re saying which noted pharmacist (it’s not like saying “the Pope” – there’s only one Pope): “The article was written by the noted pharmacist Trish Rawn.”
The usage that the news media use, however, is actually not this at all; the name is the head of the phrase and the noun(s) before it modify it, so it should be “The article was written by noted pharmacist Trish Rawn.” In this case, “noted pharmacist Trish Rawn,” like “Prime Minister Stephen Harper” and “metered-dose dispenser,” has the main noun at the end and the preceding nouns are acting like adjectives.
I hope that’s not opaque. Basically, in “general editor Joe Bloggs,” “Joe Bloggs” is the head of the noun phrase and “general editor” is a title serving as a compound modifier, and thus does not get a comma any more than you would write “she spanked him with a ping pong, paddle” rather than “she spanked him with a ping pong paddle.”
We can write “the general editor, Joe Bloggs,” because there “the general editor” is the focal noun phrase and “Joe Bloggs” is an appositive explaining it. In “We would like to thank the general editor, Joe Bloggs,” the object of this is “editor,” which is modified by “general” and specified by “the”; you can leave off “Joe Bloggs” and it makes sense. But you can’t write “We would like to thank general editor, Joe Bloggs,” because you can’t write “We could like to thank general editor” – because if “general editor” is the object it needs to be specified with “the,” and because “Joe Bloggs” is actually the object and “general editor” adds description to “Joe Bloggs” to explain who he is.
I know I’ve just said the same thing two or three different ways – just with the hope that if it doesn’t make sense one way it will another.