HTC One or Samsung Galaxy S4?

I've heard a lot of good things about the HTC One but I've also heard a lot of good things about the Galaxy S4. Which one is better and why?