As an electronics guy I have to say that even if you code perfectly, your system can still fuck up, because your assumption is wrong. E.g. I had a project physically tear itself apart, because apparently when the USB-cable was disconnected in just the right moment the servo would interpret the cut off PWM pulse as a position clue, one that just by code alone should be unreachable.
What we learn from that is that even well written code cannot guarantee everything and you need physical fallbacks like end-switches that remove power from the servos if activated (and whoever thought pulse length is a reliable way to set servos is probably wrong).