I think Federer is better than Sampras for one simple reason: consistency. Sampras was a great player during his best, but he has never had the same level of consistency across all surfaces that Federer, or even Nadal have shown. Federer, even at his old age, is not being dominated by the up and coming players either (like Sampras was when he was younger than Federer is now, he was getting beaten by the likes of Hewitt before he was even 30) so longevity is more in Federer's favor too.
Hewitt, Roddick and Safin weren't weak players during their peak either, which is a common misconception that is thrown around on this forum. If half the people who stated this nonsense watched them play, especially Safin at his absolute peak, they wouldn't be spouting this tripe. Federer didn't just have to deal with them either, he also had Nadal on his heels and we all know how great he is.
And if we look past Nadal even, he had to deal with prime Djokovic and Murray in majors, and by the time they were at their peak they were both formidable forces on all surfaces (besides Murray on clay). He also managed to beat both of these guys (Murray's best surface is grass too) for his Wimbledon title in 2012. I do not see 31 year old Sampras beating Hewitt and Roddick back to back for a title anywhere. He would have been annihilated (like he was at the USO in 2000 and 2001).
Federer also didn't have a gulf in time where he had nobody of any name to challenge him like ironically Sampras did (between 96-98 he had journeyman in slam finals). He's always had Nadal around, and when he didn't have Hewitt or Roddick playing at their best anymore, he had prime Murray and Djokovic to deal with instead.
I'd even argue that Nadal is greater than Sampras considering the kind of competition he's had to go through to win his slams..