In some states, a handwritten will is not valid. In Pennsylvania, a handwritten will is valid, but you must sign it and you should have two witnesses sign it as well, attesting that they saw you sign your will.
It's preferable for a will to be typed clearly and put on good paper but there are times that a handwritten will may be a sensible idea. A client once called me because she didn't have a will, was afraid of flying, and wanted to have a will done before she got on the plane the next morning, forced to take an emergency flight. I advised her to do a brief handwritten will that afternoon, and to rectify the situation with a neatly done will upon her return.
Similarly, a person in a hospital about to have emergency surgery might want to handwrite a will quickly rather than try to get a lawyer to the hospital prior to the surgery.
Other emergency situations that present themselves might also be occasions for a handwritten, or "holographic," will. However, it's best as soon as possible afterwards to replace that will with a more carefully thought-out, typed will that has been written or reviewed by a lawyer. Often there is very specific phrasing needed to carry out your wishes after your death, and your lawyer will know how to do this. Estabishing trusts can also be tricky and is best left to your lawyer.
Whether you have a handwritten will done quickly before going on a trip, or a neatly typed will of substantial length, always be sure that your will is left someplace that it can be found! No will is of any use if no one can find it.