Reducing stress

Programming is frustrating. Your code will not work the first time. My code doesn't work the first time, and I've been programming for decades.


Expect your code not to work. That's normal, not a sign that you failed.

What are some things you can do to reduce stress?

Work ahead

Life is easier when deadlines are far in the future. Keep them there. If you work ahead on the exercises, then when your code breaks, you won't panic. But if something is due in two hours, and you run into a problem... well, it might be time to panic.

You're going to do the exercises anyway, right? So just get them done ahead of time.


Learn how to figure out why a program isn't working. It's an important skill.

VBE has a debugger, a feature that lets you look inside your program as it runs. Like an x-ray machine, but without the radiation.

The debugger is your friend. Give it compliments, like "You must work out!" Send it flowers on St. Debugger's Day. You need the debugger in your life.

Code in baby steps

Say you're going to write a program that will end up being 50 lines long. You could write all 50 lines, and test the program when you're done. But when there's a bug, it could be anywhere in the 50 lines.

What I do is take baby steps. Write a few lines, then test them. Write a few more lines, then test them. Life is easier that way.

Pretty code

Make your code easy to understand, with comments, indenting, and good variables names. (We'll talk about how later.) The easier code is to understand, the more brain power you'll have free for debugging.

Other people

Working with others is a great way to learn. Get together at a cafe, write code, and ask each other questions when you get stuck. If your class has hangout sessions (like in the library on Sunday afternoons), go along. You might even get some snacks.

Another thing that works: explain your code to Groot. Or Pooh, or Batman, or Claptrap. Explaining your code helps your brain look at it differently. It might get you unstuck.

Get help when you're stuck. Asking for help is Really Hard for some people. (I'm one of them.) Remember, it's your instructor's job to help. Your friends can help, too.

Remember your accomplishments

You'll do lots of exercises. You'll do one, then another that's a little different, then another that's more different, then another... and then you'll get stuck. Remember, you figured the others out. You'll figure this one out, too.


I believe in you!