DEV Community

Cover image for A Simple article to motivate your student
eomiso
eomiso

Posted on

A Simple article to motivate your student

[Article] Start of a Journeyman

So, what is Python? Well it's not a snake for sure...🐍 You don't want to see a snake lurking around your PC eh? (Well if snakes can catch bugs on my program then it would be tempting tho... πŸ˜†). It is a Programming Language that works on computers. Ah, we have just addressed two important keywords in the tech world. Can you define what a computer is? How about programming language?

Let's talk about computer first

So what is a computer? Sorry if you are feeling that I'm holding you off. But this is such an important concept. Yet everyone has computers now a days, and nobody seems to be serious about the definition of computers.

THINK AND ANSWER
How would YOU define a computer?

help) a cell phone is a computer. Our cars would also have a computer. Planes are FLOWN by computers. The distance from earth to the newest planet discovered is computed by computers. The cool lightsaver on Star Wars is again drawn by computer.
:lightsaver:

WARNING!
Do not read the next paragraph unless you have answered the questions above yet.

Computers can be anything

No they are not. Sorry I didn't want you to see the answer on the sidebar. 😜 There are things that computers can't do. And are most certainly, things in the world that are not computers. An analog watch is not a computer. Humans of course are not computers(although their do seem pretty function like a computer). A book is not a computer either. And neither the bed where you may be reading this article on.

So what are computers? Well here goes the first blow. A computer is a programmable machine. Because they are programmable, we can tell them to fly a plane, drive a car, send an email, and let the alarm on in the morning. In a sense it's like we are instructing the computer to do the work on our behalf. And this is infact pretty true because the better you conquer your computer the easier your life will be (ask mom).

Ok, then how do we instruct a computer?

So how do we instruct them to do the stuff that we want them to do? In other words, how do we make the computer understand our needs? Yeah, you should have probably guessed it already. We do that by programming the computer with our programming language.

#include <stdio.h>
int main(void)
{
  printf("Hello World\n");
}
Enter fullscreen mode Exit fullscreen mode

Cool Stuff
On your macOS press cmd + space then type terminal.

When you see that little cute black window, type: vim hello.c. (or possibly nvim hello.c)
Then press i, type the code above then press <esc> once.
Then type :wq which will bring you back to the black window again.

Then type: gcc hello.c -o hello
Finally type: ./hello and see what is printed on the black window.

[When Error]
When you see an error don't worry, just look here and try to follow through the instructions then come back.

Tada! We have just instructed the computer to say it's greeting to us. Likewise, by instructing the computer in a more complex and elegant way we can somehow tell them to do more than just this.

A computer is a calculator

For a computer to fly a plane, it needs to calculate it's altitude, speed, direction and so on. When the computer drives a car, draws a light saver, or figure out our distance to an unknown planet in the universe, it has to calculate. So here is the second blow. Compter caculates. It is nothing but a calculator, but only that we can tell it what to calculate and how to calculate it. Calculations is one of the core functcions of computers. With mere 0, 1 some how humans have made a logic to create addition, multiplication, division, and substraction.

So for a computer to calculate it needs to deal with numbers. And there are plenty of smart things that smart people have done to make our computers understand the Pi, Epsilon, and increadibly large numbers and so on. To do that there are some serious electrical engineering going on. When you come to think of it, it truely is a mistery how humans have come this far while we didn't even know what a voltage or current is.

Anyhow thus understanding how computer calculates is another core of studying computers.

Does this sound fun? Jump right in then!

Top comments (1)

Collapse
 
thomasbnt profile image
Thomas Bnt β˜•

Hello and welcome to DEV Community ! πŸ‘‹πŸΌπŸ˜‰
You can say hi to the Welcome Thread, introduce yourself and talk what you're learning !