Electrical Code
The electrical code specifies how to install an electrical system safely.
It is usually published in the form of a 'code book' that is periodically updated. Electrical contractors live & breathe the code book every day, and are usually a good source of information about that's 'code' and what isn't without going through the usually 1000+ pages that these code books contain.
Another use for the codebook is to settle differences of opinion between parties that cooperate on a single project. The code book is always right. Makes life simple.
The various rules in the electrical code are not there to make your life harder (though it often seems to be that way !) but to enable uniform safe installations, and they represent 100+ years of experience with domestic and industrial electrical installations in a very condensed form.