I think you should look at the 'similar threads' that are shown at the bottom of the page; you will find this topic has been discussed many times.
Using a switch; mechanical microswitch, optical switch, proximity detector, magnetic reed switch, whatever, is okay for a limit switch because you are not worried about good precision. Using any of these for homing and relying on the accuracy of the switch actuation for the home position is probably not okay because no matter how good the switch they do not operate with an accuracy of 0.001" or less which is really what you need for homing.
Commercial machines home using a combination of a switch and an encoder which gives a signal at a specific point in the rotation of the encoder; I think this is called the Z channel pulse or signal. The sequence is that the controller runs the axis slowly towards the limit/home position until the home switch opens. Then it reverses direction so the switch closes. As soon as the switch closes the controller starts looking for the Z channel signal and when this is detected that is the home position. This means the position is determined not by the linear movement of the axis causing a switch to open or close but by the angular movement of the feedscrew triggering a signal. This is much more precise; the switch operating position may fluctuate by many thousandths of an inch so the home position would also would fluctuate the same if it depended on linear motion, however when the home position depends on angular motion of the screw even if the actuation fluctuates by a degree or two this is only a fraction of a thousandth of an inch of linear motion depending on the pitch of the screw.
With a stepper driven system an encoder is not present but the homing sequence described above can be replicated using two micro switches. One switch is actuated by a cam mounted on the screw the other is actuated by linear motion. Homing is done by having the axis move toward the linear operated switch until it opens. As soon as this happens the direction is reversed until the linear switch closes then the controller (computer) looks for the cam operated switch and when this actuates that is the home position.
A search on the topic of Homing should find a number of threads and somewhere in them are links to an off the shelf solution that does just this sequence.
An open mind is a virtue...so long as all the common sense has not leaked out.