Skip to main content Skip to navigation

How do I program a computer?

How do I program a computer? –Ammon, 11, Magna, UT

I have some really cool game ideas. I want to learn to program and animate web sites. Do you have any ideas on how to get started? – Tyler, 10, Suisun City, CA

Dear Ammon and Tyler,

Everything our computers do, they do because we program them to do it. Maybe you want to design a game or an app that’s brand new. To create that game or app, you have to help your computer understand what to do.

And to do that, you have to learn its language. That’s what I found out from my friend Gina Sprint, a computer scientist at Washington State University. She’s really curious about how machines learn and how we can use technology to improve health.

“Our computers don’t understand English. If we want to communicate with our computers, we have to speak their language,” Sprint said.

She showed me a way to start learning about computer code with a program called Frozen Fractals. You can try it out, too. You use the programming language called Python to direct a little turtle that draws out different shapes. I was wondering how the computer knew how to respond to the directions.

“The language that computers understand is called binary. We write code in a programming language similar to English, like Python, that is translated into binary so the computer understands,” Sprint said.

Binary means you have only two options to communicate. Believe it or not, pretty much everything we program our computers to do comes back to just these two things.

In a computer, wires carry information through the machine in the form of electricity. The computer can make the electricity stop or go, switch it on or off, by recognizing zeroes and ones. Different combinations of ones and zeroes can correspond with different letters, too.

While we might say cat in English, a machine would spell out “cat” as 01100011 01100001 01110100. That’s the language of binary.

One way you can start programming and learning more about binary is with a visit to Code.org, Sprint adds. It is an organization headquartered in Seattle but anyone, anywhere can learn how to program through the website.

The main job of coders is to create programs, but a lot of time is spent fixing them. Sometimes things go wrong with your programming. You might get a bug in your code. That’s when you get to be a problem solver and fix the error. The term “bug” was popularized in 1945 by the computer scientist Grace Hopper, said Sprint. Hopper actually found a moth in her computer. Now we use the word bug to talk about problems in the code.

Remember, a computer works because of code written by a programmer. A computer knows what to do because we help it understand. Who knows, maybe one day you’ll study computer science. But really, there’s no need to wait. You can get started right now at Code.org. Sprint and I can’t wait to hear about what you learn and create.

Your friend,

Dr. Universe

Will electricity ever run out?

Will electricity ever run out?  -Zoe, WA

Dear Zoe,

Scientists could see and feel electricity in nature long before they discovered how to make it. Maybe you’ve seen it during a powerful electrical storm or felt a little shock from static electricity.

It happens because of tiny parts of atoms. They’re called electrons and they are everywhere. » More …