This is not even a contest. "Yesteryear" would probably win against any other TAS episode, but "The Practical Joker" is one of the weakest possible contenders to pit against it. TPJ is a stupid episode on many levels. The premise is nonsensical. A mere malfunction turning the ship's computer into a juvenile prankster? Consider the ramifications. Humor, even such crude humor, requires sentience, the capacity to understand human thought and emotion, the ability to anticipate how others would perceive an event and feel in response to it. It requires cognitive sophistication of a level that the Enterprise
computer has never been shown to possess, and there's no way a simple malfunction could explain it. Also, how stupid is it that this damage was somehow fixed by a second passage through the same cloud that caused it? That makes about as much sense as curing sitcom amnesia through a second clonk on the head.
Maybe the story could've kind of made sense if there'd been some entity within the cloud that "possessed" the ship, maybe something that seized the opportunity to escape from the cloud and then got reclaimed by its other inhabitants when the ship returned there -- sort of a cross between Trelane and the "Lonely Among Us" entity. But there was nothing in the episode to suggest that. And it would've still been a lame episode. I never bought that these intelligent adults would laugh so loudly at the simplistic, puerile practical jokes pulled in the episode. Not to mention the cartoony and medically inaccurate portrayal of the effects of "laughing gas" (nitrous oxide).
I should probably balance this out by praising "Yesteryear," but it's all been said many times. It's pretty much universally recognized as the best TAS episode, with only "The Pirates of Orion," "The Slaver Weapon," and maybe "Albatross" being competitive. It's the one TAS episode that's been most influential on subsequent Trek canon, being drawn on by "Unification," the Enterprise
Vulcan trilogy, and the 2009 movie.
The one thing that bugs me about "Yesteryear," though, is that the Guardian's behavior is hard to reconcile with "City on the Edge of Forever." In "City," the Guardian said that it was only capable of presenting history in fast-forward playback, but in "Yesteryear," it was able to take requests and lock onto a specific place and time. Not to mention the completely different voice it was given. But then, I've long been suspicious about the Guardian. What kind of "guardian" of a thing actively invites people to stumble around in it, even after they've already demonstrated the damage they can do to it? Shouldn't a guardian of time discourage people from time-travelling rather than saying "Let me be your gateway?" So personally I tend to think that the Guardian's a little senile.