My husband has pounded his fist on the sides of cars that come too close. He doesn't do it anymore; last time was 2 years ago and we were on a group ride right near our house. The driver was very much in the wrong and oblivious, but I convinced him his actions wouldn't solve anything.
I'm glad you convinced him of that. I'm not a fan of slapping the cars either as I feel like it just makes them hate cyclists all the more.