Python for everybody | 2 | Computer programming for everybody

Python Tutorial 2
What Is Programming

Programming is also commonly referred to as coding.

Even though these two tasks are not the same, we usually use them interchangeably.

Computer programming is writing codes to run on a computer.

It is the writing of instructions for the computer to perform some functions.

Functions are tasks that you want the computer to do for you.

A program is a set of instructions that a computer follows to achieve something — to do what you want the computer to do for you.

Algorithms, Algorithms, Algorithms

Before you write codes to tell a computer what to do, you must think of the algorithm.

An algorithm is like a recipe – or to cite a specific example, it is like a cooking recipe.

It is a list of step-by-step rules to follow to solve a problem.

Computer programming for everybody | 1

You write down your algorithm in what is known as pseudocode (pronounced as soo-doh-code).

Pseudocode is something that you write down in very plain English-like natural human language that is easy for us humans to understand.

The pseudocode will then be implemented on the computer in a proper programming language like Python – which the computer can understand.

High-level And Low-level Programming Languages

Programming involves writing a program or programs.

A program, which is also called software, is a piece of code with a set of instructions for the computer to perform.

Software written in a programming language like Python, Java, JavaScript, C++, Objective-C, PHP, and Ruby – are called source code, and these languages are called high-level programming languages.

High-level programming languages are more human-readable as compared to low-level programming languages.

Source codes written in a high-level programming language must be translated by the computer, through a compiler or interpreter, to machine code for the computer to execute what you want it to do.

Machine code consists of only zeros and ones.

High-level programming languages evolved from the need for a computer language that is more human readable, and therefore closer to natural human language – as compared to the binary zeros and ones of machine code.

Computers can only execute machine code because the electronic circuitry of a computer consists of only two states — OFF and ON.

A binary number system is a number system of only two digits, consisting of only zero and one, representing OFF and ON.

What Is The Best Method To Learn Coding
The Answer Is Practise, Practise, Practise


Start by coding what you want the program to do.

Then run the program.

Then check the results to see if it achieves what you want it to do.

If it doesn’t, then go back and correct your coding and the whole process is repeated again and again until you get the results that you want.

In computer terminology, this is called the iterative process of coding, testing, and debugging.

You cannot learn to drive a car by watching people drive.

You need to go for driving lessons on the road.

Similarly, you cannot learn programming by just watching programming videos or reading programming books.

You need to get to a computer and start coding yourself.

Testing, Testing, Testing

In writing programs, it is very important to test your program after every change to your codes.

Human beings make mistakes. Just typing “esle” instead of “else” will generate an error and your program will not run the way you want it to run.

So always remember to test your program again after any changes to your code, regardless of how minor the changes may be.

Logic errors in programs are only apparent after you test your programs.

What Is Code Styling

Here is a little note about code styling.

In every programming language community, there are common coding conventions that make it so much easier for one Python developer to read and understand another Python developer’s code.

In Python, this is documented in what is called the PEP 8 (pronounced as pep 8) Style Guide for Python.

Take time to go through PEP 8 whenever you can. It’s a must for every serious Python developer.

PEP 8 Style Guide for Python

https://peps.python.org/pep-0008/

The Software Developer

In programming, we learn most when working on a real-life project.

Working in a full-time programming job as a software developer is the best way of gaining expertise in any programming language.

This series of tutorials will touch on the most essential concepts and language syntax that you need to know.

Putting our minds to work in trying to work out a solution to a problem presented to us is the best way of gaining expertise in a programming language.

Programming Is All About Apply, Apply, Apply

Programming cannot be a spoon-fed learning process.

Programming is how you, through knowing the commands and capabilities of the programming language, think of ways to apply these commands that are given to you, to achieve what you want the computer to do.

The Python Language Is Just Another Program

A programming language like Python is itself a piece of software written by a human being like any of us.

So when we try to understand why a Python program that we just wrote does something in a particular way, we must understand that it is how the person or persons who wrote the Python language itself does it that way.

Theory And Implementation

In Computer Science degrees, you study programming as part of its curriculum because programming is where you put what you learn in Computer Science theory into implementation.

The difference between computer science and computer programming is that you don’t need to study for a computer science degree to be a computer programmer.

One Final Word On Computer Programming

The wonderful thing about software development is that you are allowed to make as many mistakes as you can as long as you are still testing your code and it has not gone live or put into production.

So test for every possible error in your code.

That’s when you will start to learn the language that no one else can teach you.

Watch my online Python course for a different learning experience.

>> Click here to watch my online Python course at Udemy