Correctly connect hot and neutral wires when you replace a lamp switch and socket to keep your lamp safe. Even an inexpensive plug and cord has a marked neutral wire.
If you wonder why you have to identify and connect the hot and neutral wires correctly in a lamp, read on. True, the lamp will usually work either way. But the issue is safety. Normally, power (voltage) comes through the tab on the socket base. The threaded socket is the neutral. So when the switch is off, all “hot” parts of the lamp are well protected. And when the switch is on, only the tab at the bottom of the socket is “hot.” But if the wiring is reversed and the power goes to the threaded socket, the threaded socket is always hot, whether the switch is on or off. There's a much greater potential for getting a dangerous shock, especially when changing a bulb. The worst situation occasionally occurs in old fixtures when the cardboard insulation sleeve wears out and the outer metal shell of the socket touches the threaded socket. If the threaded socket is hot, every metallic part of the lamp becomes hot! Remember when repairing lamps, the neutral wire in the lamp cord is marked (usually with a rib or ribs) and it connects to the wide blade of the plug at one end and to the neutral screw (usually silver but may have some other identification) at the other end.
The hot path for electricity should run through the narrow plug prong at the wall outlet to the hot terminal on the switch and to the hot button at the base of the socket when the switch is on. The neutral path should run from the wide prong at the wall outlet through a marked (insulation) wire to the neutral terminal on the switch and to the threaded metal bulb socket.