Not only that, have you ever tried understanding building code in order to construct a "legal" residence? Sometimes it is regulated to the point where I could not build a house unless it had the right angle and shade of red terracotta roofing tiles.
House builders in the UK can employ independent, non Govt, inspectors to ensure they are building to regulations (our equiv of your building code). You can imagine how well that works since these inspectors only have one client.