You are entirely reasonable to expect color-coding. I couldn't work without it, I'll say why at the end.
Use tape to code by function
But a switch circuit has a third wire function, called switched-hot. Use tape to mark wires to a different color. Which color should switched-hot be? Think about it:
Why do you use only black and white? Because you are using NM cable, and that's how it's sold. Neutral must be white, because Code requires this. Most places, black is always-hot. But when you use white as a hot, it must be preferentially always-hot, but never switched-hot. *
That was easy. Black to black. White to white. Red to red. Done.
Code now forces you to use /3 cable for switch loops, and the third wire is red. So it makes a world of sense to use red for switched-hot. So, voila.
The other color-code I use is yellow for travelers in 3-way switches. (Both since there is no need to distinguish them from each other.) 3-ways are a nightmare if you don't do this, but if you do, it's easy. Two yellows in the same cable - guaranteed to be travelers.
I also use blue for "alt" switched-hot or for second set of 3-way travelers.
"Why? You can't figure out a simple switch loop, Harper?" Yes. Because it makes things really simple and easy to maintain. Here's an example of two switch loops, how hard can that be, right?
Here is the color coding. Circuit 1: H black, N white, Switched brown. Circuit 2: H red, N gray, Switched yellow. Circuit 3: H blue, N white-blue. LR=Lighting Receptacle (blue is unswitched). Switches up top, more switched outlets below. There are 7 wire-nuts in this box. Yet still, easy to maintain: as above, white to white, gray to gray, yellow to yellow.
* You may ask "why all that maneuvering? Why not mark the white red and leave the black native? Because
National Electrical Code 2014
Chapter 2 Wiring and Protection
Article 200 Use and Identification of [Neutrals]
200.7 Use of Insulation of a White or Gray Color or
with Three Continuous White Stripes.
(C) Circuits of 50 volts or more. The use of insulation that is white or gray ... for other than a [neutral] shall be permitted only as in (1) or (2).
(1) If part of a cable assembly that has the insulation permanently reidentified to indicate its use as a [hot] by marking tape etc. at each termination. ... If used for single-pole, 3-way or 4-way switch loops, the reidentified conductor white white or gray insulation ... shall be used only for the supply to the switch, but not as a return conductor from the switch to the [lamp or load].
That means white must be used in the following priority: 1) neutral. 2) always-hot 3) traveler. 4) Never, ever switched-hot.