Introduction to Programming


The computer is used to perform computational tasks but how can you tell the computer what to do and when to do it? Yeah, you can always click some numbers and a plus button to perform addition operations using your calculator but have you ever wondered what makes the calculator work behind the hood? Well, the calculator works as a result of some pre-written 'programs' by the operating system providers.
Now let's assume your computer's calculator came without the the modulo(%) operator and you are in need of one. Technically, you could download a calculator with such capability but intrestingly, you can also build yours! Wait, how?. Just like your operating system providers, you can also give instructions to your computer telling it to create a calculator for you with the modulus operator! But that isn't as easy as it sounds. You have to write programs for the computer to read and execute.
What Exactly Is Programming Then?
Programming is simply telling the computer what to do, how to do it in details. By details I mean leaving no instruction out. Once in our lives, we have given intructions to our fellow humans to carry out and it is quite easy to that but when it comes to a computer, you have to give the computer instructions bit by bit. Say for instance, you want a computer(a robot for this instance) to get u a glass of water. You might want to follow the pattern below:
Tell her to get a cup first by specifying the exact position of the cup
You might also want to describe what a cup looks like because the computers are pretty dull
include the direction of where the water dispenser is placed
Tell her what water looks like
You might need even more details, the above is to mention but a few.
How Do You Write These Programs/Instructions
We have been talking about writing progrms or should I say Instructions for the computer. But how do we write these programs or instructions? The above illustration about cup of water isn't how we actually give instructions to the computer. Programs for the computer are written in programming languages like Python, JavaScrpt, C, etc. And these programming languages can either be a high level or a low level language(More on this in another post). The instructitons written in one of these programming can then be translated to the computer's language called Machine Code(0s and 1s) for the computer to execute. One thing to note is that program written in machine language need no translation(More on this in another post).
Conclusion
You can give instructions to the computer by writting programs
Programming is writting instructions for the computer to execute
You need to be detailed enough while giving instructions to the computer
Programs are written using programming languages which could be high level or low level
Bonus: When using any programming language to program a computer, remember that you are only giving instructions to computer and you might find programming a little bit easy
Subscribe to my newsletter
Read articles from Chimobi Ekwunife directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
