This has been asked over and over for years.
My answer: neither.
Panniers are great, but you can't go fast, I hate them in a head wind, and I can't bunny hop or throw the bike around.
Backpacks put the load too high on my back (I'm often in the drops) and are way, way too sweaty.
Messenger bag has no down sides. Sits lower - on my pelvis more than on my back. No wind or sweat issues. All the worthwhile ones come with a chest strap (which is mandatory).
Timbuk2 makes some good ones.
(my panniers and backpacks have been collecting dust)