It seems like OP is from the U.S., where, unlike the U.K., the education system knee-caps students financially. Hence, if one goes to school in the U.S. taking out loans isn't worth it.
Many people that I've kept in contact with who followed the CS track were more than able to pay off their student loans because most people I know went to state schools like I did. It would be unreasonable to say that there are no failure stories as there are plenty of those, but with the salaries in the industry even for juniors who find themselves working for slightly above average companies (envision $55-65k fresh out of college in the US and they still get to live at home), the loan would have absolutely been worth it.