Naming your speakers can be a pain in the butt, especially when you have more than two. With two, you can kick off with a ‘P said’ and a ‘Q said’, then rely on the reader to alternate speakers over many lines of dialogue without needing reminders. How long depends mainly on how distinctive the speaking is: the reader won’t have a problem if P keeps giving commands while Q keeps refusing to obey. More frequent reminders will be needed if both P and Q are sharing memories of a single past event.
With three or more speakers, you need to name and name again. I used to feel guilty about repeating the word ‘said’; then I gave up worrying; and finally felt vindicated when I read Robert Silverberg’s advice in Worlds of Wonder (which I recommend for its superb collection of sample stories as well as its wisdom). When you just mean ‘said’ (he said), then use it; don’t strain to find alternatives. ‘P said’ or ‘Q said’ are the closest equivalent to a play script:
AVRIL: Why do you want to know?
TERRY: Don’t you think I have a right to know?
There’s nothing wrong with ‘he snorted, ‘she exclaimed’, ‘he snapped’, as a way of ringing the changes. But if they follow one another line by line, it soon becomes forced and annoying.
The great life-saver in dialogue writing is the action phrase. You don’t need to mention actual speaking at all; you can tie a line of dialogue to a speaker by describing the speaker’s action at the same time.
Matt turned to Jen. ‘You’re crazy.’
‘It’s not just the money.’ Will scowled. ‘We can’t let him get away with this.’
As with anything, you can overdo it. Constant bits of body-language can also look forced, especially since there aren’t that many expressions for capturing body-language in the English language. But mix action phrases with ‘said’s and occasionally other forms of speaking (‘growled’, ‘demanded’, ‘gasped’ …) and you can keep naming your speakers without too much difficulty.
Oh, and I’m forgetting, you can also name a speaker within someone else’s speech.
‘What do you think, Terry?’ asked Avril.
‘I don’t see a problem.’
No need to say who’s uttering that second line, when Avril’s already named Terry.