Admittedly, for old computers that relied on vacuum tubes whose connections would sometimes work loose, “whack it with a club” did, in fact, occasionally work.
Occasionally for more modern computers, too! This can happen when volatile organic compounds (VOCs) in the air get adsorbed by circuit board contacts, where the VOCs react to form frictional polymers. Then...
Sometimes an apparently faulty circuit board starts to work again when it is unplugged and plugged back in again. Engineers call this a “no-problem-found” job. Frictional polymers are bound loosely to the boards, so a smart tap can be enough to clear the problem, in the same way that a thump to an errant TV or video often fixes the fault.
Occasionally for more modern computers, too! This can happen when volatile organic compounds (VOCs) in the air get adsorbed by circuit board contacts, where the VOCs react to form frictional polymers. Then...
(From a 1997 New Scientist article (PDF).)