The code was certainly excessive. However, there are those (such as Spencer Warren & Lawrence Auster) who believe the code was at least partly responsible for the Golden Age of great Hollywood films. By putting a halt to gratuitous sex and violence, writers and directors were forced to actually come up with some superior material.
There was still plenty of violence in films back then it was just treated lightly...dozens of people falling bloeelessly from a handgun which fires an endless stream of bullets...