When wiring a switch loop, which wire is which?
It doesn't matter, it's in the past

In the old days (pre 2011 code adoption), National Electrical Code said that if a wire with white or gray insulation or a marking of three white or gray continuous stripes is used as part of a switch loop to single-pole, 3-way, or 4-way switches. The conductor should be permanently reidentified, and should be used for the supply to the switch but not the return (200.7(C)(2)).


  National Electrical Code 2008
  
  Chapter 2 Wiring and Protection
  
  Article 200 Use and Identification of Grounded Conductors
  
  200.7 Use of Insulation of a White or Gray Color or
  with Three Continuous White Stripes.
  
  (2) Where a cable assembly contains an insulated conductor
  for single-pole, 3-way or 4-way switch loops and
  the conductor with white or gray insulation or a marking
  of three continuous white stripes is used for the
  supply to the switch but not as a return conductor from
  the switch to the switched outlet. In these applications,
  the conductor with white or gray insulation or with
  three continuous white stripes shall be permanently reidentified
  to indicate its use by painting or other effective
  means at its terminations and at each location
  where the conductor is visible and accessible.


So before 2011 NEC adoption, the wiring should look like this.



The future

According to the 2011 code...


  National Electrical Code 2011
  
  Chapter 4 Equipment for General Use
  
  ARTICLE 404 Switches
  
  I. Installation  
  
  404.2 Switch Connections.
  
  (C) Switches Controlling Lighting Loads. Where switches control lighting loads supplied by a grounded general purpose branch circuit, a grounded circuit conductor shall be provided at the switch location.


A grounded (neutral) conductor is now required at each switch location (see code for exceptions), which means the circuit would now have to look like this...



Or