programming fundamentals

programming fundamentals

“Boil things down to their fundamental truths and reason up from there.” – Elon Musk

Basic Terminology in Programming

Before we go through Python programming and all the good stuff that comes with it, it's essential to understand how computers understand the program that humans write. Hence, we will go through some basic terminology and concepts that will make your foundation concepts robust. Additionally, you can apply these concepts to any programming language and not just Python or C. So without further ado, let's get started!

what is a Program?

program is a set of instructions given to a computer to perform specific tasks. The collection of instructions in a file is also known as source code. It's a file that has separate extensions like .py, .c, etc., for Python, and C, respectively. Below is an example simple Python program.

# Welcome world of programing

# Display a welcome message
print("Welcome to the world of programming !")

# Prompt for the student's name
name = input("What's your name? ")

# Personalized welcome message
print("Hello, " + name + "! We're thrilled to have you here.")

# Display an exciting message
print("Get ready to explore the fascinating world of programming and algorithms!")

# Additional encouragement
print("Remember, every great programmer started with simple programs like this one.")

# Farewell message
print("Enjoy your journey to world of programming !")

Don't worry about the program. We will learn to write programs in subsequent articles.

The program or instructions which we are trying to write in a high-level programming language is also known as source code. There are many names for the code we write. Please make sure you don't get confused with the names

What is Programming?

is the act of Writing a set of instructions for a specific task to be done by the computer known as Programming?

Computers are fast, cheap, high accuracy and lightning speed

Do computers complete a task by themselves?

No, they can't perform without the help of humans. We have to give instructions to the computer to perform specific tasks.

What is a Programming Language?

Computers don't understand our languages like Hausa, Yoruba, English, etc. Computers only understand 0's and 1's. The vocabulary, which consists of 0's and 1's, is called Machine Language also known as Low-Level Language

It's challenging for us to write instructions in 0's and 1's. Therefore, we humans created a style to give instructions to the computers for the completion of specific tasks, i.e., Programming Language.

Programming languages are also known as High-Level Languages, which can be understood by human beings.

Some of the High-Level programming languages are Python, JavaScript, C++, etc.

There is another language called Assembly Language, which converts our human-readable code, i.e., programming language to an assembly-level language.

Assembly language is also known as low-level language. It is mostly used for microprocessors and programmable devices, which directly deal with the hardware. In addition to this, we don't have to know much about assembly-level language now.

You can take the help of the internet in case you need to learn more about it.

Terminology

Every language, including Natural Languages, which we are using in our daily conversations, has some rules to follow. Let's see them one by one.

Alphabets

Any language in this world has a particular set of symbols to form words. English has English alphabets Moreover, Alphabets are building blocks of the language. likewise, programming language makes use of English alphabets and symbols in a special way

Lexis

A collection of words that a language has to create sentences. Prepositions, Articles, etc. in English.

In programming, we call them keywords. Every programming language has a set of predefined words that we need to use to write instructions.

The following keywords are reserved and may not be used as identifiers.

elif else finally for
if import in is  not or
pass raise return True

These keywords have specific meanings in Python and are reserved for specific purposes. It's important not to use them as variable names or identifiers in your code, as doing so will result in syntax errors

Syntax

A set of rules to examine whether the sentence is valid or not. We need to arrange the words of a language in a well-defined format to form correct sentences. In the same manner, we need to write instructions for the computer that are valid and should be understood by the computer. Moreover, the arrangement of words and phrases to create well-formed sentences in a language happens. In the context of computers, it refers to the proper ordering of symbols and codes which, in turn, helps the computer to understand what instructions are telling it to do.

Semantics

A set of rules to examine whether a phrase is making any sense or not. We need to create sentences that make sense to use.

Therefore, in programming, we need to make sure our instructions are well-semantic.

We will know more about the above terminology in terms of programming in detail when we start writing the code. Don't bother about the vocabulary, even if you don't understand it now.

How to execute Programs?

Now that we have written a program(source code), what to do with it. We have to run it to get the output. To execute our programs, we need a tool i.e.,

1. Compiler, or Interpreter.

2. Text Editor

3. IDE (Integrated Development Environment)

What is a Compiler?

A compiler is a software application that takes the set of instructions(program) you have written and validates them according to the language syntax. If everything is good, it will give you the output.

The compiler will throw errors if the code is not valid. Moreover, different programming languages have different compilers. Languages like C use C compiler C, C++, use the GCC compilers respectively to execute the programs.

Additionally, the compiler will go through different stages in the execution process. In the end, it converts the instructions into Machine Language that can be understood by the computer. It generates an executable file. Therefore, we don't have to execute the program every time to see the result.

What is an Interpreter in Programming?

An interpreter is also similar to a compiler. It validates the syntax and gives you the result if everything is correct.

Languages like Python, javascript etc. use the interpreter. It converts the source code into an intermediate form and then executes it. Additionally, we have to run the program every time to see the result.

Text Editor

A text editor is a type of computer program that edits plain text. Such programs are sometimes known as "notepad" software (e.g. Windows Notepad). Text editors are provided with operating systems and software development packages, and can be used to change files such as configuration files, documentation files and programming language source code.

IDE (Integrated Development Environment)

An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development.

An IDE normally consists of at least a source code editor, build automation tools and a debugger. Some IDEs, such as PyCharm and Eclipse, contain the necessary compiler, interpreter, or both.

conclude

we have learned a lot. Knowing this basic stuff is essential before moving into the actual programming for beginners. I hope you enjoyed this piece.

If you have any doubts regarding the piece, please mention them in the comment section.

Don't forget to subscribe to our newsletter to be first notify