At most U.S. high schools, students are lucky to have the option of taking a single computer science class.

But at  New York City's Academy for Software Engineering (AFSE), which graduated its very first class on Monday, computer science courses aren't just an option--they're required all four years.

Giving the commencement address at AFSE, Union Square Ventures co-founder Fred Wilson exhorted the new graduates to find a balance between work and personal life, take risks, and "work your ass off."

Wilson posted the full draft of his speech on his blog, though he admits to ad-libbing a bit once he stepped onto the dais. Here are three of his biggest pieces of advice.

1. Take risks.

But only smart ones. AFSE graduates took a big risk enrolling at a school that didn't exist four years ago, Wilson says, and that choice is one that paid off. He also drew on his own experience to advise the students about when a gamble is worthwhile.

"I am not suggesting you take silly risks," he told graduates. "I am suggesting you take calculated risks. Each and every time I took a risk there were people telling me not to do it. I listened to them. I did not disregard their advice lightly. After listening and carefully considering the risks, if my gut tells me to take a risk, I do it."

2. Work hard.

Wilson did not beat around the bush when it came to warning graduates about the amount of work required to be successful. 

"You have to work your ass off," said Wilson. "Because if you are going to take these risks, you have to work hard to make them pay off. This is not the lottery. You take a risk and you work every day to make sure it comes through for you."

3. Get lucky.

Wilson says luck is important, but it's useless if you don't recognize it. "I can't tell you when your lucky breaks will come," he said. "But I can tell you that they will come. You must be able to see them for what they are, you must be in a position to act on them, and you must not miss them. Pay attention, look carefully, and be prepared for your lucky breaks."

You can read the full text of Fred Wilson's commencement speech to ASFE grads on his blog