This week a well-meaning Washington policeman said he took the law into his own hands and gave a troubled, troublesome 13-year-old a spanking.

It was, he said, the way a policeman once disciplined him, and it worked.

The officer's reaction has created a public stir and a private one, too. Probably no other aspect of child care is as controversial as discipline. And no discipline is as controversial as spanking. For most of us, there is more than the psychological lessons we are learning today. The issue is loaded with the memories and mistakes of our parents -- and their parents -- as well as our political and moral beliefs. And still the subject of spanking hangs over parenthood like a guilty conscience. Either way the parent is wrong.

Civil libertarians may be outraged by an on-duty policeman who plays judge and jury, but many of us feel at least a secret sympathy with the urge, if not the act.

The most measured mothers and fathers have wrung their hands over their 2-year-olds and probably patted their bottoms. An occasional swat or two on the fanny of a preschooler is acceptable to many of us, if only because it is almost inevitable. And we like to think the ill effects are few. The parent will feel vindicated and the child may actually avoid the same infraction the next time (or the next).

Real spankings do have value for the preschool child, if they are saved for the most frightening, life-threatening behavior, like running in the street or playing with matches. This child will remember the lesson well because it happens so seldom and because the parent obviously cares so much.

Routine spankings, however, are very different. They are hard on a child, and hard on a parent, who finds that guilt is tough to overcome. The parent who hits a small child in anger feels a frightening loss of self-control and it's almost as bad if she waits until she is cool and collected. There is an ogre in the mirror where her face used to be.

Routine spankings teach a child to lie or charm his way out of mischief or even to invite a spanking so he can live up to his bad reputation, or to feel absolved or to get credit on the ledger to pay for his misbehavior in advance.

A child also learns other lessons.

Because he expects his parents to punish him when he's bad, he learns to demand a reward for being good -- a sign that he's still loved. In both cases, the ante gets upped, with bigger punishments and bigger rewards until the child thinks his behavior is for sale.

He also learns -- or thinks he learns -- that his parents don't respect him if they hit him, and so he respects himself much less. This is true of the toddler and truer still each year; dignity is an increasing sign of self-worth. For a first grader, respect from parents is a critical need, if he is going to respect others.

By the time a child has started school, he thinks spanking is bad because he knows his body is his own, and any trifling with it is a matter -- for boys as well as girls -- of both shame and anger. After kindergarten, almost any spanking inspires belligerence, no matter how much the correction is deserved or how much love the parents show afterward.

This is even more true if the spanking is given by a stranger, since a teacher, minister, neighbor -- or a uniformed policeman -- doesn't have the same emotional investment in a child as his parents do. Not only would the reprimand be public -- at least in a child's eye -- but the humiliation would make the anger much deeper.

There are better ways to skin cats and correct children. As practiced parents have discovered, the most remarkable thing about spankings is this: They usually don't work.

The real surprise of that news story was that the officer said the spanking he once got from a policeman had taught him a lesson. Perhaps it worked then, but it's hard to believe it could today. Even the child's guardian of 11 years said, "The only thing wrong with spanking him is it doesn't do any good."

For parents who wrestle with the spanking problem, there are two good workbooks to show the cause and effect of discipline:

* The Parent's Handbook by Don Dinkmeyer and Gary D. McKay (American Guidance Service distributed by Random House, $6.95). Outlines a method similar to Parent Effectiveness Training.

* Without Spanking or Spoiling by Elizabeth Crary (Parenting Press, $6.95), available by writing to 7750 31st Ave. NE, Seattle, Wash. 98115. A combination of four methods, including behavior modification, Parent Effectiveness Training, transactional analysis and Rudolph Dreikurs'.

These books, and a lot of trial and error, can help teach parents that the only good discipline is the kind that works -- not just once, but time after time.