Good question. I was thinking mostly of PVE rather than PvP, but both, especially if your answers are different.
If I am using a sword for defense, I like Knockback especially since I simply want to eliminate the threat. This is especially so if I am traveling since I can hit a mob that gets close then keep moving. I often use one when I am mining. If I am trying to harvest xp, a particular mob drop, or pvp I don't want to have to chase the drops or injured mob. I've done it, but you have to position yourself to direct them so they don't go off a cliff, or worse, into lava(unless you want that). I'll usually have the forewarning to use a bow if I wish to stay back and can close to finish with a sword and collect the drops.
no knockback in PVE. Just gives the ranged mobs more time to puncture holes in your armor, and makes you go out of your way to kill them. For pvp, it depends. If the enemy has a bow, nope. If he doesn't, yes to knockback. (I usually only use sword & ender pearl, no bows, so that's why it's a bit different)