1.3 Get more context: understand what programming is
1: Introduction to Programming and Python
1.3 Get more context: understand what programming is - Video Tutorials & Practice Problems
Video duration:
10m
Play a video:
<v ->So now that we've seen a little bit</v> of what python programming looks like, I wanna talk now about understanding what programming actually is. And this is a topic that I get asked a lot when I teach beginner classes, and the lessons never really cover it. Like what is the high level view of the programming world. So what is programming? Basically it's giving instructions to a computer, clearly and specifically and in a language that it understands. So you might tell a computer say hello world. A computer can be things that you normally think of as programmable, but also things that are becoming programmable as we start doing internet of things and advancing technology. So, cars nowadays all have computers in them. And there are some fancy light bulbs where you can adjust the colors. And like Japanese toilets that speak to you, these are all now programmable and sometimes they even let you program things in for them as the user. So clearly and specifically, mostly why I put it in there is because if you tell Siri to do something, if you ask Siri to do something that is not considered programming, at least not yet, because you're not really sure how she's going to do it. Someone else wrote the program to handle your input. And you're not programming her. So, it should be unambiguous, there should be like clearly if you say these words or do this thing, then this is the result every time. And that should be clear to you as the person who's programming it. And then it should also be in a language that it understands. So, computers can't understand human language yet, but they can understand Python, this is HTML, this is binary. So why are there so many languages? This is definitely not even the full list of them there are much more but these are some of the more common ones. Well, computer language looks like this, computers store data and respond to data and it only really understands ones and zeros and that's because computers are made up of little electronic components that understand ones and zeros like transistors and capacitors. So either it'll have a lot of electricity or voltage or not a lot so high or low, on or off, one or zero, true or false, you'll see these like binary states again and again in programming and that's because that's what computers understand. And that's how data is stored. So a computer will run using machine code, and each line of this code is a number but it also represents a command for the computer to do. Move the value from this piece of memory into here, and then do this thing with it. So that code is actually just binary represented in an easier way for humans to read. But still not easy for us to understand. So binary would be just using the digits zero and one and that's called base two. And then what this machine code was is hex, hexadecimal. And that would be using the digits zero to F, and that's base 16. So you might recognize the bottom numbers that's decimal that uses zero to nine that's what we're used to using and it's based 10. And that's only because we have 10 fingers. So it's easy for us to like count. There are some ancient cultures that used to base five, because then you could use one hand and then do other multiples on the other hand. But because computers understand zero and one, which are only two states, it's most convenient to represent their numbers in a multiple of two or not even a multiple of two but like a power of two. So hex is 16, which is two to the power of four, so each four digits of binary translates to one digit of hex. So if you're interested in learning more about this, you should definitely look it up. And this is just a brief overview. So these early languages were closer to what the machine understood, which is like hex code, binary, and then we create an early language called assembly, which just translated each line of machine code into a human readable one. So the command b8 might refer to this word global. And there was just like a direct translation. But transistors were able to get smaller and smaller, and we were able to fit more and more of them onto a single chip. Computers have gotten way faster over time. And now they can handle things that are not just literal machine code or assembly code, but we can have higher level languages that are closer to human language. So modern languages today look something like this, like Python, or even Scratch if you have children or you've seen you've been around children and they're learning a new language, they normally learn Scratch which is a visual drag and drop language. And it's very easy to understand what it's gonna be doing. So there are in computer science this idea of levels of abstraction. So low level languages are closer to computer language and high level languages are closer to human language so it's easier for us to tell the computer what to do. And here's a rough outline of like where some different popular languages fall on this level of abstraction continuum. I just made it up it's like pretty rough. But you can see here machine code looks like this. There are more lines and it's harder for us to understand. And then assembly makes it a little bit easier putting things into English and English was the language of the people who first created computer languages. So, apologies that it's not internationalized. And then there's C which is useful for hardware and in that one you have to like manage memory and things like that so this is the same hello world language. And this is what it would look like in Java. You can see there's still a lot of words, but these words are more understandable to us. By then you would have System.out.print line, hello world. And this is what it looks like in JavaScript. And finally in Python, and Scratch. So the trend is to focus less on specifics and implementation and more on what you want done. So what about HTML? It's actually not a programming language, it stands for Hypertext Markup Language. And the markup language part just means that it's how to display content and not run line by line telling something what to do. So HTML is used to display content on a web page. So this line here and h1 hello world, is saying that the main heading text is gonna have the words hello world in it. There's also platform specific and general purpose languages. So some languages only work on some types of platforms. For example, HTML and CSS are markup languages for website front end so for displaying web pages. And PHP is for website back ends, specifically WordPress is a big user of PHP, and then Swift and Objective C are used on Apple products, So Mac, iPhone, iPad, and C sharp and Visual Basic are only Microsoft products. And finally, on this small list is SQL which is query language and that's for querying databases. There's also a lot of general purpose languages. So Java, JavaScript, C, C++, Python, Ruby, Scala,Go. These are languages that should be able to do many things, and run on any desktop computer, and can be used for creating web app back ends, or desktop apps or scripts sometimes. But they have their different features, but sometimes it just comes down to preference. So if you're wondering which programming language should you learn first, well obviously I think it's Python. That's why we're doing this video. But you can, I found this good flowchart graphic, and you can go to this link here to view it. A lot of the paths end up pointing you to Python because it's such a great introductory language. But some of them, if you're doing game development, maybe you wanna do C++ first or if you're doing mobile development, maybe Java or swift would be a good first language. Hopefully that was helpful for getting a high level overview and more context about the state of programming and how Python fits into it.