Borrowing from 401k is a good and also a bad idea. If you borrow from 401k, you will get deeper in debt. Imagine, you work hard and you are get taxed by the government to fund the 401k, so it means you are borrowing your own work hardened money. And if you borrow money from 401k, the moment you spend your borrowed money, you will get taxed again.
The most important thing is don't borrow money. Always find a way to not borrow money, I didn't say that don't borrow money.
Borrowing money is not the solution to your Financial Problem. Always solve your problem, don't escape it.