House wiring is not rocket science. Standard cable has a black, a white, and a bare wire in it. The bare wire is always used for the ground. The white white wire is used for the neutral. The black wire is the hot wire.
When you are using a standard cable as a ‘switch leg’, i.e. running wire between a light and a wall switch, the white wire is hot. This is a common practice, and part of the practice it to label such white wires with black or red electrical tape, so the next guy who is looking at the connections knows what was done.
If people don’t follow the simple rules, and something goes wrong, you can spend an uncomfortable afternoon with fiberglass insulation in a cramped attic tracing wires to figure out what in hell is going on so you can fix it.