yego.me
💡 Stop wasting time. Read Youtube instead of watch. Download Chrome Extension

What is computer science? | Intro to CS - Python | Khan Academy


5m read
·Nov 10, 2024

You've probably seen somewhere the definition of computer science as the study of computers, and that probably wasn't particularly helpful because what does it mean to study a computer?

To get to a better definition, it'll be helpful for us to answer a few questions first: what is a program? What does a programmer do? And what is the difference between computer science and computer programming?

Let's start our exploration with a little history lesson. When humans first roamed the Earth, they spoke only natural languages. Natural languages are what you would typically think of as a language, like English, Korean, Arabic. Then computers came into being, and computers only spoke machine language or binary, which is just a series of ones and zeros, like 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1. This meant that humans and computers couldn't communicate.

Early programmers, or the first humans to make contact with computers, learned how to speak binary. Now, I don't know about you, but I'm not a native binary speaker, and if you gave me a page of ones and zeros, I could not tell you what that means. Early programmers thought the same thing. They thought, "Well, what if we invented a language that was somewhere in the middle? It would be closer to English, so it would be easier for us to understand at a glance, but it would still be close enough to binary that we could teach the computers to understand it too."

This new language they invented was called Assembly Language. Let's put it over here, kind of still to the right of our Spectrum, 'cause it's still pretty close to binary. Here's an example of a program written in Assembly Language. You can see we're getting a little bit closer; there's some letters in here, like maybe "mov" means "move," but it's still pretty hard to understand. It's not what we would call human-readable.

Humans continued this process, inventing new languages that were closer and closer to English, making them easier to understand and making programming more accessible to more people. As a quick aside, I only say English here because historically, programming languages have been very English-centric. In theory, the left side of our Spectrum could be any natural language; that's pretty much all there is to it. Programming languages are just languages that somebody made up one day and taught computers how to understand.

This probably leads you to the question, how do you teach a computer a new language? The process is pretty simple, actually. You write a program in a language the computer already understands that translates from your new language to that known language. You can think of these programs like interpreters. In fact, these programs are called interpreters or compilers, depending on the programming language. For example, there's a compiler that translates from assembly code to binary code, and there's a compiler that translates from C code to assembly code, which we know can then be translated to binary code for the computer to understand.

Okay, so now that we know what a programming language is, what is a program, and what is the art or the process of programming? I like to think of a program as a set of instructions written in a programming language for a computer to execute. Now, that kind of sounds like a process, and that's what programming is. It's a process.

The first step is more like creative problem-solving. It's figuring out, well, what are these instructions for? What problem am I trying to solve? What specific requirements does it have? What exactly do I want to happen? Then that step is taking all those ideas in your head and translating them into something that the computer can understand, translating them into instructions written in a programming language.

Then that third step is executing those instructions. So taking what you wrote, handing it off to the computer, and saying, "Hey, follow these instructions and tell me what result you got." As you can imagine, this doesn't always work out the first time around; the computer doesn't always do what you expect it to. So programming is a cycle. You iterate on the instructions and on the requirements until you get the result that you want.

Let's talk about making a cake for a second. First, you need to decide what your requirements are. Do you want a chocolate cake or a carrot cake? Should it have cream cheese frosting? Should it have sprinkles on top? Then you need to develop a recipe. You need to write a set of instructions for someone else to follow that will result in the cake that you're envisioning in your head.

Then you hand off your recipe to a friend, and you ask them to follow it, and you see what they do. Maybe they come back, and the cake is slightly burnt, or the little frosting swirlies are going clockwise instead of counterclockwise like you wanted. So you go in and you iterate, and you look and see, well, maybe my instructions weren't quite clear here, or maybe I didn't actually specify which way I wanted the swirlies to go, or maybe my requirements changed, and I actually want cupcakes now.

This is basically what programming is, except for instead of a recipe, it's a program, and instead of your friend, it's a computer. At the end, you usually don't get cake.

Okay, we've answered the first two questions: what is a program and what does a programmer do? So now let's answer the big question: what is computer science? Computer science is just the more theoretical side of all this, whereas computer programming is the more applied side.

Computer scientists study questions like how can I prove that a program will terminate, or how can I design programs that are maximally efficient, or how can I build a better programming language? The computer science umbrella also covers a lot of disciplines that we can apply programming to, like artificial intelligence or computer security.

So while they're not the same thing at an introductory level, a lot of computer science is just learning how to program, because you need to learn to walk before you can run; you need to do before you can theorize. So let's do.

More Articles

View All
Lecture 16 - How to Run a User Interview (Emmett Shear)
All right, uh, good afternoon. Today’s guest speaker is EMT Shear. EMT is the CEO of Twitch, which was acquired by Amazon, where he now works. Um, and EMT is going to do a new format of class today, uh, and talk about how to do great user interviews. So, …
Real Cocoa Programing Lesson 1
Hey guys, this is Ma Head1, and today is going to be a video on some Xcode programming to make an application I like to call EY Copy. So first of all, you want to open up your Xcode application. You have to have Xcode installed, and it should be the late…
Allies & enemies are lining up
What about this idea that could the world just bifurcate? Um, where you have more than like countries that align more like the U.S. and U.S. values versus, you know, thinking like China, Russia? Um, first of all, it’s happening. Um, and by the way, I wou…
Mr. Freeman, part 58
Yes, indeed. You are right. I really think that you are the one who got the message. But why do I look at you like you’re a piece of shit? Hmmm… But do YOU look at people differently? Relax, my friends. I understand everyone. Here’s one who wanted to be …
Smart parenting: 2 exercises that build confidence in girls | Marisa Porges | Big Think
MARISA PORGES: One thing that I always get asked is how to help nurture young women’s voice and their ability to ask and speak up. And it’s something that is so critical for our girls to learn, and it’s a skill that will help them in school of course, but…
Mysteries of vernacular: Earwig - Jessica Oreck and Rachael Teel
Transcriber: Andrea McDonough Reviewer: Jessica Ruby Mysteries of vernacular: Earwig, an insect, generally classified within the order dermaptera. The common name of the insects we know as earwigs is exactly that, common, and is based mainly in folklore.…