Introduction
19 min read
What is Programming?
Programming is the process of writing a precise set of instructions that a computer executes to perform a specific task or solve a problem. Because computers do not naturally understand human speech, these instructions must be written in specialized computer languages, such as C++, Python, or JavaScript.
At its core, programming is about automation and problem-solving. It involves breaking down a complex problem into minor, logical steps, configuring how data is processed, and controlling the flow of execution based on various conditions. By writing and organizing this code, programmers build everything from simple scripts that automate repetitive tasks to massive software systems, including video games, web applications, and artificial intelligence models.
The Binary Language
The Central Processing Unit (CPU), is the primary component of a computer that acts as its brain. It is responsible for executing the instructions that make up computer programs, interpreting inputs from hardware and software, and managing the flow of data throughout the entire system. Without a CPU, a computer would be unable to perform calculations, run applications, or process any form of digital information.
The CPU accepts low-level instructions known collectively as machine code, which consists entirely of binary digits, or sequences of zeros and ones. These binary instructions correspond directly to the specific operations the hardware is physically designed to perform. Because raw binary is incredibly difficult for humans to read and write, these commands are often represented in software development using assembly language, where short text-based mnemonics map directly to individual machine instructions.
Info
Hexadecimal is used to represent binary numbers in a more compact and readable format. It is a base-16 number system that uses the digits 0-9 and the letters A-F to represent the values 10-15. Each hexadecimal digit represents 4 binary digits, so two hexadecimal digits can represent a full byte (8 binary digits).
Registers are small, high-speed storage locations within the CPU that hold the data it needs. They are the fastest type of memory in a computer.
Memory is where the data is stored. It is much slower than registers but can hold much more data. There are different types of memory, such as RAM and SSD.
- RAM (Random Access Memory) is volatile memory that is used to store the data that is currently being processed by the CPU. It is much faster than SSD but loses its data when the computer is turned off. Here, the running program is loaded from the SSD and executed. Data that the program needs in the current moment is stored in the RAM.
- SSD (Solid State Drive) is non-volatile memory that is used to store data that is not frequently accessed. It is slower than RAM but retains its data when the computer is turned off. Here, all your programs, files, music, videos, etc. are stored.
Modern Programming Languages
Programs are generally not written directly in assembly language today, as it is incredibly tedious, time-consuming, and prone to human error. Instead, developers write software using high-level programming languages like C++, C#, or Python, which feature human-readable syntax and abstract away the complex, low-level management of hardware components. A specialized piece of software called a compiler or interpreter then automatically translates this high-level source code into the machine instructions that the processor can actually execute.
Writing an entire modern application in assembly is impractical because the language is completely tied to a specific hardware architecture. Code written for one processor type will not run on another without a complete rewrite, making software non-portable.
Furthermore, simple high-level concepts require dozens of individual assembly lines to manage low-level details like memory addresses and CPU registers, dramatically slowing down development speed and complicating code maintenance.
Take a look at the Python equivalent of the assembly code above:
The Python interpreter will translate the high-level code above into low-level machine instructions that the CPU can execute.
Compiler vs. Interpreter
- A compiler translates the entire source code into machine code at once, creating an executable file that can be run later.
- An interpreter translates and executes the code line by line, on the fly, which makes it easier to debug but generally slower.
Interpreted code is platform-independent, which makes it highly portable. Write a Python script and run it anywhere where Python is installed. Compiled code, on the other hand, is platform-dependent. Write C++ code for Windows and you won’t be able to run it on Linux. You will need to recompile it for each platform you want to run it on.
Compiled code is generally faster than interpreted code because it is translated into machine code at once, which allows the compiler to optimize the code better than what an interpreter can do on the fly. Interpreters add overhead because they have to translate each line of code into machine code before executing it.
Examples of compiled languages include C, C++, C#, and Java.
Examples of interpreted languages include Python, Ruby, and JavaScript.
Info
An Integrated Development Environment (IDE) is a software application that consolidates the essential tools required for programming into a single graphical user interface. Instead of forcing developers to use separate programs for different tasks, it combines these utilities to streamline the software creation process.
At its core, an IDE integrates a specialized text editor with features like syntax highlighting and code completion, automation tools that compile or build the code into an executable program, and a debugger to locate and fix errors.
Examples of IDEs: Visual Studio Code, PyCharm, Eclipse, Visual Studio, Xcode.
Pseudocode and Algorithms
With the advent of AI, it has become easier to write code. Nowdays, you can just describe what you want the code to do in natural language and the AI will write it for you in a specific programming language.
Pseudocode is a plain-language description of the steps in an algorithm or computer program, written using a combination of natural language and simplified programming structures. It is completely independent of any specific programming language syntax and is designed to be easily read and understood by humans.
Because there are no rigid syntax rules or formatting standards for pseudocode, it allows developers to focus entirely on solving the underlying problem without getting distracted by the technical nuances of a specific language. It typically uses universal programming concepts like conditional logic, loops, and variable assignments expressed in clear english.
An algorithm is a finite, step-by-step sequence of well-defined instructions designed to solve a specific problem. It acts as a logical blueprint that takes a set of inputs, processes them through a series of instructions, and produces a deterministic output. In computer science, algorithms form the foundational logic behind software, dictating exactly how data is manipulated and how tasks are executed by a machine.
An algorithm can be specified in pseudocode, in high-level or low-level programming languages, or in other forms like flowcharts.
For example, this is the Python code from the example above written in pseudocode (I like to use a variation of pseudocode that resembles Python, but you can use any format you like):
Here is another way of writing the same pseudocode:
What this course is about
This course will focus on teaching you how to break down a complex problem into smaller, manageable parts, and then solve each part in a step-by-step manner. You will learn how to think like a programmer and how to write code that is efficient and easy to understand.
You won’t be learning any programming language. Instead, you’ll be learning how to develop algorithms in pseudocode, which you can then implement in any programming language you want.
I recommend you to convert the pseudocode into Python and then test it here: https://www.online-python.com/.
Ask any AI chatbot to help you with the conversion.
If you don’t want Python, then I recommend to take a look at the online IDE https://www.onlinegdb.com/ which supports multiple languages.