I follow Quintus Curtius because, side from cobbling together a translation of On Duties that I've found a worthwhile read, he often dives into antiquity to shine a light on virtuous behavior. For example, the need for, and how to develop a sense of humor.

The entire post is worth reading, but the following jumped out at me:

The humorist must be a master of imagery and metaphor.  He must above all know language:  puns, metaphors, nicknames, alliteration, and hyperbole must all be arrows in his quiver.  He must be a master of irony, and this takes a certain level of seasoning and experience.  Practical jokes are a different matter; these rely on the ability to enjoy another person’s discomfort.  With practical jokes, execution is especially important; taken too far, they can easily become sadistic.  One must have a sense of restraint to carry them off effectively.

Emphasis mine.

One of the things that would drive me nuts in my sub days were the sadistic practical jokers.

You're in a 40-foot wide steel tube, three levels, eight watchstanders in the engineering spaces, with most of them clustered up and forward. You sit there for six hours, taking logs, scrubbing, tightening valves, cleaning, taking inventory, and so on. It gets kindof repetetive. So people play practical jokes.

WOOOOOP. "Engine room lower level"

"Engine room lower level, engine room middle level, come to the port ladder."

"Come to the port ladder, aye" - and the ka-clack of a sound-powered handset going back into its cradle. And so the ERLL watch trundles into the appropriate bay, and goes outboard, climbing up to the ladder to middle level and...

SPLASH

He greets a five-gallon bucket full of water. Gravity check sat.

Before you think this is sadistic, it's not. It gets to be a game. The poor schlub in lower level has a chance to spot the ambush. This is true whether at the port ladder the aft ladder, or the engineroom supervisor sneaks between the condensers to catch you going by below as the upper level watch calls you aft.

The poor schlub is also not defenseless. With access to literally thousands of gallons of pressurized water, tubing, and cutoff valves, a little ingenuiety results in the worlds highest capacity super soaker.

There's a chance to be caught, out-thought, anticipated, and retaliated.

All in good fun. Ditto leaving a pair of gloves marked "port" and "starboard" for a guy who trips out the wrong side piece of equipment. Or sending people off for "relative bearing grease."

What's not in good fun?

It turns out on my sub it was possible to trip out a critical piece of equipment from the level above with a long pole. One that was notoriously prone to slippage. Funny once. "Middle level, why can't you keep your equipment working."

There's no fair play though. No chance to spot it, no chance to stop it. As opposed to the upper level watchstander sneaking off his watchstation and into the other space to do the same thing - he has a chance to get caught, and in trouble.

One method, sneaking down yourself, takes some daring and cleverness. The other, just boredom and a sense of sadism. It's causing frustration and disruption just to watch people squirm - and hurting more people than just the guy you're screwing with besides.

That latter can be taken even further.

In short - if ragging on or pranking on someone, how it's done, how repeatedly it's done, can make all the difference as to which side of the funny/sadistic line it falls.