Putting oneself through a long-term financial burden is a subjective decision; the cost of the program/ what you're looking to get out of it/ associated return on investment and several other factors have to be considered.
For example, if one wants to specialize in a subfield of CS coming from COE, or perhaps ECE, it is possible to find 1-2 research groups in public/state schools which would meet the requirements and would be easy on your pocket. However, one may choose to let a big name (Stanford/ Columbia/ CMU/ etc.) influence their decision when a slightly lower ranked program could have done the job and potentially saved the candidate tens of thousands of dollars.
There is no correct answer here. Depending on individual preferences, a loan may or may not be a wise choice.
A Quora question about undergraduate education putting a student into debt -
http://qr.ae/8Gx3Ho.