The architecture in Prague is stunning. But last time I was there, the whole city centre was overrun with tourists. And food average.
Barcelona has lots of street theatre, great restaurants & nightlife, great for walking around the old town & getting lost.
It might be better to visit Prague in the off-season to avoid tourists, but
either way, you're going to have to visit both cities in your lifetime, so flick a coin.