Does anyone remember the name of the big hurricane the devastated Florida back in the 1980s or 1990s?
Whichever hurricane it was, there were a LOT of home destroyed by the storm. In trying to figure out why that was the case, investigators were puzzled by the fact that in a sea of destruction, there was one neighborhood that survived the storm with the roofs pretty much intact and the homes mostly sustaining only minor damage. When they dug deeper, they discovered that the houses that survived were all built by Habitat for Humanity, by volunteers. What that meant was -- they actually built to code, because they weren't sharp enough (or motivated) to know where they could get away with cutting corners.
Years ago I was doing third party inspections on a luxury high-rise condominium building in New York City, in lower Manhattan and overlooking the East River. The NYC building code at the time required all reinforcing in masonry veneer to be hot-dip galvanized. I walked on the site and picked up scraps clipped off the ladder reinforcing. It was electro-galvanized (very thin), not hot dipped. But the boxes it came in bore a NYC approval number.
Codes are only as good as the people who enforce them.