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

Bones: How are they made?

How are bones made? -Oscar, 10

Dear Oscar,

A couple months before you were born, your skeleton was soft and bendy. It was made out of cartilage, the same material that’s in your nose and ears now. But when certain cells in your body called osteoblasts and osteoclasts began to work together, new bone started to form. » More …

Why do bees make hexagons?

Why do bees make hexagons in their hives? Why not any other shape? -Aditya, 10, New Delhi, India

Dear Aditya,

When bees make hexagons in their hives, the six-sided shapes fit together perfectly. In fact, we’ve actually never seen bees make any other shape. That’s what I found out when I visited my friend Sue Cobey, a bee researcher at Washington State University.

Cobey showed me some honeycombs where the female bees live and work. Hexagons are useful shapes. They can hold the queen bee’s eggs and store the pollen and honey the worker bees bring to the hive.Dr.UBees

When you think about it, making circles wouldn’t work too well. It would leave gaps in the honeycomb. The worker bees could use triangles or squares for storage. Those wouldn’t leave gaps. But the hexagon is the strongest, most useful shape. » More …

How does my family car work?

Dear Dr. Universe: I want to know how my family car works. How does the gas reach the engine and go? How does the steering wheel make the car turn and how do the brakes help us to stop? -Jordan, 6, Queens, New York 

Dear Jordan,

As a cat, car rides can sometimes make me feisty. But as a scientist, it’s fascinating to learn about the mechanics, engineering, and chemistry fueling the cars humans drive every day.
» More …

How are magnets made?

Dr. Universe, How are magnets made-Andrea, 8, Berkeley, CA                                                                                     

Dear Andrea,

When I saw your question, I headed straight for the Magnetics Lab and met up with my friend John McCloy. I found out the word “magnet” comes from a Greek word for the region of modern-day Turkey we once called Magnesia. That’s where people found magnets in nature. » More …

What materials would you use to make a rocket?

Dr. Universe: What materials would you use to make a rocket?

-Freya, Scotland

Dear Freya,

Whether it’s a model rocket you build in the backyard or one that launches a space shuttle, there are lots of materials you could use. So, when I saw your question I grabbed my lab coat and safety goggles, and zoomed over to my friend Jake Leachman’s lab. He’s a rocket scientist and engineer at Washington State University. » More …

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 …