Introduction to Programming

Introduction to Programming

What exactly is programming?

Programming is the process of creating a set of instructions or statements for a computer. Programming can be done using C, C++, Java, and other programming languages. However, as we discovered in the previous blog post, the computer only understands the binary digits 0 and 1. This blog post teaches how these instructions convert into 0s and 1s.

Programming languages: What exactly are they?

A programming language is comparable to the English language. Through programming languages, we can write instructions for computers. The programming languages include C, C++, Java, etc.

Why do we require software or a program?

Computers can perform any calculation, but we are unable to do so without software. Thus, the software is a collection of computer instructions. For instance, we can edit our images using Adobe software, and we can perform addition, subtraction, multiplication, division, and other operations using calculator software.

always-top-calculator-windows10.jpg

How to create software using the C and C++ languages

In an IDE, we can write sets of computer instructions. In the IDE, we create a sum.c file. The instructions contained in this file are also referred to as "source code," and the file itself is also known as a "source file." This file goes to the build process. In the build process, there are three stages that our file goes through before it becomes an sum.exe file. This sum.exe file is software.

Let's talk about how instructions are converted into 0s and 1s, or the build process.

Three stages in the building process are:

1. Preprocessor: A preprocessor is a piece of software. Our file is first read by the preprocessor, which then deletes the statements from the source code that are preceded by the # symbol and inserts code according to preprocessor directives (#include). We then obtain the "sum.i" file. The compiler then reads this file.

2. Compiler (translator): Software that transforms the sum.i file into intermediate machine code is known as a compiler. Next, the sum.o file appears. The linker then reads this file.

3. Linker: Another piece of software is called a linker, which links library files to intermediate machine code to transform it into proper machine code. We now have a sum.exe file.

builp.png

What is machine code?

Machine code, which is a series of 0s and 1s, is the type of code that is present in the .exe file. While source code is independent of the operating system, machine code is dependent on it.

What is an IDE?

IDE is software that is used to build softwares or applications. IDE stands for "integrated development environment." It provides features like a code editor, building tools, debugging tools, etc. for instance, Visual Studio, Code Blocks, Intellij IDEA, and others.

IDE.png

What is a code editor?

Code editors are also used for building software. Extensions allow us to add features like building tools, debugging tools, etc. to the code editor. A code editor is not an IDE. for instance, Visual Studio Code, Atom, and Sublime Text.

Code editors.png

Why we cannot use notepad for building software

Although notepad is available, it lacks features found in an IDE and code editor. If we write source code, we must complete each task individually (tasks like test, build, etc.), which is very time consuming.

Conclusion

You covered the basics of programming in this blog. You can now research more about it online. If you'd like, you can follow me on Twitter.

Gratitude for reading.