<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Farhad Rahimi Klie</title>
    <description>The latest articles on DEV Community by Farhad Rahimi Klie (@farhadrahimiklie).</description>
    <link>https://dev.to/farhadrahimiklie</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3424859%2Fc13c2c54-3160-4d41-9cdf-9ca26cf28fa8.jpg</url>
      <title>DEV Community: Farhad Rahimi Klie</title>
      <link>https://dev.to/farhadrahimiklie</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/farhadrahimiklie"/>
    <language>en</language>
    <item>
      <title>Linus Torvalds: The Programmer Who Changed the World With Linux and Git</title>
      <dc:creator>Farhad Rahimi Klie</dc:creator>
      <pubDate>Wed, 19 Aug 2026 01:52:52 +0000</pubDate>
      <link>https://dev.to/farhadrahimiklie/linus-torvalds-the-programmer-who-changed-the-world-with-linux-and-git-bha</link>
      <guid>https://dev.to/farhadrahimiklie/linus-torvalds-the-programmer-who-changed-the-world-with-linux-and-git-bha</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;From a personal computer project to Linux, Git, and the foundations of modern computing.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When we talk about the people who shaped modern software development, one name stands out: &lt;strong&gt;Linus Torvalds&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;He is best known as the creator of the &lt;strong&gt;Linux kernel&lt;/strong&gt;, the core software that powers Linux operating systems and countless servers, smartphones, embedded devices, cloud systems, and supercomputers.&lt;/p&gt;

&lt;p&gt;But Torvalds created something else that programmers use every day: &lt;strong&gt;Git&lt;/strong&gt;, the distributed version-control system.&lt;/p&gt;

&lt;p&gt;His story is interesting because it demonstrates an important lesson in software engineering:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You don't always need to begin with a giant plan. Sometimes, a small technical project can grow into something much bigger than you imagined.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Who Is Linus Torvalds?
&lt;/h2&gt;

&lt;p&gt;Linus Torvalds is a Finnish-American software engineer and programmer, born on &lt;strong&gt;December 28, 1969, in Helsinki, Finland&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;He became interested in computers at a young age and eventually studied computer science at the &lt;strong&gt;University of Helsinki&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In the early 1990s, personal computers were becoming increasingly popular, but the operating systems and development environments available to students were limited.&lt;/p&gt;

&lt;p&gt;Torvalds was interested in operating-system technology and began experimenting with a computer running &lt;strong&gt;MINIX&lt;/strong&gt;, an operating system created by Andrew S. Tanenbaum for educational purposes.&lt;/p&gt;

&lt;p&gt;That experimentation eventually led to Linux.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Beginning of Linux
&lt;/h1&gt;

&lt;p&gt;In 1991, Torvalds started developing an operating-system kernel as a personal project.&lt;/p&gt;

&lt;p&gt;At first, Linux was not intended to become the foundation of a massive global ecosystem.&lt;/p&gt;

&lt;p&gt;It was simply a project for learning and experimentation.&lt;/p&gt;

&lt;p&gt;The original announcement was famously modest. Torvalds described what he was working on and invited other people to try it.&lt;/p&gt;

&lt;p&gt;That small project eventually became the &lt;strong&gt;Linux kernel&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The important distinction is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Linux is technically a kernel, not a complete operating system by itself.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The kernel manages fundamental resources such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CPU scheduling&lt;/li&gt;
&lt;li&gt;Memory&lt;/li&gt;
&lt;li&gt;Processes&lt;/li&gt;
&lt;li&gt;Devices&lt;/li&gt;
&lt;li&gt;Filesystems&lt;/li&gt;
&lt;li&gt;Networking&lt;/li&gt;
&lt;li&gt;System calls&lt;/li&gt;
&lt;li&gt;Hardware interaction&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A complete Linux-based operating system combines the kernel with many other components.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Linux-based operating system
│
├── Linux Kernel
│   ├── CPU management
│   ├── Memory management
│   ├── Process management
│   ├── Networking
│   ├── Device drivers
│   └── Filesystems
│
├── System libraries
├── Shell
├── Utilities
├── Desktop environment
└── Applications
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This architecture is one reason Linux became extremely flexible.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why Was Linux Important?
&lt;/h1&gt;

&lt;p&gt;Linux was released as an open-source project.&lt;/p&gt;

&lt;p&gt;That meant programmers around the world could study the source code, modify it, improve it, and contribute changes.&lt;/p&gt;

&lt;p&gt;This created a powerful development model.&lt;/p&gt;

&lt;p&gt;Instead of one company controlling the entire operating system, thousands of developers and organizations could participate.&lt;/p&gt;

&lt;p&gt;Over time, Linux became important in many areas of computing.&lt;/p&gt;

&lt;p&gt;Today, Linux is widely used in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Web servers&lt;/li&gt;
&lt;li&gt;Cloud infrastructure&lt;/li&gt;
&lt;li&gt;Supercomputers&lt;/li&gt;
&lt;li&gt;Embedded systems&lt;/li&gt;
&lt;li&gt;Networking equipment&lt;/li&gt;
&lt;li&gt;Development environments&lt;/li&gt;
&lt;li&gt;Containers&lt;/li&gt;
&lt;li&gt;Android's kernel foundation&lt;/li&gt;
&lt;li&gt;Routers&lt;/li&gt;
&lt;li&gt;Internet infrastructure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A huge amount of modern computing infrastructure depends on Linux.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Linux Development Model
&lt;/h1&gt;

&lt;p&gt;One of the most interesting parts of Torvalds' work isn't simply the code.&lt;/p&gt;

&lt;p&gt;It is the &lt;strong&gt;development process&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The Linux kernel is developed collaboratively by a large global community.&lt;/p&gt;

&lt;p&gt;A simplified version of the process looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Developer
   │
   ▼
Writes a change
   │
   ▼
Creates a patch
   │
   ▼
Patch is reviewed
   │
   ▼
Maintainer reviews it
   │
   ▼
Changes move through subsystem maintainers
   │
   ▼
Linux kernel integration
   │
   ▼
Testing
   │
   ▼
Release
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This model allows thousands of contributors to work on an enormous codebase while maintaining a structured hierarchy of review and maintenance.&lt;/p&gt;




&lt;h1&gt;
  
  
  What Is the Linux Kernel Actually Doing?
&lt;/h1&gt;

&lt;p&gt;Imagine you write this C program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello, world!&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your program doesn't directly control the hardware.&lt;/p&gt;

&lt;p&gt;There are layers between your application and the physical machine.&lt;/p&gt;

&lt;p&gt;A simplified model looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Your C Program
      │
      ▼
C Library
      │
      ▼
System Calls
      │
      ▼
Linux Kernel
      │
      ▼
Hardware
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example, when a program needs to read a file, it eventually asks the operating system to perform that operation.&lt;/p&gt;

&lt;p&gt;The kernel handles the interaction with the storage device.&lt;/p&gt;

&lt;p&gt;This is one of the fundamental responsibilities of an operating-system kernel:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;providing controlled access to hardware and system resources.&lt;/strong&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Linux and C
&lt;/h1&gt;

&lt;p&gt;If you're learning C and interested in operating systems, Linux is particularly important.&lt;/p&gt;

&lt;p&gt;Much of the Linux kernel is written in C, along with some architecture-specific assembly code.&lt;/p&gt;

&lt;p&gt;This makes Linux an excellent real-world example for understanding systems programming.&lt;/p&gt;

&lt;p&gt;You can encounter concepts such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pointers&lt;/li&gt;
&lt;li&gt;Structures&lt;/li&gt;
&lt;li&gt;Memory management&lt;/li&gt;
&lt;li&gt;Processes&lt;/li&gt;
&lt;li&gt;Threads&lt;/li&gt;
&lt;li&gt;Interrupts&lt;/li&gt;
&lt;li&gt;System calls&lt;/li&gt;
&lt;li&gt;File descriptors&lt;/li&gt;
&lt;li&gt;Virtual memory&lt;/li&gt;
&lt;li&gt;Scheduling&lt;/li&gt;
&lt;li&gt;Device drivers&lt;/li&gt;
&lt;li&gt;Networking&lt;/li&gt;
&lt;li&gt;Synchronization&lt;/li&gt;
&lt;li&gt;Concurrency&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For someone who wants to understand how computers work underneath high-level applications, studying Linux can be extremely valuable.&lt;/p&gt;




&lt;h1&gt;
  
  
  Torvalds Didn't Stop at Linux
&lt;/h1&gt;

&lt;p&gt;Linux is the project most people associate with Linus Torvalds.&lt;/p&gt;

&lt;p&gt;But he also created another extremely important piece of software:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Git is a distributed version-control system.&lt;/p&gt;

&lt;p&gt;It was created in 2005 during a difficult period in Linux kernel development.&lt;/p&gt;

&lt;p&gt;The Linux kernel project needed a powerful way to manage contributions from many developers.&lt;/p&gt;

&lt;p&gt;Torvalds decided to build a new version-control system.&lt;/p&gt;

&lt;p&gt;That system became Git.&lt;/p&gt;




&lt;h1&gt;
  
  
  What Is Git?
&lt;/h1&gt;

&lt;p&gt;Suppose you are developing a project.&lt;/p&gt;

&lt;p&gt;You might have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;project/
├── main.c
├── database.c
├── database.h
└── README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You make changes today.&lt;/p&gt;

&lt;p&gt;Tomorrow, you change something else.&lt;/p&gt;

&lt;p&gt;Then you realize:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The project worked yesterday. What did I change?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Without version control, this can become painful.&lt;/p&gt;

&lt;p&gt;Git solves this problem by recording the history of your project.&lt;/p&gt;

&lt;p&gt;A simplified Git workflow looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Working Directory
       │
       ▼
     git add
       │
       ▼
   Staging Area
       │
       ▼
   git commit
       │
       ▼
 Git Repository
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can then inspect previous versions of your project.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why Git Became So Important
&lt;/h1&gt;

&lt;p&gt;Git has several powerful properties.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Distributed
&lt;/h2&gt;

&lt;p&gt;Every Git clone can contain the complete repository history.&lt;/p&gt;

&lt;p&gt;That means developers don't necessarily need to depend on one central server for the repository's history.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Fast
&lt;/h2&gt;

&lt;p&gt;Git was designed to handle very large development projects efficiently.&lt;/p&gt;

&lt;p&gt;This was particularly important for the Linux kernel.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Branching
&lt;/h2&gt;

&lt;p&gt;Developers can create branches for different features or experiments.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;main
 │
 ├── feature-login
 │
 ├── feature-database
 │
 └── bugfix-memory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Different developers can work on different branches and later merge their work.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. History
&lt;/h2&gt;

&lt;p&gt;Git records commits.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A → B → C → D → E
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each commit represents a point in the project's development history.&lt;/p&gt;

&lt;p&gt;This makes it possible to understand how a project evolved.&lt;/p&gt;




&lt;h1&gt;
  
  
  GitHub and Git Are Not the Same Thing
&lt;/h1&gt;

&lt;p&gt;This distinction is important for beginners.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git&lt;/strong&gt; is a version-control system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub&lt;/strong&gt; is a platform that hosts Git repositories and provides collaboration features.&lt;/p&gt;

&lt;p&gt;You can use Git without GitHub.&lt;/p&gt;

&lt;p&gt;You can also use Git with other hosting platforms or your own servers.&lt;/p&gt;

&lt;p&gt;Think of it this way:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Git
│
└── Version control

GitHub
│
├── Repository hosting
├── Pull requests
├── Issues
├── Collaboration
└── Other development tools
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git itself was created by Linus Torvalds.&lt;/p&gt;




&lt;h1&gt;
  
  
  Torvalds' Programming Philosophy
&lt;/h1&gt;

&lt;p&gt;One reason Torvalds is influential is his strong focus on practical engineering.&lt;/p&gt;

&lt;p&gt;Operating-system development requires thinking about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Performance&lt;/li&gt;
&lt;li&gt;Memory&lt;/li&gt;
&lt;li&gt;Hardware&lt;/li&gt;
&lt;li&gt;Concurrency&lt;/li&gt;
&lt;li&gt;Reliability&lt;/li&gt;
&lt;li&gt;Compatibility&lt;/li&gt;
&lt;li&gt;Maintainability&lt;/li&gt;
&lt;li&gt;Scalability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A small mistake in low-level software can affect an enormous number of systems.&lt;/p&gt;

&lt;p&gt;That makes kernel development very different from writing a small application.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why Linux Is Difficult to Build
&lt;/h1&gt;

&lt;p&gt;If you're learning C and thinking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I want to build my own operating system."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Linux demonstrates just how large that problem can become.&lt;/p&gt;

&lt;p&gt;A modern operating system requires many subsystems.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Operating System
│
├── Boot process
├── Kernel
│   ├── Process management
│   ├── Memory management
│   ├── Scheduling
│   ├── System calls
│   ├── Virtual memory
│   ├── Networking
│   ├── Filesystems
│   └── Device drivers
│
├── User-space libraries
├── Shell
├── Utilities
└── Applications
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You don't need to build everything at once.&lt;/p&gt;

&lt;p&gt;A beginner can start much smaller.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Step 1 → Boot a tiny program
Step 2 → Print text
Step 3 → Handle interrupts
Step 4 → Manage memory
Step 5 → Implement processes
Step 6 → Add system calls
Step 7 → Build a filesystem
Step 8 → Add networking
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This incremental approach is much more realistic.&lt;/p&gt;




&lt;h1&gt;
  
  
  What Can We Learn From Linus Torvalds?
&lt;/h1&gt;

&lt;p&gt;There are several lessons programmers can take from his career.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Start With a Real Project
&lt;/h2&gt;

&lt;p&gt;Linux began as a personal project.&lt;/p&gt;

&lt;p&gt;You don't need to wait until you know everything before building something.&lt;/p&gt;

&lt;p&gt;Build.&lt;/p&gt;

&lt;p&gt;Then discover what you don't know.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Learn How Computers Actually Work
&lt;/h2&gt;

&lt;p&gt;If you only learn high-level programming, you can build useful applications.&lt;/p&gt;

&lt;p&gt;But learning lower-level concepts gives you a different understanding of computers.&lt;/p&gt;

&lt;p&gt;Study:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C
 ↓
Assembly
 ↓
CPU
 ↓
Memory
 ↓
Operating System
 ↓
System Calls
 ↓
Hardware
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You don't have to become an expert in every layer immediately.&lt;/p&gt;

&lt;p&gt;But understanding the layers is extremely useful.&lt;/p&gt;




&lt;h1&gt;
  
  
  3. Read Other People's Code
&lt;/h1&gt;

&lt;p&gt;Linux is one of the largest examples of real-world systems software.&lt;/p&gt;

&lt;p&gt;Reading mature code teaches you things tutorials often don't.&lt;/p&gt;

&lt;p&gt;You can learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How large projects are organized&lt;/li&gt;
&lt;li&gt;How abstractions are designed&lt;/li&gt;
&lt;li&gt;How errors are handled&lt;/li&gt;
&lt;li&gt;How data structures are used&lt;/li&gt;
&lt;li&gt;How concurrency is implemented&lt;/li&gt;
&lt;li&gt;How performance matters&lt;/li&gt;
&lt;li&gt;How APIs evolve&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, don't start by trying to understand the entire Linux kernel.&lt;/p&gt;

&lt;p&gt;That's an inefficient approach.&lt;/p&gt;

&lt;p&gt;Start with smaller subsystems and concepts.&lt;/p&gt;




&lt;h1&gt;
  
  
  4. Understand Version Control
&lt;/h1&gt;

&lt;p&gt;If you are serious about programming, Git is not merely another tool to memorize.&lt;/p&gt;

&lt;p&gt;You should understand:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;repository
commit
branch
merge
rebase
remote
diff
tag
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These concepts become essential when working on real software projects.&lt;/p&gt;




&lt;h1&gt;
  
  
  5. Build Things That Are Difficult
&lt;/h1&gt;

&lt;p&gt;Torvalds' work demonstrates the value of tackling technically challenging projects.&lt;/p&gt;

&lt;p&gt;You could build smaller versions of systems such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Text Editor
      ↓
Shell
      ↓
Filesystem
      ↓
Database
      ↓
Network Server
      ↓
Compiler
      ↓
Operating System Kernel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You don't need to build a production-quality version.&lt;/p&gt;

&lt;p&gt;The goal is understanding.&lt;/p&gt;

&lt;p&gt;For example, building a small database in C can teach you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Disk layout&lt;/li&gt;
&lt;li&gt;Pages&lt;/li&gt;
&lt;li&gt;Buffer pools&lt;/li&gt;
&lt;li&gt;Indexes&lt;/li&gt;
&lt;li&gt;Serialization&lt;/li&gt;
&lt;li&gt;File I/O&lt;/li&gt;
&lt;li&gt;Memory management&lt;/li&gt;
&lt;li&gt;Concurrency&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Building a filesystem can teach you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Blocks&lt;/li&gt;
&lt;li&gt;Inodes&lt;/li&gt;
&lt;li&gt;Directories&lt;/li&gt;
&lt;li&gt;Bitmaps&lt;/li&gt;
&lt;li&gt;Allocation&lt;/li&gt;
&lt;li&gt;Metadata&lt;/li&gt;
&lt;li&gt;File descriptors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These projects make abstract concepts concrete.&lt;/p&gt;




&lt;h1&gt;
  
  
  Linux Is Bigger Than Linus Torvalds
&lt;/h1&gt;

&lt;p&gt;An important point is that modern Linux is &lt;strong&gt;not the work of one person&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Torvalds started the project and remains its creator and principal maintainer, but Linux has grown through contributions from a massive international community.&lt;/p&gt;

&lt;p&gt;Companies, universities, independent developers, and organizations have contributed to its development.&lt;/p&gt;

&lt;p&gt;This is one of the most impressive aspects of open-source software.&lt;/p&gt;

&lt;p&gt;A project can begin with one programmer and eventually become a global engineering effort.&lt;/p&gt;




&lt;h1&gt;
  
  
  A Simplified Timeline
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1969
 │
 └── Linus Torvalds is born
       │
1980s
 │
 └── Develops an interest in computers
       │
1991
 │
 └── Begins developing Linux
       │
1990s
 │
 └── Linux community grows
       │
2005
 │
 └── Torvalds creates Git
       │
2000s–2020s
 │
 └── Linux becomes fundamental
     infrastructure for modern computing
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  The Bigger Lesson
&lt;/h1&gt;

&lt;p&gt;The most interesting part of Linus Torvalds' story isn't simply that he created Linux.&lt;/p&gt;

&lt;p&gt;It's that a relatively small technical project can become enormously important when:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The problem is interesting.&lt;/li&gt;
&lt;li&gt;The implementation is useful.&lt;/li&gt;
&lt;li&gt;The project is shared with others.&lt;/li&gt;
&lt;li&gt;Developers can contribute.&lt;/li&gt;
&lt;li&gt;The software continues to evolve.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Linux demonstrates the power of collaborative engineering.&lt;/p&gt;

&lt;p&gt;Git demonstrates the importance of tools that make collaboration possible.&lt;/p&gt;

&lt;p&gt;Together, they have had an enormous influence on modern software development.&lt;/p&gt;




&lt;h1&gt;
  
  
  If You Want to Follow a Similar Learning Path
&lt;/h1&gt;

&lt;p&gt;You don't need to try to become "the next Linus Torvalds."&lt;/p&gt;

&lt;p&gt;Instead, focus on becoming a strong programmer.&lt;/p&gt;

&lt;p&gt;A practical path could look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C Programming
      ↓
Data Structures
      ↓
Algorithms
      ↓
Linux
      ↓
Systems Programming
      ↓
Computer Architecture
      ↓
Operating Systems
      ↓
Networking
      ↓
Filesystems
      ↓
Databases
      ↓
Large Software Projects
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then build projects.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Project 1 → Shell
Project 2 → Text Editor
Project 3 → HTTP Server
Project 4 → Database
Project 5 → Filesystem
Project 6 → Compiler
Project 7 → Small Operating System
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each project forces you to learn another part of computer science.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Linus Torvalds' career is a remarkable example of how software can grow from a personal experiment into infrastructure used around the world.&lt;/p&gt;

&lt;p&gt;Linux changed operating systems.&lt;/p&gt;

&lt;p&gt;Git changed how developers manage source code.&lt;/p&gt;

&lt;p&gt;But perhaps the most valuable lesson is simpler:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Build things.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Don't wait until you understand everything.&lt;/p&gt;

&lt;p&gt;Start with a manageable problem.&lt;/p&gt;

&lt;p&gt;Write the code.&lt;/p&gt;

&lt;p&gt;Break it.&lt;/p&gt;

&lt;p&gt;Debug it.&lt;/p&gt;

&lt;p&gt;Read documentation.&lt;/p&gt;

&lt;p&gt;Study other implementations.&lt;/p&gt;

&lt;p&gt;Improve it.&lt;/p&gt;

&lt;p&gt;Then build something harder.&lt;/p&gt;

&lt;p&gt;That's how small programming projects turn into serious engineering experience.&lt;/p&gt;

&lt;p&gt;And that's one of the most important lessons we can take from the story of &lt;strong&gt;Linus Torvalds, Linux, and Git&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>git</category>
      <category>code</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to Build Your Own SQLite Database From Scratch</title>
      <dc:creator>Farhad Rahimi Klie</dc:creator>
      <pubDate>Sun, 16 Aug 2026 05:31:33 +0000</pubDate>
      <link>https://dev.to/farhadrahimiklie/how-to-build-your-own-sqlite-database-from-scratch-2lcm</link>
      <guid>https://dev.to/farhadrahimiklie/how-to-build-your-own-sqlite-database-from-scratch-2lcm</guid>
      <description>&lt;p&gt;Have you ever wondered what actually happens when you run a SQL query like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where is the data stored?&lt;/p&gt;

&lt;p&gt;How does the database find the correct row?&lt;/p&gt;

&lt;p&gt;How are tables represented on disk?&lt;/p&gt;

&lt;p&gt;How does the database survive after the program exits?&lt;/p&gt;

&lt;p&gt;And how does a database engine turn SQL into operations on bytes, pages, indexes, and files?&lt;/p&gt;

&lt;p&gt;Instead of only using a database, let's build a small &lt;strong&gt;SQLite-like database engine from scratch in C&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We won't try to recreate all of SQLite. That would be an enormous project. Instead, we'll build a small educational database engine that teaches the fundamental architecture behind relational databases.&lt;/p&gt;

&lt;p&gt;By the end, we'll understand how the pieces fit together:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                 SQL Query
                    │
                    ▼
             ┌─────────────┐
             │ SQL Parser  │
             └──────┬──────┘
                    │
                    ▼
             ┌─────────────┐
             │ Query Plan  │
             └──────┬──────┘
                    │
                    ▼
             ┌─────────────┐
             │   Executor  │
             └──────┬──────┘
                    │
                    ▼
             ┌─────────────┐
             │    B-Tree   │
             └──────┬──────┘
                    │
                    ▼
             ┌─────────────┐
             │ Buffer Pool │
             └──────┬──────┘
                    │
                    ▼
             ┌─────────────┐
             │ Disk / File │
             └─────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's build it step by step.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. What Are We Actually Building?
&lt;/h2&gt;

&lt;p&gt;Our goal is a small database executable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;./mydb database.db
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we can interact with it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db &amp;gt; CREATE TABLE users;
db &amp;gt; INSERT INTO users VALUES (1, "Farhad");
db &amp;gt; INSERT INTO users VALUES (2, "Ali");
db &amp;gt; SELECT * FROM users;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And eventually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 | Farhad
2 | Ali
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important part is that the data should remain after the program exits.&lt;/p&gt;

&lt;p&gt;If we run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;./mydb database.db
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;again, the database should still contain:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 | Farhad
2 | Ali
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That means we need persistent storage.&lt;/p&gt;




&lt;h1&gt;
  
  
  2. Why C?
&lt;/h1&gt;

&lt;p&gt;C is an excellent language for learning how databases work internally because it gives us direct control over:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;memory&lt;/li&gt;
&lt;li&gt;pointers&lt;/li&gt;
&lt;li&gt;structs&lt;/li&gt;
&lt;li&gt;files&lt;/li&gt;
&lt;li&gt;byte arrays&lt;/li&gt;
&lt;li&gt;serialization&lt;/li&gt;
&lt;li&gt;memory allocation&lt;/li&gt;
&lt;li&gt;system calls&lt;/li&gt;
&lt;li&gt;data structures&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A database engine ultimately deals with a lot of low-level concepts.&lt;/p&gt;

&lt;p&gt;For example, a database page might simply be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4096&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Those 4096 bytes could contain:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+----------------------------------+
| Page Header                      |
+----------------------------------+
| Slot Array                       |
+----------------------------------+
|                                  |
| Records                          |
|                                  |
+----------------------------------+
| Free Space                       |
+----------------------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this level, there is no magic.&lt;/p&gt;

&lt;p&gt;It's bytes.&lt;/p&gt;

&lt;p&gt;Our job is to give those bytes meaning.&lt;/p&gt;




&lt;h1&gt;
  
  
  3. The Architecture
&lt;/h1&gt;

&lt;p&gt;Before writing code, we need an architecture.&lt;/p&gt;

&lt;p&gt;A simplified database can be divided into several layers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌───────────────────────────────┐
│          SQL Layer            │
│ Lexer / Parser / Statements   │
├───────────────────────────────┤
│        Query Executor         │
├───────────────────────────────┤
│       Access Methods          │
│       Table / B-Tree          │
├───────────────────────────────┤
│         Buffer Pool           │
├───────────────────────────────┤
│          Page Cache           │
├───────────────────────────────┤
│        Storage Manager        │
├───────────────────────────────┤
│        Database File          │
└───────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We'll implement these components incrementally.&lt;/p&gt;




&lt;h1&gt;
  
  
  4. Step 1 — The Database File
&lt;/h1&gt;

&lt;p&gt;The simplest database can start as a normal file.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;database.db
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can open it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;FILE&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fopen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"database.db"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"r+b"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or create it if it doesn't exist:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;FILE&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fopen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"database.db"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"w+b"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But simply writing random structures into a file isn't enough.&lt;/p&gt;

&lt;p&gt;We need a storage format.&lt;/p&gt;




&lt;h1&gt;
  
  
  5. Step 2 — Pages
&lt;/h1&gt;

&lt;p&gt;Databases generally don't treat the disk as one giant byte array.&lt;/p&gt;

&lt;p&gt;Instead, we divide the database file into fixed-size pages.&lt;/p&gt;

&lt;p&gt;For our educational database:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#define PAGE_SIZE 4096
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A database file might look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;database.db

┌──────────────┐
│ Page 0       │
│ 4096 bytes   │
├──────────────┤
│ Page 1       │
│ 4096 bytes   │
├──────────────┤
│ Page 2       │
│ 4096 bytes   │
├──────────────┤
│ Page 3       │
│ 4096 bytes   │
├──────────────┤
│ ...          │
└──────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the database has 100 pages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;100 × 4096 = 409,600 bytes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A page gives us a fixed unit for storage and caching.&lt;/p&gt;




&lt;h1&gt;
  
  
  6. Why Pages?
&lt;/h1&gt;

&lt;p&gt;Suppose we need record number 500.&lt;/p&gt;

&lt;p&gt;We don't want to read the entire database file.&lt;/p&gt;

&lt;p&gt;Instead, we determine which page contains the record:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;record
   │
   ▼
page number
   │
   ▼
database file offset
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The offset is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;offset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;page_number&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;PAGE_SIZE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;page = 10

offset = 10 × 4096
       = 40960
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So page 10 begins at byte 40960.&lt;/p&gt;




&lt;h1&gt;
  
  
  7. Step 3 — The Pager
&lt;/h1&gt;

&lt;p&gt;Now we create one of the most important components:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;the pager.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The pager is responsible for moving pages between the database file and memory.&lt;/p&gt;

&lt;p&gt;Conceptually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;             RAM
       ┌──────────────┐
       │ Page 0       │
       │ Page 4       │
       │ Page 7       │
       └───────┬──────┘
               │
               │
          ┌────▼────┐
          │  Pager  │
          └────┬────┘
               │
               ▼
       ┌──────────────┐
       │ database.db  │
       └──────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A basic pager structure might look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#define TABLE_MAX_PAGES 100
&lt;/span&gt;
&lt;span class="k"&gt;typedef&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;file_descriptor&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;uint32_t&lt;/span&gt; &lt;span class="n"&gt;file_length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;TABLE_MAX_PAGES&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;Pager&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;pages&lt;/code&gt; array stores pointers to pages currently loaded in memory.&lt;/p&gt;




&lt;h1&gt;
  
  
  8. Loading a Page
&lt;/h1&gt;

&lt;p&gt;Suppose we request page 5.&lt;/p&gt;

&lt;p&gt;The pager checks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pager&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="nb"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it isn't loaded, allocate memory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;pager&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;malloc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;PAGE_SIZE&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then read the page from disk.&lt;/p&gt;

&lt;p&gt;Conceptually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;database.db
     │
     │ read page 5
     ▼
┌─────────────┐
│ Page 5      │
└─────────────┘
     │
     ▼
RAM
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the beginning of a buffer pool/cache.&lt;/p&gt;




&lt;h1&gt;
  
  
  9. Step 4 — Rows
&lt;/h1&gt;

&lt;p&gt;Now we need to decide how a table row is represented.&lt;/p&gt;

&lt;p&gt;For a simple database, let's define:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;typedef&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;uint32_t&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;Row&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A row might contain:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;id       = 1
username = "Farhad"
email    = "farhad@example.com"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But we cannot simply assume that a C struct's memory layout is our database format.&lt;/p&gt;

&lt;p&gt;We should explicitly serialize the row.&lt;/p&gt;




&lt;h1&gt;
  
  
  10. Serialization
&lt;/h1&gt;

&lt;p&gt;Serialization means converting a C structure into bytes.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C structure

Row
┌───────────────┐
│ id            │
├───────────────┤
│ username      │
├───────────────┤
│ email         │
└───────────────┘
       │
       ▼
   serialize
       │
       ▼
Bytes on disk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;serialize_row&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Row&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;destination&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;memcpy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;destination&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;sizeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

    &lt;span class="n"&gt;memcpy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;destination&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
           &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
           &lt;span class="k"&gt;sizeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

    &lt;span class="n"&gt;memcpy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;destination&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;36&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
           &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
           &lt;span class="k"&gt;sizeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And later deserialize it.&lt;/p&gt;

&lt;p&gt;This is important because the database file needs a well-defined format.&lt;/p&gt;




&lt;h1&gt;
  
  
  11. Step 5 — The Table
&lt;/h1&gt;

&lt;p&gt;Now we can store rows inside pages.&lt;/p&gt;

&lt;p&gt;Initially, we could use a very simple layout:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Page
┌──────────────────────────────┐
│ Row 0                        │
├──────────────────────────────┤
│ Row 1                        │
├──────────────────────────────┤
│ Row 2                        │
├──────────────────────────────┤
│ Row 3                        │
├──────────────────────────────┤
│ ...                          │
└──────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#define ROW_SIZE 100
&lt;/span&gt;
&lt;span class="cp"&gt;#define ROWS_PER_PAGE \
    (PAGE_SIZE / ROW_SIZE)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;page_number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;row_number&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;ROWS_PER_PAGE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;row_offset&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;row_number&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;ROWS_PER_PAGE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives us a simple way to locate rows.&lt;/p&gt;




&lt;h1&gt;
  
  
  12. Step 6 — The REPL
&lt;/h1&gt;

&lt;p&gt;Now let's create an interface.&lt;/p&gt;

&lt;p&gt;A REPL means:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read → Evaluate → Print → Loop&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Our program could display:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db &amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The user enters:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db &amp;gt; insert 1 Farhad
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our program reads the input:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"db &amp;gt; "&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;fgets&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;sizeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;stdin&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// process input&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At first, don't implement SQL.&lt;/p&gt;

&lt;p&gt;Start with commands like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;insert
select
.exit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes development much easier.&lt;/p&gt;




&lt;h1&gt;
  
  
  13. Step 7 — INSERT
&lt;/h1&gt;

&lt;p&gt;Suppose the user enters:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;insert 1 Farhad
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The database needs to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Input
 │
 ▼
Parse command
 │
 ▼
Create Row
 │
 ▼
Serialize Row
 │
 ▼
Find page
 │
 ▼
Write Row
 │
 ▼
Mark page dirty
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Conceptually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;Row&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;strcpy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Farhad"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="n"&gt;execute_insert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  14. Step 8 — SELECT
&lt;/h1&gt;

&lt;p&gt;Now:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;select
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;should read all rows.&lt;/p&gt;

&lt;p&gt;The executor might:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for each page
    load page

    for each row
        deserialize row

        print row
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Conceptually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;database
   │
   ▼
Page 0
   │
   ├── Row 0
   ├── Row 1
   └── Row 2

Page 1
   │
   ├── Row 3
   ├── Row 4
   └── Row 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is essentially a table scan.&lt;/p&gt;




&lt;h1&gt;
  
  
  15. Step 9 — From Commands to SQL
&lt;/h1&gt;

&lt;p&gt;Once the storage engine works, we can start implementing SQL.&lt;/p&gt;

&lt;p&gt;Instead of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;insert 1 Farhad
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we want:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Farhad'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we need a lexer and parser.&lt;/p&gt;




&lt;h1&gt;
  
  
  16. The SQL Lexer
&lt;/h1&gt;

&lt;p&gt;The lexer converts characters into tokens.&lt;/p&gt;

&lt;p&gt;For:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we might produce:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT
ASTERISK
FROM
IDENTIFIER(users)
SEMICOLON
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The input:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT * FROM users;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;becomes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌────────┐
│ SELECT │
├────────┤
│   *    │
├────────┤
│  FROM  │
├────────┤
│ users  │
├────────┤
│   ;    │
└────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  17. The Parser
&lt;/h1&gt;

&lt;p&gt;The parser takes those tokens and builds a representation of the query.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;could become:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SelectStatement
├── columns: *
└── table: users
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Farhad'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we could create:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;InsertStatement
├── table: users
└── values
    ├── 1
    └── Farhad
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  18. Step 10 — The Query Executor
&lt;/h1&gt;

&lt;p&gt;The parser tells us &lt;strong&gt;what the user wants&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The executor determines &lt;strong&gt;how to perform it&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;might become:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Parser
   │
   ▼
SELECT statement
   │
   ▼
Executor
   │
   ▼
Table scan
   │
   ▼
Read pages
   │
   ▼
Read rows
   │
   ▼
Return results
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This separation is extremely important.&lt;/p&gt;




&lt;h1&gt;
  
  
  19. Step 11 — Slotted Pages
&lt;/h1&gt;

&lt;p&gt;Our first page layout was very simple.&lt;/p&gt;

&lt;p&gt;A real database needs a more flexible structure.&lt;/p&gt;

&lt;p&gt;This is where &lt;strong&gt;slotted pages&lt;/strong&gt; become useful.&lt;/p&gt;

&lt;p&gt;A page might look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌─────────────────────────────┐
│ Page Header                 │
├─────────────────────────────┤
│ Slot 0                      │
├─────────────────────────────┤
│ Slot 1                      │
├─────────────────────────────┤
│ Slot 2                      │
├─────────────────────────────┤
│                             │
│ Free Space                  │
│                             │
├─────────────────────────────┤
│ Record 2                    │
├─────────────────────────────┤
│ Record 1                    │
├─────────────────────────────┤
│ Record 0                    │
└─────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The slot array tells us where records are located.&lt;/p&gt;

&lt;p&gt;This allows records to have variable sizes and move around within a page without changing their logical identifiers.&lt;/p&gt;




&lt;h1&gt;
  
  
  20. Step 12 — Record IDs
&lt;/h1&gt;

&lt;p&gt;Instead of identifying a record simply by its memory address, we can use a logical identifier.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RID
├── page_id
└── slot_id
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RID = (12, 4)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;means:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Page 12
Slot 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives us a stable way to refer to records.&lt;/p&gt;




&lt;h1&gt;
  
  
  21. Step 13 — Free Space Management
&lt;/h1&gt;

&lt;p&gt;Eventually pages become full.&lt;/p&gt;

&lt;p&gt;We need to know:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Which pages have free space?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A simple free-space map could track this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Page 0 → full
Page 1 → 1200 bytes free
Page 2 → full
Page 3 → 3000 bytes free
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When inserting a record, the storage manager searches for a page with enough free space.&lt;/p&gt;

&lt;p&gt;This is one of the fundamental responsibilities of a storage engine.&lt;/p&gt;




&lt;h1&gt;
  
  
  22. Step 14 — B-Tree Indexes
&lt;/h1&gt;

&lt;p&gt;A table scan works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But it can be very slow.&lt;/p&gt;

&lt;p&gt;If there are one million rows, scanning every row is expensive.&lt;/p&gt;

&lt;p&gt;We need an index.&lt;/p&gt;

&lt;p&gt;A common database index structure is a &lt;strong&gt;B-tree&lt;/strong&gt; or &lt;strong&gt;B+ tree&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Conceptually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                  [50]
                /      \
              /          \
         [10,20,30]     [60,70,80]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The index lets us navigate toward the desired key instead of scanning every row.&lt;/p&gt;

&lt;p&gt;For:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;70&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we navigate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          [50]
            \
             ▼
       [60,70,80]
            │
            ▼
          row 70
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  23. Why B-Trees?
&lt;/h1&gt;

&lt;p&gt;B-trees are particularly useful for storage systems because they reduce the number of disk/page accesses required to locate records.&lt;/p&gt;

&lt;p&gt;Instead of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Page 0
Page 1
Page 2
Page 3
...
Page 1,000,000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we can navigate through a tree:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;             Root
              │
       ┌──────┴──────┐
       ▼             ▼
    Internal       Internal
       │             │
       ▼             ▼
     Leaves         Leaves
       │
       ▼
     Record
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The database doesn't have to inspect every row.&lt;/p&gt;




&lt;h1&gt;
  
  
  24. Step 15 — Buffer Pool
&lt;/h1&gt;

&lt;p&gt;Disk is much slower than RAM.&lt;/p&gt;

&lt;p&gt;Therefore, databases keep frequently used pages in memory.&lt;/p&gt;

&lt;p&gt;A buffer pool might look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RAM

┌───────────────┐
│ Frame 0       │ → Page 17
├───────────────┤
│ Frame 1       │ → Page 4
├───────────────┤
│ Frame 2       │ → Page 31
├───────────────┤
│ Frame 3       │ → Page 9
└───────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the database requests page 17:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Request Page 17
      │
      ▼
Is it in buffer?
      │
   ┌──┴──┐
  yes    no
   │      │
   ▼      ▼
 return  read disk
          │
          ▼
       buffer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This dramatically reduces disk I/O.&lt;/p&gt;




&lt;h1&gt;
  
  
  25. Dirty Pages
&lt;/h1&gt;

&lt;p&gt;Suppose we load a page:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Disk → RAM
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then modify it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RAM
Page 5
  │
  └── modified
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The page is now &lt;strong&gt;dirty&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Eventually we need:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RAM → Disk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So a buffer frame might have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;typedef&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;uint32_t&lt;/span&gt; &lt;span class="n"&gt;page_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;dirty&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;Frame&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;frame&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;dirty&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we know the page must eventually be written back.&lt;/p&gt;




&lt;h1&gt;
  
  
  26. Step 16 — Transactions
&lt;/h1&gt;

&lt;p&gt;Now we reach a much more serious database feature.&lt;/p&gt;

&lt;p&gt;What happens if the program crashes halfway through a write?&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Transaction:

1. Update row A
2. Update row B
3. Program crashes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We don't want the database to end up in an inconsistent state.&lt;/p&gt;

&lt;p&gt;Transactions provide atomicity.&lt;/p&gt;

&lt;p&gt;Conceptually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;BEGIN
   │
   ├── operation 1
   ├── operation 2
   ├── operation 3
   │
COMMIT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;BEGIN
   │
   ├── operation 1
   ├── operation 2
   │
ROLLBACK
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  27. Step 17 — Write-Ahead Logging
&lt;/h1&gt;

&lt;p&gt;A common technique is &lt;strong&gt;Write-Ahead Logging (WAL)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Before modifying the actual database page, record the change in a log.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;             Transaction
                  │
                  ▼
             Write Log
                  │
                  ▼
             Modify Page
                  │
                  ▼
               Commit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the database crashes, the log can be used during recovery.&lt;/p&gt;

&lt;p&gt;This is one of the major steps from a toy database toward a real database engine.&lt;/p&gt;




&lt;h1&gt;
  
  
  28. Step 18 — Database Catalog
&lt;/h1&gt;

&lt;p&gt;Once we support multiple tables, the database needs metadata.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt; &lt;span class="p"&gt;(...);&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt; &lt;span class="p"&gt;(...);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The database needs to know:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;users
 ├── columns
 ├── types
 └── root page

products
 ├── columns
 ├── types
 └── root page
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This metadata is often called the &lt;strong&gt;system catalog&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Our catalog could contain information such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Table name
Column name
Column type
Column position
Index information
Root page
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  29. Step 19 — Data Types
&lt;/h1&gt;

&lt;p&gt;Eventually our SQL engine should understand:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INTEGER
TEXT
REAL
BOOLEAN
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="nb"&gt;INTEGER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="nb"&gt;TEXT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="nb"&gt;INTEGER&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Internally, a row might be serialized as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌──────────┬────────────┬──────────┐
│ id       │ name       │ age      │
│ INTEGER  │ TEXT       │ INTEGER  │
└──────────┴────────────┴──────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The serialization layer needs to understand each type.&lt;/p&gt;




&lt;h1&gt;
  
  
  30. Step 20 — Query Execution
&lt;/h1&gt;

&lt;p&gt;Eventually we want queries such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The execution pipeline becomes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SQL
 │
 ▼
Lexer
 │
 ▼
Parser
 │
 ▼
AST
 │
 ▼
Query Planner
 │
 ▼
Execution Plan
 │
 ▼
Executor
 │
 ▼
Index / Table Scan
 │
 ▼
Pages
 │
 ▼
Rows
 │
 ▼
Result
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is where our database starts becoming a real database engine rather than a file-based storage program.&lt;/p&gt;




&lt;h1&gt;
  
  
  31. A Practical Development Roadmap
&lt;/h1&gt;

&lt;p&gt;Don't try to build everything at once.&lt;/p&gt;

&lt;p&gt;Build the database in stages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stage 1 — File Storage
&lt;/h3&gt;

&lt;p&gt;Implement:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;database file
page size
read page
write page
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Stage 2 — Pager
&lt;/h3&gt;

&lt;p&gt;Implement:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Pager
page cache
page loading
page flushing
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Stage 3 — Rows
&lt;/h3&gt;

&lt;p&gt;Implement:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Row
serialize
deserialize
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Stage 4 — Table
&lt;/h3&gt;

&lt;p&gt;Implement:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;insert
select
table scan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Stage 5 — REPL
&lt;/h3&gt;

&lt;p&gt;Implement:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db &amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;with commands such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.insert
.select
.exit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Stage 6 — SQL Lexer
&lt;/h3&gt;

&lt;p&gt;Implement tokens:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT
INSERT
CREATE
FROM
WHERE
INTEGER
TEXT
IDENTIFIER
NUMBER
STRING
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Stage 7 — SQL Parser
&lt;/h3&gt;

&lt;p&gt;Build an AST for SQL statements.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stage 8 — Slotted Pages
&lt;/h3&gt;

&lt;p&gt;Implement:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;page header
slot directory
records
free space
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Stage 9 — B-Tree
&lt;/h3&gt;

&lt;p&gt;Implement:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;leaf nodes
internal nodes
search
insert
split
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Stage 10 — Catalog
&lt;/h3&gt;

&lt;p&gt;Implement:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tables
columns
types
indexes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Stage 11 — Query Execution
&lt;/h3&gt;

&lt;p&gt;Implement:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;table scan
index scan
filter
projection
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Stage 12 — Transactions
&lt;/h3&gt;

&lt;p&gt;Implement:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;BEGIN
COMMIT
ROLLBACK
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Stage 13 — WAL and Recovery
&lt;/h3&gt;

&lt;p&gt;Implement:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;log
checkpoint
recovery
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Stage 14 — Concurrency
&lt;/h3&gt;

&lt;p&gt;Eventually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;locks
latches
transactions
isolation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  32. Suggested Project Structure
&lt;/h1&gt;

&lt;p&gt;A clean project might eventually look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mydb/
│
├── src/
│   ├── main.c
│   ├── repl.c
│   ├── lexer.c
│   ├── parser.c
│   ├── executor.c
│   ├── catalog.c
│   ├── table.c
│   ├── row.c
│   ├── page.c
│   ├── pager.c
│   ├── buffer_pool.c
│   ├── btree.c
│   ├── transaction.c
│   ├── wal.c
│   └── recovery.c
│
├── include/
│   ├── repl.h
│   ├── lexer.h
│   ├── parser.h
│   ├── executor.h
│   ├── catalog.h
│   ├── table.h
│   ├── row.h
│   ├── page.h
│   ├── pager.h
│   ├── buffer_pool.h
│   ├── btree.h
│   ├── transaction.h
│   ├── wal.h
│   └── recovery.h
│
├── tests/
│   ├── test_pager.c
│   ├── test_page.c
│   ├── test_btree.c
│   └── test_sql.c
│
├── Makefile
└── database.db
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You don't need all of these files on day one.&lt;/p&gt;

&lt;p&gt;Start small and grow the architecture as the database becomes more capable.&lt;/p&gt;




&lt;h1&gt;
  
  
  33. The Most Important Concept
&lt;/h1&gt;

&lt;p&gt;The biggest lesson from building a database from scratch is this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A database is not just SQL.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;SQL is only the interface.&lt;/p&gt;

&lt;p&gt;Underneath SQL are many layers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SQL
 ↓
Parser
 ↓
Query Planner
 ↓
Executor
 ↓
Indexes
 ↓
Tables
 ↓
Records
 ↓
Pages
 ↓
Buffer Pool
 ↓
Storage Manager
 ↓
Operating System
 ↓
Disk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And underneath all of that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bytes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Understanding those layers gives you a completely different perspective on databases.&lt;/p&gt;




&lt;h1&gt;
  
  
  34. What We Should Not Build Initially
&lt;/h1&gt;

&lt;p&gt;A common mistake is trying to implement everything immediately.&lt;/p&gt;

&lt;p&gt;Don't start with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SQL
Transactions
WAL
Concurrency
B-Trees
Joins
Indexes
Networking
Replication
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;all at once.&lt;/p&gt;

&lt;p&gt;Instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;file
 ↓
pages
 ↓
pager
 ↓
rows
 ↓
table
 ↓
insert/select
 ↓
B-tree
 ↓
SQL
 ↓
transactions
 ↓
WAL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each stage should work before moving to the next.&lt;/p&gt;




&lt;h1&gt;
  
  
  35. Final Architecture
&lt;/h1&gt;

&lt;p&gt;Our final educational database could look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                    USER
                     │
                     ▼
              ┌─────────────┐
              │     SQL     │
              └──────┬──────┘
                     ▼
              ┌─────────────┐
              │    Lexer    │
              └──────┬──────┘
                     ▼
              ┌─────────────┐
              │    Parser   │
              └──────┬──────┘
                     ▼
              ┌─────────────┐
              │Query Planner│
              └──────┬──────┘
                     ▼
              ┌─────────────┐
              │   Executor  │
              └──────┬──────┘
                     ▼
           ┌─────────┴─────────┐
           │                   │
           ▼                   ▼
      Table Scan            B-Tree
           │                   │
           └─────────┬─────────┘
                     ▼
              ┌─────────────┐
              │ Buffer Pool │
              └──────┬──────┘
                     ▼
              ┌─────────────┐
              │    Pager    │
              └──────┬──────┘
                     ▼
              ┌─────────────┐
              │ Database DB │
              │    File     │
              └─────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Building a SQLite-like database from scratch is one of the best projects for learning systems programming.&lt;/p&gt;

&lt;p&gt;You will learn far more than SQL.&lt;/p&gt;

&lt;p&gt;You'll learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;C programming&lt;/li&gt;
&lt;li&gt;memory management&lt;/li&gt;
&lt;li&gt;binary data&lt;/li&gt;
&lt;li&gt;file I/O&lt;/li&gt;
&lt;li&gt;serialization&lt;/li&gt;
&lt;li&gt;page layouts&lt;/li&gt;
&lt;li&gt;storage engines&lt;/li&gt;
&lt;li&gt;buffer pools&lt;/li&gt;
&lt;li&gt;indexing&lt;/li&gt;
&lt;li&gt;B-trees&lt;/li&gt;
&lt;li&gt;parsing&lt;/li&gt;
&lt;li&gt;query execution&lt;/li&gt;
&lt;li&gt;transactions&lt;/li&gt;
&lt;li&gt;logging&lt;/li&gt;
&lt;li&gt;crash recovery&lt;/li&gt;
&lt;li&gt;operating-system I/O&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The important thing is to build it &lt;strong&gt;incrementally&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Don't begin by asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How do I build SQLite?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Start by asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How do I store one page?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How do I store one row?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How do I find that row?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How do I find millions of rows efficiently?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How do I make the operation safe if the program crashes?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's how a database engine grows—from a few thousand bytes of C code into a complete storage system.&lt;/p&gt;

&lt;p&gt;And the best part is that every layer you implement gives you a deeper understanding of what databases are actually doing underneath the SQL interface.&lt;/p&gt;

</description>
      <category>sqlite</category>
      <category>code</category>
      <category>programming</category>
      <category>c</category>
    </item>
    <item>
      <title>GitHub Doesn't Get “Hacked” the Way You Think</title>
      <dc:creator>Farhad Rahimi Klie</dc:creator>
      <pubDate>Mon, 10 Aug 2026 03:59:05 +0000</pubDate>
      <link>https://dev.to/farhadrahimiklie/github-doesnt-get-hacked-the-way-you-think-1c5l</link>
      <guid>https://dev.to/farhadrahimiklie/github-doesnt-get-hacked-the-way-you-think-1c5l</guid>
      <description>&lt;p&gt;There is a dangerous misconception in software security:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“If someone hacked GitHub, they must have broken through GitHub's login page.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Usually, that's not how modern attacks work.&lt;/p&gt;

&lt;p&gt;The most interesting attacks don't necessarily defeat the strongest lock.&lt;/p&gt;

&lt;p&gt;They find a different door.&lt;/p&gt;

&lt;p&gt;A stolen OAuth token.&lt;/p&gt;

&lt;p&gt;A compromised developer account.&lt;/p&gt;

&lt;p&gt;A leaked secret.&lt;/p&gt;

&lt;p&gt;A malicious dependency.&lt;/p&gt;

&lt;p&gt;A vulnerable production service.&lt;/p&gt;

&lt;p&gt;A trusted third-party integration.&lt;/p&gt;

&lt;p&gt;A phishing attack.&lt;/p&gt;

&lt;p&gt;A forgotten permission.&lt;/p&gt;

&lt;p&gt;And once an attacker obtains a legitimate credential, the attack can look like completely normal activity.&lt;/p&gt;

&lt;p&gt;That's what makes these attacks dangerous.&lt;/p&gt;




&lt;h2&gt;
  
  
  GitHub Is a Giant Trust System
&lt;/h2&gt;

&lt;p&gt;Think about what a modern GitHub account can connect to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Developer
    |
    +---- GitHub account
    |
    +---- Organizations
    |
    +---- Private repositories
    |
    +---- GitHub Actions
    |
    +---- OAuth applications
    |
    +---- Personal access tokens
    |
    +---- SSH keys
    |
    +---- Cloud credentials
    |
    +---- Package registries
    |
    +---- Deployment systems
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GitHub isn't isolated.&lt;/p&gt;

&lt;p&gt;It sits inside a much larger software ecosystem.&lt;/p&gt;

&lt;p&gt;That means an attacker doesn't always need to attack GitHub directly.&lt;/p&gt;

&lt;p&gt;They may attack something that &lt;strong&gt;already has permission to talk to GitHub&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And that distinction changes everything.&lt;/p&gt;




&lt;h1&gt;
  
  
  Attack #1: Steal the Key Instead of Breaking the Lock
&lt;/h1&gt;

&lt;p&gt;One of the clearest examples happened in 2022.&lt;/p&gt;

&lt;p&gt;GitHub disclosed an attack campaign involving stolen OAuth user tokens issued to third-party integrations, specifically Heroku and Travis CI.&lt;/p&gt;

&lt;p&gt;The attacker used those stolen tokens to access GitHub APIs and selectively identify organizations and private repositories.&lt;/p&gt;

&lt;p&gt;GitHub said it did &lt;strong&gt;not&lt;/strong&gt; believe the attacker obtained those tokens by compromising GitHub itself.&lt;/p&gt;

&lt;p&gt;Think about the architecture:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                 ┌──────────────┐
                 │   GitHub     │
                 └──────┬───────┘
                        │
                  OAuth trust
                        │
             ┌──────────┴──────────┐
             │                     │
        Third-party App       Third-party App
             │                     │
          Heroku              Travis CI
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The attacker didn't necessarily need:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GitHub password
        ↓
GitHub login
        ↓
GitHub account
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead, the attack path was conceptually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Compromised integration
        ↓
Stolen OAuth token
        ↓
GitHub API authentication
        ↓
Authorized permissions
        ↓
Private repository access
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's a completely different security model.&lt;/p&gt;

&lt;p&gt;The server sees a valid credential.&lt;/p&gt;

&lt;p&gt;The credential has permission.&lt;/p&gt;

&lt;p&gt;The request can therefore look legitimate.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Most Dangerous Credential Is the One That Looks Legitimate
&lt;/h1&gt;

&lt;p&gt;This is a fundamental security lesson.&lt;/p&gt;

&lt;p&gt;Imagine a server receives:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Authorization: valid-token
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The server doesn't automatically know:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"An attacker stole this token yesterday."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It sees:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;valid credential
+
valid permission
+
valid API request
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is why credential theft can be so powerful.&lt;/p&gt;

&lt;p&gt;You don't necessarily need to defeat authentication.&lt;/p&gt;

&lt;p&gt;You can sometimes become the authenticated user.&lt;/p&gt;




&lt;h1&gt;
  
  
  Attack #2: Phishing the Developer
&lt;/h1&gt;

&lt;p&gt;Another attack path is much simpler:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Attacker
   |
   | fake login page
   v
Developer
   |
   | enters credentials
   v
Attacker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GitHub documented a phishing campaign in which attackers created convincing login pages.&lt;/p&gt;

&lt;p&gt;The important part was that even some accounts using TOTP-based two-factor authentication could be targeted because the phishing site relayed authentication information in real time.&lt;/p&gt;

&lt;p&gt;GitHub noted that hardware security keys were not vulnerable to that particular attack technique.&lt;/p&gt;

&lt;p&gt;This demonstrates an important distinction:&lt;/p&gt;

&lt;h3&gt;
  
  
  Authentication ≠ phishing resistance
&lt;/h3&gt;

&lt;p&gt;A security mechanism can be strong while still being vulnerable to a particular social-engineering technique.&lt;/p&gt;

&lt;p&gt;That's one reason phishing-resistant authentication matters.&lt;/p&gt;




&lt;h1&gt;
  
  
  Attack #3: Steal a Token After Taking the Account
&lt;/h1&gt;

&lt;p&gt;Here's where attacks become interesting.&lt;/p&gt;

&lt;p&gt;Suppose an attacker compromises a developer account.&lt;/p&gt;

&lt;p&gt;The attacker doesn't necessarily stop there.&lt;/p&gt;

&lt;p&gt;They may look for additional ways to maintain access.&lt;/p&gt;

&lt;p&gt;GitHub documented attackers attempting to create personal access tokens, authorize OAuth applications, or add SSH keys after obtaining account credentials.&lt;/p&gt;

&lt;p&gt;Conceptually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Account compromise
        |
        +---- Password
        |
        +---- PAT
        |
        +---- OAuth application
        |
        +---- SSH key
        |
        +---- Repository permissions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;Because attackers want &lt;strong&gt;persistence&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If the original password is changed, another credential may still provide access.&lt;/p&gt;

&lt;p&gt;This is why security teams don't ask only:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Was the password changed?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;They ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“What other credentials or trust relationships were created?”&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  Attack #4: The Secret You Accidentally Pushed
&lt;/h1&gt;

&lt;p&gt;This is probably one of the most common developer mistakes.&lt;/p&gt;

&lt;p&gt;Imagine writing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;api_key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="s"&gt;"SUPER_SECRET_VALUE"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then committing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"add API integration"&lt;/span&gt;
git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the secret may exist in Git history.&lt;/p&gt;

&lt;p&gt;Deleting the line later doesn't necessarily erase the historical commit.&lt;/p&gt;

&lt;p&gt;Conceptually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Commit 1
   |
   +-- source code

Commit 2
   |
   +-- API_KEY = SECRET

Commit 3
   |
   +-- API_KEY removed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The developer sees:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Current code:
SECRET = gone
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But the repository history may still contain:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Commit 2:
SECRET = still present
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's why:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Removing a secret from the latest version is not the same as revoking the secret.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If a real credential is exposed, the important response is generally to &lt;strong&gt;revoke/rotate it&lt;/strong&gt;, then clean up the repository history where appropriate.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Scale Is Bigger Than Most Developers Realize
&lt;/h1&gt;

&lt;p&gt;GitHub reported that more than &lt;strong&gt;39 million secrets were leaked across GitHub in 2024&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That's an enormous number.&lt;/p&gt;

&lt;p&gt;And this explains why secret scanning and push protection exist.&lt;/p&gt;

&lt;p&gt;GitHub has also described push protection as a mechanism that can block commits when supported secrets are detected before they enter public repositories.&lt;/p&gt;

&lt;p&gt;The lesson isn't:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“GitHub is insecure.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The lesson is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Developers are part of the security boundary.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Your repository can be perfectly protected while you accidentally publish a cloud credential.&lt;/p&gt;




&lt;h1&gt;
  
  
  Attack #5: Attack the Supply Chain
&lt;/h1&gt;

&lt;p&gt;Here's where things become much more complicated.&lt;/p&gt;

&lt;p&gt;Your repository might be secure.&lt;/p&gt;

&lt;p&gt;Your password might be secure.&lt;/p&gt;

&lt;p&gt;Your server might be secure.&lt;/p&gt;

&lt;p&gt;But what about your dependencies?&lt;/p&gt;

&lt;p&gt;Consider:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Your application
      |
      +---- dependency A
      |
      +---- dependency B
      |
      +---- dependency C
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dependency C
      |
      +---- dependency D
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now your application depends on software you didn't write.&lt;/p&gt;

&lt;p&gt;This creates a &lt;strong&gt;software supply-chain attack surface&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;GitHub has specifically documented repo-jacking as a supply-chain risk. A repository that has been renamed or transferred can potentially create problems for projects that reference it incorrectly. GitHub recommends pinning dependencies to specific commit IDs in relevant scenarios.&lt;/p&gt;

&lt;p&gt;The important idea is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Trust
  ↓
Repository
  ↓
Dependency
  ↓
Build system
  ↓
Production
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every link matters.&lt;/p&gt;




&lt;h1&gt;
  
  
  Attack #6: A Vulnerability in the Platform
&lt;/h1&gt;

&lt;p&gt;Sometimes the target really is the platform itself.&lt;/p&gt;

&lt;p&gt;In December 2023, GitHub received a bug-bounty report describing a vulnerability that could allow access to environment variables from a production container.&lt;/p&gt;

&lt;p&gt;GitHub patched the issue the same day and said its investigation found no evidence that the vulnerability had previously been discovered or exploited.&lt;/p&gt;

&lt;p&gt;And in March 2026, GitHub disclosed a critical remote-code-execution vulnerability affecting multiple GitHub environments.&lt;/p&gt;

&lt;p&gt;GitHub said it validated the report, deployed a fix to GitHub.com in under two hours, and concluded its investigation with no evidence of exploitation.&lt;/p&gt;

&lt;p&gt;This is a completely different category:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Attacker
   |
   v
Vulnerability
   |
   v
Application
   |
   v
Execution
   |
   v
Potential privilege escalation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is what people often imagine when they hear:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“GitHub got hacked.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But finding and exploiting a vulnerability is only one possible attack path.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Most Important Security Concept: Trust Boundaries
&lt;/h1&gt;

&lt;p&gt;Let's simplify the whole problem.&lt;/p&gt;

&lt;p&gt;Imagine GitHub as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                    INTERNET
                       |
                       v
              ┌─────────────────┐
              │     GitHub      │
              └─────────────────┘
                 /     |      \
                /      |       \
               v       v        v
          Developers  OAuth   Actions
                      Apps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every arrow represents a &lt;strong&gt;trust relationship&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And every trust relationship is an attack surface.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Developer
   |
   | credentials
   v
GitHub
   |
   | token
   v
OAuth application
   |
   | permissions
   v
Repository
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If any link is compromised, the attacker may gain access to the next layer.&lt;/p&gt;

&lt;p&gt;This is why modern security engineering focuses heavily on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;least privilege&lt;/li&gt;
&lt;li&gt;credential rotation&lt;/li&gt;
&lt;li&gt;short-lived credentials&lt;/li&gt;
&lt;li&gt;strong authentication&lt;/li&gt;
&lt;li&gt;audit logs&lt;/li&gt;
&lt;li&gt;secret scanning&lt;/li&gt;
&lt;li&gt;dependency pinning&lt;/li&gt;
&lt;li&gt;network isolation&lt;/li&gt;
&lt;li&gt;continuous monitoring&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Why “Just Use 2FA” Isn't the Whole Answer
&lt;/h1&gt;

&lt;p&gt;2FA is important.&lt;/p&gt;

&lt;p&gt;But security isn't a single checkbox.&lt;/p&gt;

&lt;p&gt;Consider:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Password
    +
2FA
    +
OAuth token
    +
SSH key
    +
GitHub Actions
    +
Cloud credentials
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An account can have strong login protection while another credential remains compromised.&lt;/p&gt;

&lt;p&gt;Security therefore becomes a lifecycle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IDENTITY
   ↓
AUTHENTICATION
   ↓
AUTHORIZATION
   ↓
CREDENTIALS
   ↓
ACTIVITY
   ↓
MONITORING
   ↓
REVOCATION
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every stage matters.&lt;/p&gt;




&lt;h1&gt;
  
  
  Least Privilege Changes the Game
&lt;/h1&gt;

&lt;p&gt;Suppose an application only needs to read one repository.&lt;/p&gt;

&lt;p&gt;Bad design:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Application
    |
    +---- full organization access
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Better design:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Application
    |
    +---- read-only
    |
    +---- specific repository
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If that credential is stolen, the blast radius is smaller.&lt;/p&gt;

&lt;p&gt;This is the principle of:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Least privilege&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;GitHub introduced fine-grained personal access tokens specifically to provide more precise permissions and reduce the risk associated with compromised tokens.&lt;/p&gt;

&lt;p&gt;The question shouldn't be:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Can this application access the repository?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It should be:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“What is the minimum access this application needs?”&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  Think Like a Security Engineer
&lt;/h1&gt;

&lt;p&gt;When you build software, don't ask only:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Does it work?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ask:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What happens if this credential leaks?

What happens if this user is compromised?

What happens if this dependency becomes malicious?

What happens if this OAuth token is stolen?

What happens if this server is compromised?

What happens if an attacker gets read access?

What happens if an attacker gets write access?

How do we detect it?

How do we revoke access?

How do we recover?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Those questions are far more valuable than simply asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Is my application secure?”&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  A Realistic Attack Chain
&lt;/h1&gt;

&lt;p&gt;Put everything together.&lt;/p&gt;

&lt;p&gt;A modern software attack could conceptually look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        PHISHING
           |
           v
    Developer account
           |
           v
     OAuth / PAT / SSH
           |
           v
     Private repository
           |
           v
       Secret found
           |
           v
     Cloud environment
           |
           v
     Production system
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice something important.&lt;/p&gt;

&lt;p&gt;The attacker didn't necessarily:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;break GitHub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;They abused &lt;strong&gt;trust&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That's the deeper lesson.&lt;/p&gt;




&lt;h1&gt;
  
  
  So, Was GitHub “Hacked”?
&lt;/h1&gt;

&lt;p&gt;The answer depends on what you mean by hacked.&lt;/p&gt;

&lt;p&gt;There have been:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;account-targeting attacks&lt;/li&gt;
&lt;li&gt;stolen-token campaigns&lt;/li&gt;
&lt;li&gt;phishing campaigns&lt;/li&gt;
&lt;li&gt;security vulnerabilities&lt;/li&gt;
&lt;li&gt;service incidents&lt;/li&gt;
&lt;li&gt;supply-chain risks&lt;/li&gt;
&lt;li&gt;credential exposure incidents&lt;/li&gt;
&lt;li&gt;attacks against GitHub Enterprise environments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But these are not all the same thing.&lt;/p&gt;

&lt;p&gt;For example, in the 2022 OAuth-token incident, GitHub explicitly said it did not believe GitHub itself was compromised in the way people might normally imagine; attackers abused stolen tokens issued by third-party OAuth integrations.&lt;/p&gt;

&lt;p&gt;And in the 2026 RCE disclosure, GitHub reported that it fixed the vulnerability and found no evidence of exploitation.&lt;/p&gt;

&lt;p&gt;Precision matters.&lt;/p&gt;

&lt;p&gt;“GitHub was hacked” can hide the actual security lesson.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Real Lesson
&lt;/h1&gt;

&lt;p&gt;The most dangerous misconception in cybersecurity is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Attackers break systems.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Often, attackers don't need to.&lt;/p&gt;

&lt;p&gt;They abuse what systems already trust.&lt;/p&gt;

&lt;p&gt;A stolen credential.&lt;/p&gt;

&lt;p&gt;A valid token.&lt;/p&gt;

&lt;p&gt;A compromised account.&lt;/p&gt;

&lt;p&gt;A vulnerable dependency.&lt;/p&gt;

&lt;p&gt;A leaked secret.&lt;/p&gt;

&lt;p&gt;An overly powerful service account.&lt;/p&gt;

&lt;p&gt;A trusted integration.&lt;/p&gt;

&lt;p&gt;That's modern security.&lt;/p&gt;

&lt;p&gt;The strongest system isn't necessarily the system with the biggest lock.&lt;/p&gt;

&lt;p&gt;It's the system where:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;credentials are limited
        +
permissions are limited
        +
secrets are protected
        +
dependencies are controlled
        +
activity is monitored
        +
compromise is detected
        +
access can be revoked
        +
systems can recover
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that's the real reason GitHub security is interesting.&lt;/p&gt;

&lt;p&gt;GitHub isn't just a website where developers store code.&lt;/p&gt;

&lt;p&gt;It's a &lt;strong&gt;massive trust network connecting developers, identities, repositories, CI/CD systems, dependencies, cloud infrastructure, and production environments.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Attack the trust network—&lt;/p&gt;

&lt;p&gt;and you may not need to attack the website at all.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thought
&lt;/h2&gt;

&lt;p&gt;The next time you run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;remember:&lt;/p&gt;

&lt;p&gt;You're not just uploading code.&lt;/p&gt;

&lt;p&gt;You're participating in a security system.&lt;/p&gt;

&lt;p&gt;Your repository has identities.&lt;/p&gt;

&lt;p&gt;Your identities have permissions.&lt;/p&gt;

&lt;p&gt;Your permissions have credentials.&lt;/p&gt;

&lt;p&gt;Your credentials have blast radius.&lt;/p&gt;

&lt;p&gt;And somewhere in that chain is the thing an attacker is looking for.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security isn't about making one door impossible to break.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It's about making sure that opening one door doesn't open the entire building.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>githubactions</category>
      <category>code</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to Build Your Own Filesystem From Scratch in C</title>
      <dc:creator>Farhad Rahimi Klie</dc:creator>
      <pubDate>Mon, 03 Aug 2026 11:51:09 +0000</pubDate>
      <link>https://dev.to/farhadrahimiklie/how-to-build-your-own-filesystem-from-scratch-in-c-2b7f</link>
      <guid>https://dev.to/farhadrahimiklie/how-to-build-your-own-filesystem-from-scratch-in-c-2b7f</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Stop treating filesystems as magic. Build one yourself and understand how operating systems actually store data.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Most programmers use a filesystem every day.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;FILE&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;fp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fopen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"notes.txt"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"r"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;fd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"file.txt"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;O_RDONLY&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But very few programmers know what happens after those function calls.&lt;/p&gt;

&lt;p&gt;Where is the file actually stored?&lt;/p&gt;

&lt;p&gt;How does the operating system know where its data begins?&lt;/p&gt;

&lt;p&gt;How does deleting a file free disk space?&lt;/p&gt;

&lt;p&gt;How does a filesystem survive a power failure?&lt;/p&gt;

&lt;p&gt;These questions are answered by one piece of software:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The filesystem.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this article, we'll build one from scratch—not a toy with a single array in memory, but a real userspace filesystem stored inside a &lt;code&gt;disk.img&lt;/code&gt; file. By the end, you'll understand many of the same concepts used by Linux filesystems like ext2, ext3, and ext4.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why Build a Filesystem?
&lt;/h1&gt;

&lt;p&gt;Building a filesystem teaches far more than file storage.&lt;/p&gt;

&lt;p&gt;You'll learn about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Disk layouts&lt;/li&gt;
&lt;li&gt;Binary file formats&lt;/li&gt;
&lt;li&gt;Metadata&lt;/li&gt;
&lt;li&gt;Block allocation&lt;/li&gt;
&lt;li&gt;Bitmaps&lt;/li&gt;
&lt;li&gt;Direct and indirect pointers&lt;/li&gt;
&lt;li&gt;File growth&lt;/li&gt;
&lt;li&gt;Directory structures&lt;/li&gt;
&lt;li&gt;Crash consistency&lt;/li&gt;
&lt;li&gt;C programming&lt;/li&gt;
&lt;li&gt;Systems programming&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's one of the best projects for becoming a systems programmer.&lt;/p&gt;




&lt;h1&gt;
  
  
  What Is a Filesystem?
&lt;/h1&gt;

&lt;p&gt;A filesystem is software that organizes raw bytes on a storage device.&lt;/p&gt;

&lt;p&gt;Imagine you have a completely empty disk.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+------------------------------------------------+
|                                                |
|             1 GB of Random Bytes               |
|                                                |
+------------------------------------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without a filesystem, the operating system sees only bytes.&lt;/p&gt;

&lt;p&gt;It doesn't know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;where files begin&lt;/li&gt;
&lt;li&gt;where files end&lt;/li&gt;
&lt;li&gt;which space is free&lt;/li&gt;
&lt;li&gt;what filenames exist&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The filesystem provides all of that information.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Basic Idea
&lt;/h1&gt;

&lt;p&gt;Instead of treating the disk as one giant byte array, we divide it into blocks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Disk

+------+------+------+------+------+------+
|Blk 0 |Blk 1 |Blk 2 |Blk 3 |Blk 4 | ... |
+------+------+------+------+------+------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A block is the smallest storage unit.&lt;/p&gt;

&lt;p&gt;Typical sizes are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;512 bytes&lt;/li&gt;
&lt;li&gt;1024 bytes&lt;/li&gt;
&lt;li&gt;2048 bytes&lt;/li&gt;
&lt;li&gt;4096 bytes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Linux commonly uses &lt;strong&gt;4096-byte blocks&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  Our Project
&lt;/h1&gt;

&lt;p&gt;We'll build everything ourselves.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;disk.img

+-------------------------+
| Superblock              |
+-------------------------+
| Bitmap                  |
+-------------------------+
| Inode Table             |
+-------------------------+
| Data Blocks             |
+-------------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every modern filesystem has something similar.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 1 — Create a Virtual Disk
&lt;/h1&gt;

&lt;p&gt;Instead of modifying a real hard drive, we'll use a normal file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;disk.img
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Think of it as pretending this file is an SSD.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;disk.img

+------------------------------------------+
|                                          |
|             Raw Bytes                    |
|                                          |
+------------------------------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can open it using normal C functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;FILE&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;disk&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fopen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"disk.img"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"rb+"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;fd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"disk.img"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;O_RDWR&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every read and write will modify the virtual disk.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 2 — Design the Disk Layout
&lt;/h1&gt;

&lt;p&gt;Before writing code, always design the filesystem.&lt;/p&gt;

&lt;p&gt;Never start coding first.&lt;/p&gt;

&lt;p&gt;Example layout:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Block 0
----------------
Superblock

Blocks 1-8
----------------
Bitmap

Blocks 9-40
----------------
Inode Table

Blocks 41+
----------------
File Data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything begins with a good layout.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 3 — Superblock
&lt;/h1&gt;

&lt;p&gt;The superblock is the brain of the filesystem.&lt;/p&gt;

&lt;p&gt;It stores global information.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Superblock

Magic Number
Version
Block Size
Total Blocks
Free Blocks
Inode Count
Free Inodes
Bitmap Start
Inode Start
Data Start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Whenever the filesystem mounts, it reads the superblock first.&lt;/p&gt;

&lt;p&gt;Without it, nothing else can be understood.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 4 — Blocks
&lt;/h1&gt;

&lt;p&gt;Instead of storing files continuously, we store them in blocks.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;File

Hello World!

Stored as

Block 90
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A larger file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Block 90
Block 91
Block 92
Block 93
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Large files simply occupy more blocks.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 5 — Free Space Management
&lt;/h1&gt;

&lt;p&gt;How does the filesystem know which blocks are free?&lt;/p&gt;

&lt;p&gt;Using a bitmap.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Block Number

0 1 2 3 4 5 6 7

Bitmap

1 1 0 0 1 0 0 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Meaning:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 = Used
0 = Free
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finding free space becomes easy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Search bitmap

↓

00100000

↓

Found!

Allocate Block 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This technique is used in ext2, ext3, ext4, FAT, and many other filesystems.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 6 — Inodes
&lt;/h1&gt;

&lt;p&gt;The inode is the heart of every Unix filesystem.&lt;/p&gt;

&lt;p&gt;It stores metadata—not the filename.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;inode

File Size

Permissions

Owner

Creation Time

Modified Time

Block Pointers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice something missing?&lt;/p&gt;

&lt;p&gt;The filename.&lt;/p&gt;

&lt;p&gt;Linux stores filenames separately inside directories.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 7 — Direct Block Pointers
&lt;/h1&gt;

&lt;p&gt;Small files are easy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;inode

Block 91

Block 92

Block 93

Block 94
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each pointer references one data block.&lt;/p&gt;

&lt;p&gt;Reading the file is straightforward.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Read inode

↓

Read block pointers

↓

Read data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 8 — File Growth
&lt;/h1&gt;

&lt;p&gt;Eventually a file becomes larger.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Before

inode

91

92

93

94
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now write more data.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Filesystem

↓

Find Free Block

↓

Allocate

↓

Update Bitmap

↓

Update Inode

↓

Increase File Size
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Growing a file is simply allocating additional blocks and updating metadata.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 9 — Indirect Pointers
&lt;/h1&gt;

&lt;p&gt;Direct pointers eventually run out.&lt;/p&gt;

&lt;p&gt;Linux solves this with indirect blocks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;inode

Direct

Direct

Direct

Indirect
        |
        v

+--------------------+
|101|102|103|104|...|
+--------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of pointing to data, the inode points to another block containing many more block numbers.&lt;/p&gt;

&lt;p&gt;This allows files to grow into gigabytes or even terabytes.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 10 — Directories
&lt;/h1&gt;

&lt;p&gt;A directory is just another file.&lt;/p&gt;

&lt;p&gt;Instead of storing text, it stores mappings.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Filename

↓

Inode Number
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;notes.txt

↓

inode 15

photo.png

↓

inode 42

movie.mp4

↓

inode 80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The operating system first finds the inode, then reads the file.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 11 — Reading a File
&lt;/h1&gt;

&lt;p&gt;The process is surprisingly simple.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Open File

↓

Find Directory Entry

↓

Get Inode Number

↓

Read Inode

↓

Read Block Pointers

↓

Read Data Blocks

↓

Return Bytes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This sequence happens every time you open a file.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 12 — Deleting a File
&lt;/h1&gt;

&lt;p&gt;Deleting does &lt;strong&gt;not&lt;/strong&gt; erase the data immediately.&lt;/p&gt;

&lt;p&gt;Instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Remove Directory Entry

↓

Free Blocks in Bitmap

↓

Free Inode

↓

Mark Space Available
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The old bytes often remain until overwritten.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 13 — Formatting the Filesystem
&lt;/h1&gt;

&lt;p&gt;Before using the disk, it must be formatted.&lt;/p&gt;

&lt;p&gt;Formatting means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create the superblock&lt;/li&gt;
&lt;li&gt;Initialize the bitmap&lt;/li&gt;
&lt;li&gt;Create empty inode table&lt;/li&gt;
&lt;li&gt;Reserve metadata blocks&lt;/li&gt;
&lt;li&gt;Mark remaining blocks as free&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After formatting, the filesystem is ready.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 14 — Features to Add Later
&lt;/h1&gt;

&lt;p&gt;Once the core filesystem works, you can implement advanced features.&lt;/p&gt;

&lt;h3&gt;
  
  
  Symbolic Links
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;myfile

↓

inode

↓

Target Path
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Hard Links
&lt;/h3&gt;

&lt;p&gt;Multiple filenames pointing to the same inode.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fileA

↓

inode 12

↑

fileB
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Journaling
&lt;/h3&gt;

&lt;p&gt;Protects against crashes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Write Journal

↓

Write Real Data

↓

Commit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the system crashes, unfinished operations can be replayed safely.&lt;/p&gt;




&lt;h3&gt;
  
  
  Permissions
&lt;/h3&gt;

&lt;p&gt;Store Unix permissions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rwxr-xr-x
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Timestamps
&lt;/h3&gt;

&lt;p&gt;Maintain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creation time&lt;/li&gt;
&lt;li&gt;Modification time&lt;/li&gt;
&lt;li&gt;Access time&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Nested Directories
&lt;/h3&gt;

&lt;p&gt;Support structures like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/

home/

home/user/

home/user/docs/

home/user/docs/file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Suggested Development Order
&lt;/h1&gt;

&lt;p&gt;Don't try to build everything at once.&lt;/p&gt;

&lt;p&gt;Follow this roadmap:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create &lt;code&gt;disk.img&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Define block size&lt;/li&gt;
&lt;li&gt;Implement disk read/write functions&lt;/li&gt;
&lt;li&gt;Create the superblock&lt;/li&gt;
&lt;li&gt;Implement bitmap-based free space management&lt;/li&gt;
&lt;li&gt;Build the inode table&lt;/li&gt;
&lt;li&gt;Create files&lt;/li&gt;
&lt;li&gt;Read files&lt;/li&gt;
&lt;li&gt;Write files&lt;/li&gt;
&lt;li&gt;Delete files&lt;/li&gt;
&lt;li&gt;Implement file growth&lt;/li&gt;
&lt;li&gt;Add directories&lt;/li&gt;
&lt;li&gt;Support nested directories&lt;/li&gt;
&lt;li&gt;Add indirect pointers&lt;/li&gt;
&lt;li&gt;Add journaling&lt;/li&gt;
&lt;li&gt;Add caching&lt;/li&gt;
&lt;li&gt;Optimize performance&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each milestone builds on the previous one, making debugging much easier.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Building a filesystem is one of the most rewarding systems programming projects you can undertake. It combines low-level C programming, binary data structures, memory management, and operating system concepts into a single, practical project.&lt;/p&gt;

&lt;p&gt;You'll stop thinking of files as mysterious objects managed by the OS and start seeing them for what they really are: carefully organized blocks of bytes, tracked by metadata and allocation structures.&lt;/p&gt;

&lt;p&gt;If you can build a filesystem from scratch, you'll gain a much deeper understanding of how Linux works internally—and you'll develop the skills needed for advanced areas like kernel development, storage engines, databases, embedded systems, and operating system design.&lt;/p&gt;

&lt;p&gt;Every byte on a disk has a purpose. Your job as a filesystem developer is to decide what that purpose should be.&lt;/p&gt;

</description>
      <category>filesystem</category>
      <category>c</category>
      <category>programming</category>
      <category>disk</category>
    </item>
    <item>
      <title>How to Become a System Programmer in 2026</title>
      <dc:creator>Farhad Rahimi Klie</dc:creator>
      <pubDate>Sun, 02 Aug 2026 10:57:47 +0000</pubDate>
      <link>https://dev.to/farhadrahimiklie/how-to-become-a-system-programmer-in-2026-ilg</link>
      <guid>https://dev.to/farhadrahimiklie/how-to-become-a-system-programmer-in-2026-ilg</guid>
      <description>&lt;p&gt;&lt;em&gt;Stop chasing frameworks. Start understanding the machine.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Most developers spend years learning frameworks, libraries, and APIs. Yet very few understand what actually happens after they press &lt;strong&gt;Compile&lt;/strong&gt; or &lt;strong&gt;Run&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;System programmers are different.&lt;/p&gt;

&lt;p&gt;They build operating systems, databases, compilers, virtual machines, device drivers, networking software, embedded systems, hypervisors, game engines, and high-performance applications. They work closer to the hardware than almost any other software engineer.&lt;/p&gt;

&lt;p&gt;In 2026, as AI generates more application code than ever before, developers who understand computers at the lowest levels are becoming increasingly valuable.&lt;/p&gt;

&lt;p&gt;This article provides a practical roadmap to becoming a system programmer.&lt;/p&gt;




&lt;h1&gt;
  
  
  What Is System Programming?
&lt;/h1&gt;

&lt;p&gt;System programming is the art of writing software that interacts directly with the operating system or hardware.&lt;/p&gt;

&lt;p&gt;Instead of building websites or mobile apps, system programmers create software such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Operating systems&lt;/li&gt;
&lt;li&gt;Kernels&lt;/li&gt;
&lt;li&gt;Device drivers&lt;/li&gt;
&lt;li&gt;File systems&lt;/li&gt;
&lt;li&gt;Compilers&lt;/li&gt;
&lt;li&gt;Linkers&lt;/li&gt;
&lt;li&gt;Assemblers&lt;/li&gt;
&lt;li&gt;Database engines&lt;/li&gt;
&lt;li&gt;Virtual machines&lt;/li&gt;
&lt;li&gt;Hypervisors&lt;/li&gt;
&lt;li&gt;Networking software&lt;/li&gt;
&lt;li&gt;Embedded firmware&lt;/li&gt;
&lt;li&gt;Performance-critical libraries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These programs manage computer resources and provide services that application software depends on.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why System Programming Matters More Than Ever
&lt;/h1&gt;

&lt;p&gt;Many developers worry that AI will replace programmers.&lt;/p&gt;

&lt;p&gt;AI can generate CRUD applications.&lt;/p&gt;

&lt;p&gt;AI can build websites.&lt;/p&gt;

&lt;p&gt;AI can write boilerplate code.&lt;/p&gt;

&lt;p&gt;But AI still struggles with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Operating system internals&lt;/li&gt;
&lt;li&gt;CPU architecture&lt;/li&gt;
&lt;li&gt;Memory management&lt;/li&gt;
&lt;li&gt;Performance optimization&lt;/li&gt;
&lt;li&gt;Lock-free algorithms&lt;/li&gt;
&lt;li&gt;Kernel development&lt;/li&gt;
&lt;li&gt;Compiler optimization&lt;/li&gt;
&lt;li&gt;Hardware communication&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These require deep understanding rather than memorization.&lt;/p&gt;

&lt;p&gt;The closer you are to the hardware, the harder you are to replace.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 1 — Master the C Language
&lt;/h1&gt;

&lt;p&gt;If system programming has a native language, it is C.&lt;/p&gt;

&lt;p&gt;Learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Variables&lt;/li&gt;
&lt;li&gt;Pointers&lt;/li&gt;
&lt;li&gt;Arrays&lt;/li&gt;
&lt;li&gt;Structures&lt;/li&gt;
&lt;li&gt;Memory layout&lt;/li&gt;
&lt;li&gt;Bitwise operators&lt;/li&gt;
&lt;li&gt;Function pointers&lt;/li&gt;
&lt;li&gt;Dynamic memory allocation&lt;/li&gt;
&lt;li&gt;Header files&lt;/li&gt;
&lt;li&gt;Build systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Don't just memorize syntax.&lt;/p&gt;

&lt;p&gt;Understand what every line becomes in memory.&lt;/p&gt;

&lt;p&gt;You should know exactly why this works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;ptr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;malloc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;sizeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Not just that it works.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 2 — Learn Computer Architecture
&lt;/h1&gt;

&lt;p&gt;A system programmer must understand the machine.&lt;/p&gt;

&lt;p&gt;Study:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CPU execution&lt;/li&gt;
&lt;li&gt;Registers&lt;/li&gt;
&lt;li&gt;Cache hierarchy&lt;/li&gt;
&lt;li&gt;Virtual memory&lt;/li&gt;
&lt;li&gt;Paging&lt;/li&gt;
&lt;li&gt;Stack vs Heap&lt;/li&gt;
&lt;li&gt;Calling conventions&lt;/li&gt;
&lt;li&gt;Assembly language&lt;/li&gt;
&lt;li&gt;Interrupts&lt;/li&gt;
&lt;li&gt;Pipelines&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Books worth reading:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Computer Systems: A Programmer's Perspective&lt;/li&gt;
&lt;li&gt;Computer Organization and Design&lt;/li&gt;
&lt;li&gt;Modern Operating Systems&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Step 3 — Become a Linux Power User
&lt;/h1&gt;

&lt;p&gt;Windows is fine.&lt;/p&gt;

&lt;p&gt;Linux is essential.&lt;/p&gt;

&lt;p&gt;Spend every day inside Linux.&lt;/p&gt;

&lt;p&gt;Learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Shell scripting&lt;/li&gt;
&lt;li&gt;Bash&lt;/li&gt;
&lt;li&gt;File permissions&lt;/li&gt;
&lt;li&gt;Processes&lt;/li&gt;
&lt;li&gt;Signals&lt;/li&gt;
&lt;li&gt;Pipes&lt;/li&gt;
&lt;li&gt;Redirection&lt;/li&gt;
&lt;li&gt;ELF binaries&lt;/li&gt;
&lt;li&gt;Package managers&lt;/li&gt;
&lt;li&gt;System services&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use the terminal constantly.&lt;/p&gt;

&lt;p&gt;If you can solve a problem without opening a GUI, do it.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 4 — Learn POSIX System Calls
&lt;/h1&gt;

&lt;p&gt;Applications eventually communicate with the kernel through system calls.&lt;/p&gt;

&lt;p&gt;Start with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;open()&lt;/li&gt;
&lt;li&gt;close()&lt;/li&gt;
&lt;li&gt;read()&lt;/li&gt;
&lt;li&gt;write()&lt;/li&gt;
&lt;li&gt;lseek()&lt;/li&gt;
&lt;li&gt;mmap()&lt;/li&gt;
&lt;li&gt;fork()&lt;/li&gt;
&lt;li&gt;execve()&lt;/li&gt;
&lt;li&gt;wait()&lt;/li&gt;
&lt;li&gt;pipe()&lt;/li&gt;
&lt;li&gt;dup()&lt;/li&gt;
&lt;li&gt;socket()&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;File descriptors&lt;/li&gt;
&lt;li&gt;Buffers&lt;/li&gt;
&lt;li&gt;Kernel transitions&lt;/li&gt;
&lt;li&gt;User space vs Kernel space&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Step 5 — Understand Memory
&lt;/h1&gt;

&lt;p&gt;Memory separates beginner programmers from professionals.&lt;/p&gt;

&lt;p&gt;Study:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stack&lt;/li&gt;
&lt;li&gt;Heap&lt;/li&gt;
&lt;li&gt;Static memory&lt;/li&gt;
&lt;li&gt;Memory alignment&lt;/li&gt;
&lt;li&gt;Fragmentation&lt;/li&gt;
&lt;li&gt;malloc()&lt;/li&gt;
&lt;li&gt;calloc()&lt;/li&gt;
&lt;li&gt;realloc()&lt;/li&gt;
&lt;li&gt;free()&lt;/li&gt;
&lt;li&gt;Memory leaks&lt;/li&gt;
&lt;li&gt;Buffer overflows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tools to master:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Valgrind&lt;/li&gt;
&lt;li&gt;AddressSanitizer&lt;/li&gt;
&lt;li&gt;GDB&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Step 6 — Learn Data Structures From Scratch
&lt;/h1&gt;

&lt;p&gt;Don't rely on library implementations.&lt;/p&gt;

&lt;p&gt;Implement yourself:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dynamic Arrays&lt;/li&gt;
&lt;li&gt;Linked Lists&lt;/li&gt;
&lt;li&gt;Stacks&lt;/li&gt;
&lt;li&gt;Queues&lt;/li&gt;
&lt;li&gt;Hash Tables&lt;/li&gt;
&lt;li&gt;Binary Trees&lt;/li&gt;
&lt;li&gt;AVL Trees&lt;/li&gt;
&lt;li&gt;Red-Black Trees&lt;/li&gt;
&lt;li&gt;Heaps&lt;/li&gt;
&lt;li&gt;Tries&lt;/li&gt;
&lt;li&gt;Skip Lists&lt;/li&gt;
&lt;li&gt;Graphs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then optimize them.&lt;/p&gt;

&lt;p&gt;Measure their performance.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 7 — Study Operating System Internals
&lt;/h1&gt;

&lt;p&gt;Every system programmer should know how an operating system works.&lt;/p&gt;

&lt;p&gt;Topics include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Process scheduling&lt;/li&gt;
&lt;li&gt;Context switching&lt;/li&gt;
&lt;li&gt;Virtual memory&lt;/li&gt;
&lt;li&gt;File systems&lt;/li&gt;
&lt;li&gt;Kernel architecture&lt;/li&gt;
&lt;li&gt;Synchronization&lt;/li&gt;
&lt;li&gt;Deadlocks&lt;/li&gt;
&lt;li&gt;IPC&lt;/li&gt;
&lt;li&gt;Threads&lt;/li&gt;
&lt;li&gt;Scheduling algorithms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Read source code.&lt;/p&gt;

&lt;p&gt;Linux is one of the greatest learning resources available.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 8 — Learn Networking
&lt;/h1&gt;

&lt;p&gt;Computers rarely work alone.&lt;/p&gt;

&lt;p&gt;Study:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TCP/IP&lt;/li&gt;
&lt;li&gt;UDP&lt;/li&gt;
&lt;li&gt;DNS&lt;/li&gt;
&lt;li&gt;HTTP&lt;/li&gt;
&lt;li&gt;HTTPS&lt;/li&gt;
&lt;li&gt;Routing&lt;/li&gt;
&lt;li&gt;Sockets&lt;/li&gt;
&lt;li&gt;Epoll&lt;/li&gt;
&lt;li&gt;Poll&lt;/li&gt;
&lt;li&gt;Select&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Build:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTTP server&lt;/li&gt;
&lt;li&gt;Chat server&lt;/li&gt;
&lt;li&gt;File server&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Step 9 — Learn Debugging
&lt;/h1&gt;

&lt;p&gt;Professional programmers spend less time writing code than debugging it.&lt;/p&gt;

&lt;p&gt;Master:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GDB&lt;/li&gt;
&lt;li&gt;strace&lt;/li&gt;
&lt;li&gt;ltrace&lt;/li&gt;
&lt;li&gt;perf&lt;/li&gt;
&lt;li&gt;objdump&lt;/li&gt;
&lt;li&gt;nm&lt;/li&gt;
&lt;li&gt;readelf&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Learn to inspect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Memory&lt;/li&gt;
&lt;li&gt;Registers&lt;/li&gt;
&lt;li&gt;Stack frames&lt;/li&gt;
&lt;li&gt;Assembly&lt;/li&gt;
&lt;li&gt;Core dumps&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Step 10 — Read Source Code Every Day
&lt;/h1&gt;

&lt;p&gt;The fastest way to improve is reading production-quality code.&lt;/p&gt;

&lt;p&gt;Great projects include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Linux Kernel&lt;/li&gt;
&lt;li&gt;Git&lt;/li&gt;
&lt;li&gt;SQLite&lt;/li&gt;
&lt;li&gt;Redis&lt;/li&gt;
&lt;li&gt;musl libc&lt;/li&gt;
&lt;li&gt;BusyBox&lt;/li&gt;
&lt;li&gt;Vim&lt;/li&gt;
&lt;li&gt;Nginx&lt;/li&gt;
&lt;li&gt;PostgreSQL&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Professional programmers read code more often than they write it.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 11 — Build Real Projects
&lt;/h1&gt;

&lt;p&gt;Projects teach lessons tutorials cannot.&lt;/p&gt;

&lt;p&gt;Ideas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mini Shell&lt;/li&gt;
&lt;li&gt;Memory Allocator&lt;/li&gt;
&lt;li&gt;Text Editor&lt;/li&gt;
&lt;li&gt;HTTP Server&lt;/li&gt;
&lt;li&gt;File System&lt;/li&gt;
&lt;li&gt;Thread Pool&lt;/li&gt;
&lt;li&gt;Skip List Library&lt;/li&gt;
&lt;li&gt;JSON Parser&lt;/li&gt;
&lt;li&gt;Compiler&lt;/li&gt;
&lt;li&gt;Virtual Machine&lt;/li&gt;
&lt;li&gt;Toy Operating System&lt;/li&gt;
&lt;li&gt;Custom malloc()&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each project exposes new challenges.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 12 — Learn Performance Engineering
&lt;/h1&gt;

&lt;p&gt;Fast software wins.&lt;/p&gt;

&lt;p&gt;Understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cache locality&lt;/li&gt;
&lt;li&gt;Branch prediction&lt;/li&gt;
&lt;li&gt;SIMD&lt;/li&gt;
&lt;li&gt;Compiler optimization&lt;/li&gt;
&lt;li&gt;False sharing&lt;/li&gt;
&lt;li&gt;Memory bandwidth&lt;/li&gt;
&lt;li&gt;CPU profiling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Benchmark everything.&lt;/p&gt;

&lt;p&gt;Never assume.&lt;/p&gt;

&lt;p&gt;Measure.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 13 — Learn Assembly
&lt;/h1&gt;

&lt;p&gt;You don't need to become an assembly expert.&lt;/p&gt;

&lt;p&gt;But you should be able to read it.&lt;/p&gt;

&lt;p&gt;Learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;x86-64&lt;/li&gt;
&lt;li&gt;ARM64&lt;/li&gt;
&lt;li&gt;Calling conventions&lt;/li&gt;
&lt;li&gt;Stack frames&lt;/li&gt;
&lt;li&gt;Registers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Compile C programs with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc &lt;span class="nt"&gt;-S&lt;/span&gt; program.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then compare your C code with the generated assembly.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 14 — Learn How Compilers Work
&lt;/h1&gt;

&lt;p&gt;Compilers transform human-readable code into machine instructions.&lt;/p&gt;

&lt;p&gt;Study:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lexical analysis&lt;/li&gt;
&lt;li&gt;Parsing&lt;/li&gt;
&lt;li&gt;AST&lt;/li&gt;
&lt;li&gt;Semantic analysis&lt;/li&gt;
&lt;li&gt;Intermediate Representation (IR)&lt;/li&gt;
&lt;li&gt;Optimization&lt;/li&gt;
&lt;li&gt;Code generation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Building a tiny compiler will change the way you write code forever.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 15 — Never Stop Building
&lt;/h1&gt;

&lt;p&gt;Knowledge without projects fades quickly.&lt;/p&gt;

&lt;p&gt;Build something every month.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Shell&lt;/li&gt;
&lt;li&gt;Database&lt;/li&gt;
&lt;li&gt;Cache&lt;/li&gt;
&lt;li&gt;Compiler&lt;/li&gt;
&lt;li&gt;Kernel module&lt;/li&gt;
&lt;li&gt;TCP server&lt;/li&gt;
&lt;li&gt;Memory allocator&lt;/li&gt;
&lt;li&gt;Scheduler simulator&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Experience compounds.&lt;/p&gt;




&lt;h1&gt;
  
  
  A Recommended Learning Roadmap
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Beginner (0–3 Months)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;C&lt;/li&gt;
&lt;li&gt;Linux&lt;/li&gt;
&lt;li&gt;Git&lt;/li&gt;
&lt;li&gt;Bash&lt;/li&gt;
&lt;li&gt;Makefiles&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Intermediate (3–9 Months)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Data Structures&lt;/li&gt;
&lt;li&gt;Pointers&lt;/li&gt;
&lt;li&gt;Memory&lt;/li&gt;
&lt;li&gt;System Calls&lt;/li&gt;
&lt;li&gt;Debugging&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Advanced (9–18 Months)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Operating Systems&lt;/li&gt;
&lt;li&gt;Networking&lt;/li&gt;
&lt;li&gt;Compilers&lt;/li&gt;
&lt;li&gt;Concurrency&lt;/li&gt;
&lt;li&gt;Performance Optimization&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Expert (18+ Months)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Kernel Development&lt;/li&gt;
&lt;li&gt;Database Internals&lt;/li&gt;
&lt;li&gt;Distributed Systems&lt;/li&gt;
&lt;li&gt;Virtual Machines&lt;/li&gt;
&lt;li&gt;Embedded Systems&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;System programming isn't the easiest path—but it's one of the most rewarding.&lt;/p&gt;

&lt;p&gt;It teaches you &lt;strong&gt;how computers actually work&lt;/strong&gt;, not just how to use them. Every layer you master—from pointers and memory management to kernels and compilers—makes you a stronger engineer.&lt;/p&gt;

&lt;p&gt;Frameworks will evolve. Languages will rise and fall. AI will continue to automate routine coding.&lt;/p&gt;

&lt;p&gt;But developers who understand operating systems, hardware, performance, and low-level software will continue to solve the hardest engineering problems.&lt;/p&gt;

&lt;p&gt;Don't aim to become someone who can simply write code.&lt;/p&gt;

&lt;p&gt;Aim to become someone who understands the machine.&lt;/p&gt;

&lt;p&gt;That's what separates a programmer from a &lt;strong&gt;system programmer&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>systemprogrammer</category>
      <category>terminal</category>
      <category>code</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to Read Linux Man Pages Like a Professional Developer</title>
      <dc:creator>Farhad Rahimi Klie</dc:creator>
      <pubDate>Fri, 17 Jul 2026 11:02:29 +0000</pubDate>
      <link>https://dev.to/farhadrahimiklie/how-to-read-linux-man-pages-like-a-professional-developer-3plb</link>
      <guid>https://dev.to/farhadrahimiklie/how-to-read-linux-man-pages-like-a-professional-developer-3plb</guid>
      <description>&lt;p&gt;&lt;em&gt;Stop searching Google for every Linux command. Learn how to read the official documentation that Linux developers use every day.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;If you've ever typed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;man &lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and immediately closed it because it looked confusing...&lt;/p&gt;

&lt;p&gt;You're not alone.&lt;/p&gt;

&lt;p&gt;Many beginners think Linux man pages are difficult, outdated, or only for advanced developers.&lt;/p&gt;

&lt;p&gt;The truth is completely different.&lt;/p&gt;

&lt;p&gt;Professional Linux developers, system administrators, DevOps engineers, and C programmers read man pages every single day.&lt;/p&gt;

&lt;p&gt;Learning to read them properly is one of the best skills you can develop.&lt;/p&gt;

&lt;p&gt;After reading this guide you'll know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What a man page actually is&lt;/li&gt;
&lt;li&gt;Why man pages exist&lt;/li&gt;
&lt;li&gt;How they're organized&lt;/li&gt;
&lt;li&gt;How to navigate efficiently&lt;/li&gt;
&lt;li&gt;How to search inside them&lt;/li&gt;
&lt;li&gt;How to understand the syntax&lt;/li&gt;
&lt;li&gt;How professionals read documentation quickly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's begin.&lt;/p&gt;




&lt;h1&gt;
  
  
  What Is a Linux Man Page?
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Man&lt;/strong&gt; stands for &lt;strong&gt;Manual&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A man page is the official documentation for a Linux command, system call, library function, configuration file, or programming interface.&lt;/p&gt;

&lt;p&gt;Instead of searching random websites, Linux provides documentation directly on your computer.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;man &lt;span class="nb"&gt;cp&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;opens the complete manual for the &lt;code&gt;cp&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;Think of it as an offline encyclopedia built into Linux.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why Were Man Pages Created?
&lt;/h1&gt;

&lt;p&gt;Linux contains thousands of commands.&lt;/p&gt;

&lt;p&gt;Nobody can remember every option.&lt;/p&gt;

&lt;p&gt;Instead of memorizing everything, developers simply read the documentation whenever they need it.&lt;/p&gt;

&lt;p&gt;Man pages are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Official&lt;/li&gt;
&lt;li&gt;Accurate&lt;/li&gt;
&lt;li&gt;Installed locally&lt;/li&gt;
&lt;li&gt;Available without Internet&lt;/li&gt;
&lt;li&gt;Updated with software packages&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes them one of the most reliable documentation sources available.&lt;/p&gt;




&lt;h1&gt;
  
  
  What Can You Find in Man Pages?
&lt;/h1&gt;

&lt;p&gt;Man pages aren't only for commands.&lt;/p&gt;

&lt;p&gt;They also document:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Linux commands&lt;/li&gt;
&lt;li&gt;C library functions&lt;/li&gt;
&lt;li&gt;System calls&lt;/li&gt;
&lt;li&gt;Configuration files&lt;/li&gt;
&lt;li&gt;Device files&lt;/li&gt;
&lt;li&gt;File formats&lt;/li&gt;
&lt;li&gt;Games&lt;/li&gt;
&lt;li&gt;Administration commands&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;man &lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Documentation for &lt;code&gt;ls&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;man &lt;span class="nb"&gt;printf&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Documentation for the shell version of &lt;code&gt;printf&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;man 3 &lt;span class="nb"&gt;printf&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Documentation for the C library function.&lt;/p&gt;




&lt;h1&gt;
  
  
  Understanding Man Sections
&lt;/h1&gt;

&lt;p&gt;Linux organizes documentation into sections.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Section&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;User Commands&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;System Calls&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Library Functions (C)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Device Files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;File Formats&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Games&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;Miscellaneous&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;System Administration&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;man 2 open
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Shows the Linux system call.&lt;/p&gt;

&lt;p&gt;While&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;man 3 open
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;may show a library function if one exists.&lt;/p&gt;

&lt;p&gt;This distinction is especially important for C programmers.&lt;/p&gt;




&lt;h1&gt;
  
  
  Opening a Man Page
&lt;/h1&gt;

&lt;p&gt;Simply type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;man &lt;span class="nb"&gt;command&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;man &lt;span class="nb"&gt;grep&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Linux opens the manual using a pager called &lt;strong&gt;less&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Basic Structure of Every Man Page
&lt;/h1&gt;

&lt;p&gt;Although every page is different, most follow the same structure.&lt;/p&gt;




&lt;h2&gt;
  
  
  NAME
&lt;/h2&gt;

&lt;p&gt;The command name and a short description.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grep - print lines matching patterns
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Always read this first.&lt;/p&gt;




&lt;h2&gt;
  
  
  SYNOPSIS
&lt;/h2&gt;

&lt;p&gt;Shows the command syntax.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grep [OPTION]... PATTERN [FILE]...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This line tells you how to use the command.&lt;/p&gt;

&lt;p&gt;Let's decode it.&lt;/p&gt;




&lt;h3&gt;
  
  
  Square Brackets
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[OPTION]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Means optional.&lt;/p&gt;

&lt;p&gt;You may include it or not.&lt;/p&gt;




&lt;h3&gt;
  
  
  Three Dots (...)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[FILE]...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Means multiple values are allowed.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;grep &lt;/span&gt;hello file1 file2 file3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Uppercase Words
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FILE
PATTERN
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are placeholders.&lt;/p&gt;

&lt;p&gt;Replace them with your own values.&lt;/p&gt;




&lt;h3&gt;
  
  
  Vertical Bar
&lt;/h3&gt;

&lt;p&gt;Sometimes you'll see&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A | B
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Choose one.&lt;/p&gt;

&lt;p&gt;Not both.&lt;/p&gt;




&lt;h1&gt;
  
  
  DESCRIPTION
&lt;/h1&gt;

&lt;p&gt;This explains what the command actually does.&lt;/p&gt;

&lt;p&gt;Don't skip it.&lt;/p&gt;

&lt;p&gt;Professionals usually read this section before anything else.&lt;/p&gt;




&lt;h1&gt;
  
  
  OPTIONS
&lt;/h1&gt;

&lt;p&gt;This is where you'll spend most of your time.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-i
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ignore case.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-r
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Recursive search.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Invert match.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-ri&lt;/span&gt; hello project/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read each option carefully.&lt;/p&gt;




&lt;h1&gt;
  
  
  EXAMPLES
&lt;/h1&gt;

&lt;p&gt;Some man pages include examples.&lt;/p&gt;

&lt;p&gt;Unfortunately many don't.&lt;/p&gt;

&lt;p&gt;That's why understanding the syntax is important.&lt;/p&gt;




&lt;h1&gt;
  
  
  EXIT STATUS
&lt;/h1&gt;

&lt;p&gt;Commands return an exit code.&lt;/p&gt;

&lt;p&gt;Usually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Success.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;General failure.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Specific error.&lt;/p&gt;

&lt;p&gt;This is very useful when writing shell scripts.&lt;/p&gt;




&lt;h1&gt;
  
  
  FILES
&lt;/h1&gt;

&lt;p&gt;Shows which files the command uses.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;Configuration files.&lt;/p&gt;

&lt;p&gt;Cache files.&lt;/p&gt;

&lt;p&gt;Database files.&lt;/p&gt;

&lt;p&gt;Runtime files.&lt;/p&gt;




&lt;h1&gt;
  
  
  ENVIRONMENT
&lt;/h1&gt;

&lt;p&gt;Lists environment variables that affect the command.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PATH
HOME
LANG
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  SEE ALSO
&lt;/h1&gt;

&lt;p&gt;Perhaps the most overlooked section.&lt;/p&gt;

&lt;p&gt;Suppose you're reading:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;man &lt;span class="nb"&gt;grep&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At the bottom you'll find related commands such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sed
awk
find
regex
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is an excellent way to discover new tools.&lt;/p&gt;




&lt;h1&gt;
  
  
  How to Navigate Inside a Man Page
&lt;/h1&gt;

&lt;p&gt;Once opened, use these keys.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Space&lt;/td&gt;
&lt;td&gt;Next page&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;b&lt;/td&gt;
&lt;td&gt;Previous page&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Enter&lt;/td&gt;
&lt;td&gt;Next line&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;g&lt;/td&gt;
&lt;td&gt;Top of document&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;G&lt;/td&gt;
&lt;td&gt;Bottom of document&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;q&lt;/td&gt;
&lt;td&gt;Quit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;h&lt;/td&gt;
&lt;td&gt;Help&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These few shortcuts are enough for daily use.&lt;/p&gt;




&lt;h1&gt;
  
  
  Searching Inside a Man Page
&lt;/h1&gt;

&lt;p&gt;Searching is one of the most useful features.&lt;/p&gt;

&lt;p&gt;Press:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then type a word.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/recursive
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Press:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Enter
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Go to the next match:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;n
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Previous match:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;N
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This saves a huge amount of time.&lt;/p&gt;




&lt;h1&gt;
  
  
  Searching for Man Pages
&lt;/h1&gt;

&lt;p&gt;Don't know the command name?&lt;/p&gt;

&lt;p&gt;Use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;man &lt;span class="nt"&gt;-k&lt;/span&gt; copy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cp
install
dd
rsync
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Linux searches manual descriptions.&lt;/p&gt;




&lt;h1&gt;
  
  
  What If Multiple Man Pages Exist?
&lt;/h1&gt;

&lt;p&gt;Use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;man &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nb"&gt;printf&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Linux will show every available manual page.&lt;/p&gt;




&lt;h1&gt;
  
  
  Viewing the File Location
&lt;/h1&gt;

&lt;p&gt;Want to know where the documentation lives?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;man &lt;span class="nt"&gt;-w&lt;/span&gt; &lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/usr/share/man/man1/ls.1.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Reading C Programming Documentation
&lt;/h1&gt;

&lt;p&gt;If you're a C programmer, this is one of the most important skills.&lt;/p&gt;

&lt;p&gt;Instead of searching online for a function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;malloc&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read its manual:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;man 3 malloc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parameters&lt;/li&gt;
&lt;li&gt;Return value&lt;/li&gt;
&lt;li&gt;Errors&lt;/li&gt;
&lt;li&gt;Examples&lt;/li&gt;
&lt;li&gt;Standards&lt;/li&gt;
&lt;li&gt;Thread safety&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Other useful examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;man 2 &lt;span class="nb"&gt;read
&lt;/span&gt;man 2 write
man 2 open
man 2 close
man 3 fopen
man 3 &lt;span class="nb"&gt;printf
&lt;/span&gt;man 3 pthread_create
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  A Professional Reading Workflow
&lt;/h1&gt;

&lt;p&gt;Experienced developers rarely read an entire man page from top to bottom.&lt;/p&gt;

&lt;p&gt;Instead, they follow a focused workflow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Read &lt;strong&gt;NAME&lt;/strong&gt; to understand the command's purpose.&lt;/li&gt;
&lt;li&gt;Check &lt;strong&gt;SYNOPSIS&lt;/strong&gt; to learn the required syntax.&lt;/li&gt;
&lt;li&gt;Read &lt;strong&gt;DESCRIPTION&lt;/strong&gt; for behavior and limitations.&lt;/li&gt;
&lt;li&gt;Jump to &lt;strong&gt;OPTIONS&lt;/strong&gt; and review only the flags you need.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;/&lt;/code&gt; to search for keywords related to your task.&lt;/li&gt;
&lt;li&gt;Look at &lt;strong&gt;SEE ALSO&lt;/strong&gt; to discover related commands or APIs.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This approach is much faster than reading every section sequentially.&lt;/p&gt;




&lt;h1&gt;
  
  
  Common Beginner Mistakes
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Reading Every Line
&lt;/h3&gt;

&lt;p&gt;Most man pages are reference documents, not tutorials.&lt;/p&gt;

&lt;p&gt;Read only the sections relevant to your current task.&lt;/p&gt;




&lt;h3&gt;
  
  
  Ignoring SYNOPSIS
&lt;/h3&gt;

&lt;p&gt;The syntax line explains how to use the command correctly.&lt;/p&gt;

&lt;p&gt;Always study it before trying examples.&lt;/p&gt;




&lt;h3&gt;
  
  
  Not Using Search
&lt;/h3&gt;

&lt;p&gt;Searching with &lt;code&gt;/&lt;/code&gt; is significantly faster than scrolling through long pages.&lt;/p&gt;




&lt;h3&gt;
  
  
  Ignoring SEE ALSO
&lt;/h3&gt;

&lt;p&gt;Many useful Linux tools are discovered through this section.&lt;/p&gt;




&lt;h3&gt;
  
  
  Depending Only on Google
&lt;/h3&gt;

&lt;p&gt;Search engines often lead to outdated or incomplete information.&lt;/p&gt;

&lt;p&gt;The man page installed on your system matches the software version you're using.&lt;/p&gt;




&lt;h1&gt;
  
  
  Best Commands to Practice Reading
&lt;/h1&gt;

&lt;p&gt;Start with these commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;man &lt;span class="nb"&gt;ls
&lt;/span&gt;man &lt;span class="nb"&gt;cp
&lt;/span&gt;man &lt;span class="nb"&gt;mv
&lt;/span&gt;man &lt;span class="nb"&gt;rm
&lt;/span&gt;man &lt;span class="nb"&gt;cat
&lt;/span&gt;man &lt;span class="nb"&gt;pwd
&lt;/span&gt;man &lt;span class="nb"&gt;cd
&lt;/span&gt;man &lt;span class="nb"&gt;grep
&lt;/span&gt;man &lt;span class="nb"&gt;sed
&lt;/span&gt;man &lt;span class="nb"&gt;awk
&lt;/span&gt;man find
man &lt;span class="nb"&gt;chmod
&lt;/span&gt;man &lt;span class="nb"&gt;chown
&lt;/span&gt;man &lt;span class="nb"&gt;tar
&lt;/span&gt;man &lt;span class="nb"&gt;gzip&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're learning C on Linux:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;man 2 open
man 2 &lt;span class="nb"&gt;read
&lt;/span&gt;man 2 write
man 2 mmap
man 2 fork
man 2 execve
man 3 malloc
man 3 free
man 3 &lt;span class="nb"&gt;printf
&lt;/span&gt;man 3 fopen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Learning Linux isn't about memorizing every command or every option. It's about knowing where to find reliable information when you need it.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;man&lt;/code&gt; command gives you direct access to the official documentation for your system. Once you're comfortable reading the &lt;strong&gt;NAME&lt;/strong&gt;, &lt;strong&gt;SYNOPSIS&lt;/strong&gt;, &lt;strong&gt;DESCRIPTION&lt;/strong&gt;, and &lt;strong&gt;OPTIONS&lt;/strong&gt; sections—and using search effectively—you'll spend less time hunting for answers online and more time understanding how Linux actually works.&lt;/p&gt;

&lt;p&gt;Whether you're a Linux beginner, a system administrator, a DevOps engineer, or a C programmer building low-level software, mastering man pages is a skill that will continue to pay off throughout your career.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>manpages</category>
      <category>productivity</category>
      <category>programming</category>
    </item>
    <item>
      <title>50 Most Used Linux Commands for Programmers</title>
      <dc:creator>Farhad Rahimi Klie</dc:creator>
      <pubDate>Sun, 05 Jul 2026 03:33:42 +0000</pubDate>
      <link>https://dev.to/farhadrahimiklie/50-most-used-linux-commands-for-programmers-29ba</link>
      <guid>https://dev.to/farhadrahimiklie/50-most-used-linux-commands-for-programmers-29ba</guid>
      <description>&lt;p&gt;Linux is the backbone of modern development environments—from backend servers to DevOps pipelines and cloud systems. Whether you’re writing code, debugging applications, or managing servers, mastering Linux commands significantly boosts productivity.&lt;/p&gt;

&lt;p&gt;Below are &lt;strong&gt;50 essential Linux commands every programmer should know&lt;/strong&gt;, grouped by purpose for easier learning.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. File and Directory Navigation
&lt;/h2&gt;

&lt;p&gt;These commands help you move around the filesystem quickly and efficiently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. &lt;code&gt;pwd&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Prints the current working directory. Useful when you’re lost in nested folders.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. &lt;code&gt;ls&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Lists files and directories. Add &lt;code&gt;-l&lt;/code&gt; for detailed view or &lt;code&gt;-a&lt;/code&gt; to show hidden files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. &lt;code&gt;cd&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Changes directory. Example: &lt;code&gt;cd /var/www&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. &lt;code&gt;tree&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Displays directory structure in a tree format (may need installation).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. &lt;code&gt;find&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Searches for files and directories based on conditions like name or type.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. File Operations
&lt;/h2&gt;

&lt;p&gt;These are used constantly in development workflows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. &lt;code&gt;touch&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Creates an empty file or updates timestamp.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. &lt;code&gt;cp&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Copies files or directories.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. &lt;code&gt;mv&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Moves or renames files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. &lt;code&gt;rm&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Deletes files or directories. Use carefully.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. &lt;code&gt;mkdir&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Creates a new directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11. &lt;code&gt;rmdir&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Removes empty directories.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. File Viewing and Text Processing
&lt;/h2&gt;

&lt;p&gt;Crucial for reading logs, configs, and code files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;12. &lt;code&gt;cat&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Displays file content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;13. &lt;code&gt;less&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
View large files page by page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;14. &lt;code&gt;head&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Shows first 10 lines of a file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;15. &lt;code&gt;tail&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Shows last 10 lines (useful for logs).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;16. &lt;code&gt;nano&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Simple terminal text editor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;17. &lt;code&gt;vim&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Powerful advanced text editor widely used by developers.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Permissions and Ownership
&lt;/h2&gt;

&lt;p&gt;Important for security and server management.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;18. &lt;code&gt;chmod&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Changes file permissions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;19. &lt;code&gt;chown&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Changes file owner and group.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;20. &lt;code&gt;umask&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Sets default permissions for new files.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Process Management
&lt;/h2&gt;

&lt;p&gt;Used for monitoring and controlling running applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;21. &lt;code&gt;ps&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Displays running processes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;22. &lt;code&gt;top&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Real-time system process monitoring.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;23. &lt;code&gt;htop&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Improved version of &lt;code&gt;top&lt;/code&gt; (interactive UI).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;24. &lt;code&gt;kill&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Terminates a process by PID.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;25. &lt;code&gt;pkill&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Kills process by name.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;26. &lt;code&gt;jobs&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Shows background jobs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;27. &lt;code&gt;fg&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Brings background job to foreground.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;28. &lt;code&gt;bg&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Resumes a stopped job in background.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Networking Commands
&lt;/h2&gt;

&lt;p&gt;Essential for APIs, servers, and debugging network issues.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;29. &lt;code&gt;ping&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Checks connectivity to a host.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;30. &lt;code&gt;curl&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Transfers data from/to servers via HTTP.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;31. &lt;code&gt;wget&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Downloads files from the web.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;32. &lt;code&gt;netstat&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Shows network connections and ports.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;33. &lt;code&gt;ss&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Modern replacement for &lt;code&gt;netstat&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;34. &lt;code&gt;ifconfig&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Displays network interfaces (deprecated but still used).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;35. &lt;code&gt;ip&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Modern tool for network configuration.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Disk and Storage
&lt;/h2&gt;

&lt;p&gt;For managing space and file systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;36. &lt;code&gt;df&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Shows disk space usage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;37. &lt;code&gt;du&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Shows directory size.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;38. &lt;code&gt;lsblk&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Lists block devices (disks, partitions).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;39. &lt;code&gt;mount&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Mounts file systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;40. &lt;code&gt;umount&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Unmounts file systems.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Compression and Archiving
&lt;/h2&gt;

&lt;p&gt;Useful for backups and deployments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;41. &lt;code&gt;tar&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Creates and extracts archives.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;42. &lt;code&gt;zip&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Compresses files into .zip format.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;43. &lt;code&gt;unzip&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Extracts zip files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;44. &lt;code&gt;gzip&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Compresses files using gzip.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;45. &lt;code&gt;gunzip&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Decompresses gzip files.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. System Information
&lt;/h2&gt;

&lt;p&gt;Helpful for understanding system state.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;46. &lt;code&gt;uname&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Displays system information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;47. &lt;code&gt;uptime&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Shows how long system has been running.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;48. &lt;code&gt;whoami&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Displays current user.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;49. &lt;code&gt;history&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Shows previously executed commands.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;50. &lt;code&gt;alias&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Creates shortcuts for long commands.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;These 50 Linux commands form a strong foundation for any programmer working in Linux environments. You don’t need to memorize everything at once—start with navigation, file operations, and process management, then gradually expand into networking and system tools.&lt;/p&gt;

&lt;p&gt;With regular use, these commands become muscle memory and significantly improve your speed, debugging ability, and overall workflow efficiency.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>learning</category>
      <category>productivity</category>
      <category>cli</category>
    </item>
    <item>
      <title>10 Essential C Programming Concepts Every Beginner Should Learn</title>
      <dc:creator>Farhad Rahimi Klie</dc:creator>
      <pubDate>Sat, 20 Jun 2026 02:10:03 +0000</pubDate>
      <link>https://dev.to/farhadrahimiklie/10-essential-c-programming-concepts-every-beginner-should-learn-3oac</link>
      <guid>https://dev.to/farhadrahimiklie/10-essential-c-programming-concepts-every-beginner-should-learn-3oac</guid>
      <description>&lt;p&gt;When people start learning C, they often get overwhelmed by the large amount of syntax and concepts. The truth is that you don't need to learn everything at once.&lt;/p&gt;

&lt;p&gt;If you understand the following 10 concepts well, you'll already have a strong foundation in C programming and be ready to learn more advanced topics later.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Variables and Data Types
&lt;/h2&gt;

&lt;p&gt;Variables are used to store information in memory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="n"&gt;salary&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;grade&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sc"&gt;'A'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Common data types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;int&lt;/code&gt; → stores whole numbers&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;float&lt;/code&gt; → stores decimal numbers&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;double&lt;/code&gt; → stores larger decimal numbers with more precision&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;char&lt;/code&gt; → stores a single character&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without variables, a program cannot store or manipulate data.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Input and Output
&lt;/h2&gt;

&lt;p&gt;Input allows users to provide data, while output displays information on the screen.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello World"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Important functions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;printf()&lt;/code&gt; → prints output&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;scanf()&lt;/code&gt; → reads user input&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These functions allow your program to communicate with users.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Conditional Statements (if / else)
&lt;/h2&gt;

&lt;p&gt;Conditional statements allow programs to make decisions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Adult"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Child"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Programs become useful when they can react differently based on different situations.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Loops
&lt;/h2&gt;

&lt;p&gt;Loops execute code repeatedly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Common loop types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;for&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;while&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;do-while&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Loops help automate repetitive tasks efficiently.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Functions
&lt;/h2&gt;

&lt;p&gt;Functions group related code into reusable blocks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Usage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Code reuse&lt;/li&gt;
&lt;li&gt;Better organization&lt;/li&gt;
&lt;li&gt;Easier maintenance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Professional software is built using many functions.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Arrays
&lt;/h2&gt;

&lt;p&gt;Arrays store multiple values of the same type in a single variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Accessing elements:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Arrays are essential for managing collections of data.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Strings
&lt;/h2&gt;

&lt;p&gt;A string is a sequence of characters.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"John"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In C, strings are actually arrays of characters ending with a special character called the null terminator (&lt;code&gt;\0&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Strings are used everywhere, from usernames to file names and messages.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Pointers
&lt;/h2&gt;

&lt;p&gt;Pointers store memory addresses.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;ptr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Accessing the value:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;ptr&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pointers are one of the most powerful features of C because they allow direct interaction with memory.&lt;/p&gt;

&lt;p&gt;Understanding pointers helps you understand how computers actually work behind the scenes.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. Structures (Structs)
&lt;/h2&gt;

&lt;p&gt;Structures allow you to create custom data types.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;Student&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Usage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;Student&lt;/span&gt; &lt;span class="n"&gt;s1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;s1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Structs are useful when you need to group related information together.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Student records&lt;/li&gt;
&lt;li&gt;Employee records&lt;/li&gt;
&lt;li&gt;Product information&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  10. Dynamic Memory Allocation
&lt;/h2&gt;

&lt;p&gt;Sometimes you don't know how much memory you need until the program runs.&lt;/p&gt;

&lt;p&gt;That's where dynamic memory allocation comes in.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;malloc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;sizeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When finished:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;free&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Important functions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;malloc()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;calloc()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;realloc()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;free()&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Dynamic memory allocation is heavily used in real-world software, databases, operating systems, and many advanced applications.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;If you're learning C, focus on mastering these five topics first:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Functions&lt;/li&gt;
&lt;li&gt;Arrays&lt;/li&gt;
&lt;li&gt;Strings&lt;/li&gt;
&lt;li&gt;Pointers&lt;/li&gt;
&lt;li&gt;Dynamic Memory Allocation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These concepts form the core of C programming and will make learning advanced topics much easier.&lt;/p&gt;

&lt;p&gt;Remember: Great programmers are not the ones who memorize the most syntax. They are the ones who understand how data, memory, and logic work together.&lt;/p&gt;

</description>
      <category>c</category>
      <category>programming</category>
      <category>beginners</category>
      <category>code</category>
    </item>
    <item>
      <title># How to Build Your Own Operating System from Scratch in C</title>
      <dc:creator>Farhad Rahimi Klie</dc:creator>
      <pubDate>Wed, 17 Jun 2026 12:27:02 +0000</pubDate>
      <link>https://dev.to/farhadrahimiklie/-how-to-build-your-own-operating-system-from-scratch-in-c-1112</link>
      <guid>https://dev.to/farhadrahimiklie/-how-to-build-your-own-operating-system-from-scratch-in-c-1112</guid>
      <description>&lt;p&gt;Building your own Operating System (OS) is one of the most challenging and rewarding projects in computer science. It teaches you how computers really work beneath the applications and frameworks we use every day.&lt;/p&gt;

&lt;p&gt;In this article, we'll explore the complete roadmap for creating an operating system from scratch using the C programming language.&lt;/p&gt;




&lt;h1&gt;
  
  
  What Is an Operating System?
&lt;/h1&gt;

&lt;p&gt;An Operating System is software that manages computer hardware and provides services to applications.&lt;/p&gt;

&lt;p&gt;Popular operating systems include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Linux&lt;/li&gt;
&lt;li&gt;Windows&lt;/li&gt;
&lt;li&gt;macOS&lt;/li&gt;
&lt;li&gt;FreeBSD&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An OS is responsible for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Process management&lt;/li&gt;
&lt;li&gt;Memory management&lt;/li&gt;
&lt;li&gt;File systems&lt;/li&gt;
&lt;li&gt;Device drivers&lt;/li&gt;
&lt;li&gt;User interfaces&lt;/li&gt;
&lt;li&gt;Hardware abstraction&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without an operating system, applications cannot easily communicate with hardware.&lt;/p&gt;




&lt;h1&gt;
  
  
  Prerequisites
&lt;/h1&gt;

&lt;p&gt;Before building an operating system, you should understand:&lt;/p&gt;

&lt;h2&gt;
  
  
  Programming Languages
&lt;/h2&gt;

&lt;h3&gt;
  
  
  C
&lt;/h3&gt;

&lt;p&gt;C is the primary language used for kernel development because it provides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Direct memory access&lt;/li&gt;
&lt;li&gt;Low-level control&lt;/li&gt;
&lt;li&gt;High performance&lt;/li&gt;
&lt;li&gt;Minimal runtime dependencies&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Assembly
&lt;/h3&gt;

&lt;p&gt;Assembly is required for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bootloader development&lt;/li&gt;
&lt;li&gt;CPU initialization&lt;/li&gt;
&lt;li&gt;Interrupt handling&lt;/li&gt;
&lt;li&gt;Context switching&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Computer Science Fundamentals
&lt;/h1&gt;

&lt;p&gt;You should know:&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Structures
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Arrays&lt;/li&gt;
&lt;li&gt;Linked Lists&lt;/li&gt;
&lt;li&gt;Stacks&lt;/li&gt;
&lt;li&gt;Queues&lt;/li&gt;
&lt;li&gt;Trees&lt;/li&gt;
&lt;li&gt;B-Trees&lt;/li&gt;
&lt;li&gt;Hash Tables&lt;/li&gt;
&lt;li&gt;Bitmaps&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Algorithms
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Searching&lt;/li&gt;
&lt;li&gt;Sorting&lt;/li&gt;
&lt;li&gt;Scheduling algorithms&lt;/li&gt;
&lt;li&gt;Memory allocation algorithms&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Understanding Computer Architecture
&lt;/h1&gt;

&lt;p&gt;Operating systems interact directly with hardware.&lt;/p&gt;

&lt;p&gt;Important topics:&lt;/p&gt;

&lt;h2&gt;
  
  
  CPU
&lt;/h2&gt;

&lt;p&gt;Learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Registers&lt;/li&gt;
&lt;li&gt;Instructions&lt;/li&gt;
&lt;li&gt;Privilege levels&lt;/li&gt;
&lt;li&gt;Interrupts&lt;/li&gt;
&lt;li&gt;Exceptions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Memory
&lt;/h2&gt;

&lt;p&gt;Understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;RAM&lt;/li&gt;
&lt;li&gt;Virtual Memory&lt;/li&gt;
&lt;li&gt;Paging&lt;/li&gt;
&lt;li&gt;Segmentation&lt;/li&gt;
&lt;li&gt;Memory Mapping&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Storage
&lt;/h2&gt;

&lt;p&gt;Learn about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hard Drives&lt;/li&gt;
&lt;li&gt;SSDs&lt;/li&gt;
&lt;li&gt;File Systems&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Development Environment
&lt;/h1&gt;

&lt;p&gt;Install:&lt;/p&gt;

&lt;h2&gt;
  
  
  Compiler
&lt;/h2&gt;

&lt;p&gt;GCC Cross Compiler&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;x86_64-elf-gcc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using a cross-compiler prevents your host operating system from interfering with kernel compilation.&lt;/p&gt;




&lt;h2&gt;
  
  
  Assembler
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;NASM
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Used for writing assembly code.&lt;/p&gt;




&lt;h2&gt;
  
  
  Emulator
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;QEMU
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Allows testing your operating system safely.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;qemu-system-x86_64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Debugger
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;GDB
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Used for debugging kernel code.&lt;/p&gt;




&lt;h1&gt;
  
  
  Operating System Architecture
&lt;/h1&gt;

&lt;p&gt;A basic operating system consists of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+----------------+
| Applications   |
+----------------+
| System Calls   |
+----------------+
| Kernel         |
+----------------+
| Drivers        |
+----------------+
| Hardware       |
+----------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 1: Create a Bootloader
&lt;/h1&gt;

&lt;p&gt;When a computer starts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;BIOS/UEFI executes.&lt;/li&gt;
&lt;li&gt;Bootloader loads.&lt;/li&gt;
&lt;li&gt;Bootloader loads kernel into memory.&lt;/li&gt;
&lt;li&gt;Kernel starts running.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Simple bootloader example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[BITS 16]
[ORG 0x7C00]

mov ah, 0x0E
mov al, 'H'
int 0x10

jmp $

times 510-($-$$) db 0
dw 0xAA55
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This displays the letter &lt;code&gt;H&lt;/code&gt; on the screen.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 2: Create the Kernel Entry Point
&lt;/h1&gt;

&lt;p&gt;Kernel entry:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;kernel_main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the first C function executed by the kernel.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 3: Display Text on Screen
&lt;/h1&gt;

&lt;p&gt;Using VGA text mode:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#define VGA_MEMORY ((unsigned short*)0xB8000)
&lt;/span&gt;
&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;print_char&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;VGA_MEMORY&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x0F&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Usage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;print_char&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sc"&gt;'A'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should now see a character displayed on the screen.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 4: Build a Terminal
&lt;/h1&gt;

&lt;p&gt;A terminal allows user interaction.&lt;/p&gt;

&lt;p&gt;Features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Print text&lt;/li&gt;
&lt;li&gt;Read keyboard input&lt;/li&gt;
&lt;li&gt;Execute commands&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;myOS&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;help
clear
version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 5: Keyboard Driver
&lt;/h1&gt;

&lt;p&gt;The keyboard generates interrupts.&lt;/p&gt;

&lt;p&gt;Kernel responsibilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read scan codes&lt;/li&gt;
&lt;li&gt;Convert to characters&lt;/li&gt;
&lt;li&gt;Send input to terminal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User presses A
↓
Keyboard Interrupt
↓
Kernel Receives Code
↓
Display A
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 6: Interrupt Handling
&lt;/h1&gt;

&lt;p&gt;Interrupts allow hardware to communicate with the CPU.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keyboard interrupt&lt;/li&gt;
&lt;li&gt;Timer interrupt&lt;/li&gt;
&lt;li&gt;Disk interrupt&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Interrupt Descriptor Table (IDT):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;idt_entry&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;short&lt;/span&gt; &lt;span class="n"&gt;offset_low&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;short&lt;/span&gt; &lt;span class="n"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;zero&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;flags&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;short&lt;/span&gt; &lt;span class="n"&gt;offset_high&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 7: Memory Management
&lt;/h1&gt;

&lt;p&gt;Memory management is one of the most important kernel subsystems.&lt;/p&gt;

&lt;p&gt;Responsibilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Allocate memory&lt;/li&gt;
&lt;li&gt;Free memory&lt;/li&gt;
&lt;li&gt;Protect memory&lt;/li&gt;
&lt;li&gt;Virtual memory mapping&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Simple bitmap allocator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;bitmap&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each bit represents a memory page.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 8: Physical Memory Manager
&lt;/h1&gt;

&lt;p&gt;Tracks available RAM pages.&lt;/p&gt;

&lt;p&gt;Functions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;alloc_page&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;free_page&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;ptr&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 9: Virtual Memory
&lt;/h1&gt;

&lt;p&gt;Modern operating systems use paging.&lt;/p&gt;

&lt;p&gt;Benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Process isolation&lt;/li&gt;
&lt;li&gt;Security&lt;/li&gt;
&lt;li&gt;Larger address spaces&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Virtual address:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0x400000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;May map to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0x1A3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Physical memory.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 10: Process Management
&lt;/h1&gt;

&lt;p&gt;A process is a running program.&lt;/p&gt;

&lt;p&gt;Process structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;process&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;pid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;page_directory&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Kernel responsibilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create process&lt;/li&gt;
&lt;li&gt;Destroy process&lt;/li&gt;
&lt;li&gt;Schedule process&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Step 11: Task Scheduler
&lt;/h1&gt;

&lt;p&gt;Scheduler decides which process runs next.&lt;/p&gt;

&lt;p&gt;Common algorithms:&lt;/p&gt;

&lt;h2&gt;
  
  
  Round Robin
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;P1 → P2 → P3 → P1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Priority Scheduling
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;High Priority First
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 12: Context Switching
&lt;/h1&gt;

&lt;p&gt;Switching between processes requires saving CPU state.&lt;/p&gt;

&lt;p&gt;Save:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Registers&lt;/li&gt;
&lt;li&gt;Stack Pointer&lt;/li&gt;
&lt;li&gt;Instruction Pointer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Restore next process state.&lt;/p&gt;

&lt;p&gt;This creates multitasking.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 13: System Calls
&lt;/h1&gt;

&lt;p&gt;Applications communicate with the kernel using system calls.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;write&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;open&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;close&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Flow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Application
↓
System Call
↓
Kernel
↓
Hardware
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 14: File System
&lt;/h1&gt;

&lt;p&gt;A file system stores data permanently.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;FAT12&lt;/li&gt;
&lt;li&gt;FAT16&lt;/li&gt;
&lt;li&gt;FAT32&lt;/li&gt;
&lt;li&gt;EXT2&lt;/li&gt;
&lt;li&gt;EXT4&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Beginner recommendation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FAT12
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;because it is simple to implement.&lt;/p&gt;

&lt;p&gt;Basic operations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;open&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;write&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 15: Disk Driver
&lt;/h1&gt;

&lt;p&gt;The kernel must communicate with storage devices.&lt;/p&gt;

&lt;p&gt;Responsibilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read sectors&lt;/li&gt;
&lt;li&gt;Write sectors&lt;/li&gt;
&lt;li&gt;Cache data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;read_sector&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;write_sector&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 16: User Mode and Kernel Mode
&lt;/h1&gt;

&lt;p&gt;Modern CPUs support privilege levels.&lt;/p&gt;

&lt;p&gt;Kernel Mode:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ring 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;User Mode:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ring 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Security&lt;/li&gt;
&lt;li&gt;Stability&lt;/li&gt;
&lt;li&gt;Isolation&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Step 17: ELF Executable Loader
&lt;/h1&gt;

&lt;p&gt;ELF is a common executable format.&lt;/p&gt;

&lt;p&gt;The loader:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reads executable.&lt;/li&gt;
&lt;li&gt;Maps memory.&lt;/li&gt;
&lt;li&gt;Creates process.&lt;/li&gt;
&lt;li&gt;Starts execution.&lt;/li&gt;
&lt;/ol&gt;




&lt;h1&gt;
  
  
  Step 18: Device Drivers
&lt;/h1&gt;

&lt;p&gt;Drivers communicate with hardware.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keyboard&lt;/li&gt;
&lt;li&gt;Mouse&lt;/li&gt;
&lt;li&gt;Audio&lt;/li&gt;
&lt;li&gt;Network&lt;/li&gt;
&lt;li&gt;Graphics&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Step 19: Networking
&lt;/h1&gt;

&lt;p&gt;Networking requires implementing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ethernet&lt;/li&gt;
&lt;li&gt;ARP&lt;/li&gt;
&lt;li&gt;IP&lt;/li&gt;
&lt;li&gt;ICMP&lt;/li&gt;
&lt;li&gt;UDP&lt;/li&gt;
&lt;li&gt;TCP&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example stack:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Application
↓
TCP
↓
IP
↓
Ethernet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 20: Graphical User Interface
&lt;/h1&gt;

&lt;p&gt;After the kernel is stable:&lt;/p&gt;

&lt;p&gt;Build:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Framebuffer driver&lt;/li&gt;
&lt;li&gt;Window manager&lt;/li&gt;
&lt;li&gt;Fonts&lt;/li&gt;
&lt;li&gt;Mouse support&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Simple GUI architecture:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Desktop
 ├── Window
 ├── Window
 └── Window
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Recommended Project Roadmap
&lt;/h1&gt;

&lt;p&gt;Follow this order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Bootloader&lt;/li&gt;
&lt;li&gt;Kernel Entry&lt;/li&gt;
&lt;li&gt;VGA Text Output&lt;/li&gt;
&lt;li&gt;Keyboard Driver&lt;/li&gt;
&lt;li&gt;Terminal&lt;/li&gt;
&lt;li&gt;IDT&lt;/li&gt;
&lt;li&gt;Timer&lt;/li&gt;
&lt;li&gt;Physical Memory Manager&lt;/li&gt;
&lt;li&gt;Paging&lt;/li&gt;
&lt;li&gt;Heap Allocator&lt;/li&gt;
&lt;li&gt;Processes&lt;/li&gt;
&lt;li&gt;Scheduler&lt;/li&gt;
&lt;li&gt;System Calls&lt;/li&gt;
&lt;li&gt;FAT12 File System&lt;/li&gt;
&lt;li&gt;ELF Loader&lt;/li&gt;
&lt;li&gt;User Programs&lt;/li&gt;
&lt;li&gt;Networking&lt;/li&gt;
&lt;li&gt;GUI&lt;/li&gt;
&lt;/ol&gt;




&lt;h1&gt;
  
  
  Useful Resources
&lt;/h1&gt;

&lt;p&gt;Recommended books:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Operating Systems: Three Easy Pieces&lt;/li&gt;
&lt;li&gt;Modern Operating Systems&lt;/li&gt;
&lt;li&gt;Operating System Concepts&lt;/li&gt;
&lt;li&gt;Computer Systems: A Programmer's Perspective&lt;/li&gt;
&lt;li&gt;Intel Software Developer Manual&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Recommended websites:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OSDev Wiki&lt;/li&gt;
&lt;li&gt;LittleOSBook&lt;/li&gt;
&lt;li&gt;BrokenThorn OS Development Series&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Building an operating system is a long-term project that can take months or even years. Start small. Focus first on booting the machine, printing text, handling the keyboard, and managing memory. Once those fundamentals are working, gradually add multitasking, file systems, networking, and eventually a graphical interface.&lt;/p&gt;

&lt;p&gt;The most important advice is simple: build one subsystem at a time. Every modern operating system, from Linux to Windows, started as a small kernel capable of doing only a few basic tasks. With patience and consistency, you can build your own operating system from scratch in C and gain a deep understanding of how computers truly work.&lt;/p&gt;

</description>
      <category>ios</category>
      <category>os</category>
      <category>c</category>
      <category>programming</category>
    </item>
    <item>
      <title>Data Structures Used in Database Development: The Foundations Behind Every Database Engine</title>
      <dc:creator>Farhad Rahimi Klie</dc:creator>
      <pubDate>Thu, 04 Jun 2026 04:07:48 +0000</pubDate>
      <link>https://dev.to/farhadrahimiklie/data-structures-used-in-database-development-the-foundations-behind-every-database-engine-54kk</link>
      <guid>https://dev.to/farhadrahimiklie/data-structures-used-in-database-development-the-foundations-behind-every-database-engine-54kk</guid>
      <description>&lt;p&gt;When people think about databases, they usually think about SQL, queries, tables, indexes, and transactions.&lt;/p&gt;

&lt;p&gt;But underneath all of those features lies something even more fundamental:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Structures.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every database engine—from &lt;a href="https://www.postgresql.org?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;PostgreSQL&lt;/a&gt; and &lt;a href="https://www.mysql.com?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;MySQL&lt;/a&gt; to &lt;a href="https://www.mongodb.com?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;MongoDB&lt;/a&gt; and &lt;a href="https://www.sqlite.org?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;SQLite&lt;/a&gt;—is essentially a collection of carefully chosen data structures working together.&lt;/p&gt;

&lt;p&gt;If you want to understand how databases really work—or build your own database engine from scratch—you need to understand the data structures that make modern databases possible.&lt;/p&gt;

&lt;p&gt;In this article, we'll explore the most important data structures used in database development, why they exist, and where they are used.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why Databases Need Specialized Data Structures
&lt;/h1&gt;

&lt;p&gt;Imagine a database containing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1 million rows&lt;/li&gt;
&lt;li&gt;100 million rows&lt;/li&gt;
&lt;li&gt;1 billion rows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A simple linear search through all records would be far too slow.&lt;/p&gt;

&lt;p&gt;Databases must solve several critical problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fast lookups&lt;/li&gt;
&lt;li&gt;Efficient inserts&lt;/li&gt;
&lt;li&gt;Efficient updates&lt;/li&gt;
&lt;li&gt;Fast range queries&lt;/li&gt;
&lt;li&gt;Minimal disk I/O&lt;/li&gt;
&lt;li&gt;Efficient memory usage&lt;/li&gt;
&lt;li&gt;Concurrent access by many users&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Different data structures solve different parts of these problems.&lt;/p&gt;

&lt;p&gt;There is no single "perfect" data structure.&lt;/p&gt;

&lt;p&gt;Instead, database engines combine multiple structures together.&lt;/p&gt;




&lt;h1&gt;
  
  
  1. Arrays
&lt;/h1&gt;

&lt;h2&gt;
  
  
  What is an Array?
&lt;/h2&gt;

&lt;p&gt;An array is a contiguous block of memory containing elements of the same type.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Arrays provide:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;O(1) random access&lt;/li&gt;
&lt;li&gt;Cache-friendly memory layout&lt;/li&gt;
&lt;li&gt;Simple implementation&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Where Databases Use Arrays
&lt;/h2&gt;

&lt;p&gt;Arrays appear everywhere inside database engines:&lt;/p&gt;

&lt;h3&gt;
  
  
  Buffer Pools
&lt;/h3&gt;

&lt;p&gt;Databases load disk pages into memory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Buffer Pool

[Page 1]
[Page 2]
[Page 3]
[Page 4]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The buffer pool is often managed using arrays.&lt;/p&gt;




&lt;h3&gt;
  
  
  Query Execution
&lt;/h3&gt;

&lt;p&gt;Intermediate query results frequently use arrays.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rows returned by the executor may temporarily be stored in array-like structures.&lt;/p&gt;




&lt;h3&gt;
  
  
  Columnar Databases
&lt;/h3&gt;

&lt;p&gt;Column stores often keep values in arrays:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Age Column

20
25
30
40
50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This layout enables efficient analytics.&lt;/p&gt;




&lt;h1&gt;
  
  
  2. Linked Lists
&lt;/h1&gt;

&lt;h2&gt;
  
  
  What is a Linked List?
&lt;/h2&gt;

&lt;p&gt;A linked list stores elements connected through pointers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Node] -&amp;gt; [Node] -&amp;gt; [Node]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each node contains:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;Node&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;Node&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Where Databases Use Linked Lists
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Buffer Management
&lt;/h3&gt;

&lt;p&gt;Many databases maintain free pages using linked lists.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Free Page List

Page 5 -&amp;gt; Page 8 -&amp;gt; Page 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Transaction Management
&lt;/h3&gt;

&lt;p&gt;Active transactions are often tracked through linked structures.&lt;/p&gt;




&lt;h3&gt;
  
  
  Memory Allocators
&lt;/h3&gt;

&lt;p&gt;Database memory managers frequently organize free blocks using linked lists.&lt;/p&gt;




&lt;h1&gt;
  
  
  3. Hash Tables
&lt;/h1&gt;

&lt;h2&gt;
  
  
  What is a Hash Table?
&lt;/h2&gt;

&lt;p&gt;A hash table maps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Key -&amp;gt; Value
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;through a hash function.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Ali" -&amp;gt; 102
"Sara" -&amp;gt; 211
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Why Databases Love Hash Tables
&lt;/h2&gt;

&lt;p&gt;Hash tables provide nearly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;O(1)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;lookup time.&lt;/p&gt;

&lt;p&gt;This makes them ideal for exact-match searches.&lt;/p&gt;




&lt;h2&gt;
  
  
  Where Hash Tables Are Used
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Query Execution
&lt;/h3&gt;

&lt;p&gt;Hash Join:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;
&lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt;
&lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Database builds a hash table for one side of the join.&lt;/p&gt;




&lt;h3&gt;
  
  
  Query Cache
&lt;/h3&gt;

&lt;p&gt;Many engines use hash tables for:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Query -&amp;gt; Result
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;mapping.&lt;/p&gt;




&lt;h3&gt;
  
  
  Metadata Lookup
&lt;/h3&gt;

&lt;p&gt;Finding:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;tables&lt;/li&gt;
&lt;li&gt;indexes&lt;/li&gt;
&lt;li&gt;columns&lt;/li&gt;
&lt;li&gt;users&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;is often done through hash structures.&lt;/p&gt;




&lt;h2&gt;
  
  
  Limitation
&lt;/h2&gt;

&lt;p&gt;Hash tables cannot efficiently perform:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="k"&gt;BETWEEN&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Range queries require ordered structures.&lt;/p&gt;

&lt;p&gt;That's why databases also use trees.&lt;/p&gt;




&lt;h1&gt;
  
  
  4. Binary Search Trees (BST)
&lt;/h1&gt;

&lt;p&gt;A BST stores values in sorted order.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        50
       /  \
     25    75
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Properties:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Left &amp;lt; Root &amp;lt; Right
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Why Databases Rarely Use Plain BSTs
&lt;/h2&gt;

&lt;p&gt;A normal BST can become:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1
 \
  2
   \
    3
     \
      4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Performance degrades to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;O(n)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Therefore databases prefer balanced trees.&lt;/p&gt;




&lt;h1&gt;
  
  
  5. AVL Trees
&lt;/h1&gt;

&lt;p&gt;AVL Trees automatically balance themselves.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      30
     /  \
   20   40
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Height remains controlled.&lt;/p&gt;




&lt;h2&gt;
  
  
  Database Usage
&lt;/h2&gt;

&lt;p&gt;AVL trees are sometimes used in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;in-memory indexes&lt;/li&gt;
&lt;li&gt;metadata structures&lt;/li&gt;
&lt;li&gt;cache management&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, they are less common for large disk-based indexes.&lt;/p&gt;




&lt;h1&gt;
  
  
  6. Red-Black Trees
&lt;/h1&gt;

&lt;p&gt;Red-Black Trees are balanced binary search trees.&lt;/p&gt;

&lt;p&gt;Operations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Search  O(log n)
Insert  O(log n)
Delete  O(log n)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Where Used
&lt;/h2&gt;

&lt;p&gt;Many database internals use Red-Black Trees for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;lock management&lt;/li&gt;
&lt;li&gt;transaction tracking&lt;/li&gt;
&lt;li&gt;memory management&lt;/li&gt;
&lt;li&gt;scheduling structures&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  7. B-Trees
&lt;/h1&gt;

&lt;p&gt;This is where databases become interesting.&lt;/p&gt;

&lt;p&gt;B-Trees are arguably the most important data structure in database history.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Disk access is expensive.&lt;/p&gt;

&lt;p&gt;Reading one node per disk access would be too slow.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;Store many keys in one node.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;|10|20|30|40|
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each node contains multiple keys.&lt;/p&gt;

&lt;p&gt;This dramatically reduces tree height.&lt;/p&gt;




&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;

&lt;p&gt;Instead of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Height = 20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you might get:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Height = 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;for millions of records.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Databases Use B-Trees
&lt;/h2&gt;

&lt;p&gt;Advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fast lookup&lt;/li&gt;
&lt;li&gt;Fast insertion&lt;/li&gt;
&lt;li&gt;Fast deletion&lt;/li&gt;
&lt;li&gt;Excellent range queries&lt;/li&gt;
&lt;li&gt;Minimal disk reads&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Used In
&lt;/h2&gt;

&lt;p&gt;Traditional database indexes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="n"&gt;idx_users_name&lt;/span&gt;
&lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Often becomes a B-Tree index internally.&lt;/p&gt;




&lt;h1&gt;
  
  
  8. B+ Trees
&lt;/h1&gt;

&lt;p&gt;Most modern databases actually use B+ Trees.&lt;/p&gt;

&lt;p&gt;Not plain B-Trees.&lt;/p&gt;




&lt;h2&gt;
  
  
  Structure
&lt;/h2&gt;

&lt;p&gt;Internal nodes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Only keys
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Leaf nodes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Actual records
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Leaf Nodes Are Linked
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Leaf1] &amp;lt;-&amp;gt; [Leaf2] &amp;lt;-&amp;gt; [Leaf3]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is extremely important.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why?
&lt;/h2&gt;

&lt;p&gt;Range queries become very fast.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="k"&gt;BETWEEN&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Database finds the first record and then scans linked leaf pages.&lt;/p&gt;




&lt;h2&gt;
  
  
  Used By
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.mysql.com/doc/refman/en/innodb-storage-engine.html?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;MySQL InnoDB&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.sqlite.org/btree.html?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;SQLite&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Many relational databases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;B+ Trees are arguably the king of database indexing.&lt;/p&gt;




&lt;h1&gt;
  
  
  9. LSM Trees (Log-Structured Merge Trees)
&lt;/h1&gt;

&lt;p&gt;Modern databases face a different challenge:&lt;/p&gt;

&lt;p&gt;Massive write workloads.&lt;/p&gt;




&lt;h2&gt;
  
  
  Problem
&lt;/h2&gt;

&lt;p&gt;Updating a B+ Tree repeatedly causes random disk writes.&lt;/p&gt;

&lt;p&gt;Random writes are expensive.&lt;/p&gt;




&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;LSM Trees.&lt;/p&gt;

&lt;p&gt;Writes first go to memory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MemTable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Later they are flushed to disk.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SSTables
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Background processes merge files.&lt;/p&gt;




&lt;h2&gt;
  
  
  Benefits
&lt;/h2&gt;

&lt;p&gt;Excellent write performance.&lt;/p&gt;

&lt;p&gt;Ideal for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Logging systems&lt;/li&gt;
&lt;li&gt;Analytics systems&lt;/li&gt;
&lt;li&gt;Distributed databases&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Used By
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://cassandra.apache.org?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Apache Cassandra&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://rocksdb.org?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;RocksDB&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/google/leveldb?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;LevelDB&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.scylladb.com?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;ScyllaDB&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  10. Skip Lists
&lt;/h1&gt;

&lt;p&gt;A Skip List is a probabilistic alternative to balanced trees.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Level 3 ------
Level 2 ------
Level 1 ------
Level 0 ------
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Multiple layers accelerate searching.&lt;/p&gt;




&lt;h2&gt;
  
  
  Advantages
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Simpler implementation&lt;/li&gt;
&lt;li&gt;Good performance&lt;/li&gt;
&lt;li&gt;Easy concurrent operations&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Used By
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://redis.io?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Redis&lt;/a&gt; sorted sets&lt;/li&gt;
&lt;li&gt;Some in-memory databases&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  11. Tries (Prefix Trees)
&lt;/h1&gt;

&lt;p&gt;A Trie stores strings character by character.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;car
cat
can
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Shared prefixes are reused.&lt;/p&gt;




&lt;h2&gt;
  
  
  Database Usage
&lt;/h2&gt;

&lt;p&gt;Useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Full-text search&lt;/li&gt;
&lt;li&gt;Autocomplete&lt;/li&gt;
&lt;li&gt;Dictionary lookups&lt;/li&gt;
&lt;li&gt;Query suggestions&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;c
|
a
|
+--r
+--t
+--n
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  12. Heaps (Priority Queues)
&lt;/h1&gt;

&lt;p&gt;A Heap allows quick access to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Smallest
or
Largest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;element.&lt;/p&gt;




&lt;h2&gt;
  
  
  Database Usage
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Query Optimization
&lt;/h3&gt;

&lt;p&gt;Database planners choose execution strategies using priority structures.&lt;/p&gt;

&lt;h3&gt;
  
  
  Top-K Queries
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;
&lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Heaps help efficiently maintain the top results.&lt;/p&gt;




&lt;h1&gt;
  
  
  13. Bloom Filters
&lt;/h1&gt;

&lt;p&gt;A Bloom Filter is a probabilistic structure.&lt;/p&gt;

&lt;p&gt;It answers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Possibly exists"
or
"Definitely does not exist"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Why Useful
&lt;/h2&gt;

&lt;p&gt;Avoids unnecessary disk reads.&lt;/p&gt;




&lt;h2&gt;
  
  
  Used By
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Cassandra&lt;/li&gt;
&lt;li&gt;RocksDB&lt;/li&gt;
&lt;li&gt;BigTable-inspired systems&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Benefit
&lt;/h2&gt;

&lt;p&gt;A tiny memory footprint can save huge amounts of I/O.&lt;/p&gt;




&lt;h1&gt;
  
  
  14. Graph Structures
&lt;/h1&gt;

&lt;p&gt;Graph databases use nodes and edges.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Alice ---- Friend ---- Bob
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Used By
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://neo4j.com?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Neo4j&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/neptune/?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;Amazon Neptune&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Perfect For
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Social networks&lt;/li&gt;
&lt;li&gt;Recommendation systems&lt;/li&gt;
&lt;li&gt;Fraud detection&lt;/li&gt;
&lt;li&gt;Knowledge graphs&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Importance Ranking for Database Engine Developers
&lt;/h1&gt;

&lt;p&gt;If your goal is to build a database engine from scratch, focus on these first:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Data Structure&lt;/th&gt;
&lt;th&gt;Importance&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Arrays&lt;/td&gt;
&lt;td&gt;⭐⭐⭐⭐⭐&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Linked Lists&lt;/td&gt;
&lt;td&gt;⭐⭐⭐⭐&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hash Tables&lt;/td&gt;
&lt;td&gt;⭐⭐⭐⭐⭐&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Binary Search Trees&lt;/td&gt;
&lt;td&gt;⭐⭐⭐&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AVL Trees&lt;/td&gt;
&lt;td&gt;⭐⭐⭐&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Red-Black Trees&lt;/td&gt;
&lt;td&gt;⭐⭐⭐⭐&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B-Trees&lt;/td&gt;
&lt;td&gt;⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B+ Trees&lt;/td&gt;
&lt;td&gt;⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LSM Trees&lt;/td&gt;
&lt;td&gt;⭐⭐⭐⭐⭐⭐⭐&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Skip Lists&lt;/td&gt;
&lt;td&gt;⭐⭐⭐⭐⭐&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tries&lt;/td&gt;
&lt;td&gt;⭐⭐⭐⭐&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Heaps&lt;/td&gt;
&lt;td&gt;⭐⭐⭐&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bloom Filters&lt;/td&gt;
&lt;td&gt;⭐⭐⭐⭐⭐&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Graph Structures&lt;/td&gt;
&lt;td&gt;Depends on DB type&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Database engines are not magical systems. At their core, they are sophisticated combinations of data structures designed to optimize storage, retrieval, indexing, caching, concurrency, and disk access.&lt;/p&gt;

&lt;p&gt;If you want to become a database engineer, your learning path should look roughly like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Arrays&lt;/li&gt;
&lt;li&gt;Linked Lists&lt;/li&gt;
&lt;li&gt;Stacks &amp;amp; Queues&lt;/li&gt;
&lt;li&gt;Hash Tables&lt;/li&gt;
&lt;li&gt;Trees&lt;/li&gt;
&lt;li&gt;AVL Trees&lt;/li&gt;
&lt;li&gt;Red-Black Trees&lt;/li&gt;
&lt;li&gt;B-Trees&lt;/li&gt;
&lt;li&gt;B+ Trees&lt;/li&gt;
&lt;li&gt;Heaps&lt;/li&gt;
&lt;li&gt;Tries&lt;/li&gt;
&lt;li&gt;Bloom Filters&lt;/li&gt;
&lt;li&gt;Skip Lists&lt;/li&gt;
&lt;li&gt;LSM Trees&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Master these structures, and you'll begin to see database engines not as black boxes, but as collections of elegant algorithms and data structures working together to manage data at scale.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>development</category>
      <category>algorithms</category>
      <category>coding</category>
    </item>
    <item>
      <title>How I’d Become a Programmer in 2026 (If I Had to Start From Zero)</title>
      <dc:creator>Farhad Rahimi Klie</dc:creator>
      <pubDate>Tue, 26 May 2026 05:30:49 +0000</pubDate>
      <link>https://dev.to/farhadrahimiklie/how-id-become-a-programmer-in-2026-if-i-had-to-start-from-zero-1ge5</link>
      <guid>https://dev.to/farhadrahimiklie/how-id-become-a-programmer-in-2026-if-i-had-to-start-from-zero-1ge5</guid>
      <description>&lt;p&gt;Imagine this.&lt;/p&gt;

&lt;p&gt;You wake up tomorrow and lose everything related to your programming journey.&lt;/p&gt;

&lt;p&gt;No degree.&lt;br&gt;
No experience.&lt;br&gt;
No connections.&lt;br&gt;
No audience.&lt;br&gt;
No money.&lt;/p&gt;

&lt;p&gt;Just you, a laptop, and internet access.&lt;/p&gt;

&lt;p&gt;Could you still become a programmer in 2026?&lt;/p&gt;

&lt;p&gt;My answer is yes.&lt;/p&gt;

&lt;p&gt;Not because becoming a developer is easy, but because the path today is more accessible than ever before. The problem is not lack of information anymore. The real problem is overload.&lt;/p&gt;

&lt;p&gt;Too many tutorials.&lt;br&gt;
Too many opinions.&lt;br&gt;
Too many frameworks.&lt;br&gt;
Too many people telling beginners to learn everything at once.&lt;/p&gt;

&lt;p&gt;If I had to restart from zero in 2026, this is exactly how I would do it.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 1: Stop Trying to Learn Everything
&lt;/h1&gt;

&lt;p&gt;This is the first mistake almost every beginner makes.&lt;/p&gt;

&lt;p&gt;They open YouTube and suddenly see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“Learn Python”&lt;/li&gt;
&lt;li&gt;“Become an AI Engineer”&lt;/li&gt;
&lt;li&gt;“Learn Rust”&lt;/li&gt;
&lt;li&gt;“Master Kubernetes”&lt;/li&gt;
&lt;li&gt;“Become Full Stack in 30 Days”&lt;/li&gt;
&lt;li&gt;“Top 10 Frameworks You Need”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And then they panic.&lt;/p&gt;

&lt;p&gt;So they start 15 different courses and finish none of them.&lt;/p&gt;

&lt;p&gt;Programming is not hard because of coding itself.&lt;br&gt;
Programming is hard because beginners constantly switch directions.&lt;/p&gt;

&lt;p&gt;If I started again, I would choose ONE path and ignore everything else for a while.&lt;/p&gt;

&lt;p&gt;Focus creates progress.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 2: Learn the Fundamentals First
&lt;/h1&gt;

&lt;p&gt;I would start with web development because it has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;low entry barriers&lt;/li&gt;
&lt;li&gt;huge job opportunities&lt;/li&gt;
&lt;li&gt;freelancing potential&lt;/li&gt;
&lt;li&gt;endless learning resources&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My beginner stack would look like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTML&lt;/li&gt;
&lt;li&gt;CSS&lt;/li&gt;
&lt;li&gt;JavaScript&lt;/li&gt;
&lt;li&gt;Git&lt;/li&gt;
&lt;li&gt;React&lt;/li&gt;
&lt;li&gt;Node.js&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s it.&lt;/p&gt;

&lt;p&gt;Not 20 languages.&lt;br&gt;
Not 40 tools.&lt;/p&gt;

&lt;p&gt;Just enough to become useful.&lt;/p&gt;

&lt;p&gt;A lot of beginners underestimate fundamentals because they look “simple.” But strong fundamentals are what separate good developers from confused developers.&lt;/p&gt;

&lt;p&gt;HTML teaches structure.&lt;br&gt;
CSS teaches layout and design thinking.&lt;br&gt;
JavaScript teaches logic and interactivity.&lt;/p&gt;

&lt;p&gt;Everything builds on top of these.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 3: Forget Advanced Topics for the First Month
&lt;/h1&gt;

&lt;p&gt;If I were a beginner again, I would completely avoid:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI engineering&lt;/li&gt;
&lt;li&gt;blockchain&lt;/li&gt;
&lt;li&gt;microservices&lt;/li&gt;
&lt;li&gt;DevOps complexity&lt;/li&gt;
&lt;li&gt;system architecture&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not because these things are bad, but because they are distractions for beginners.&lt;/p&gt;

&lt;p&gt;You do not learn programming by jumping into complexity immediately.&lt;/p&gt;

&lt;p&gt;You learn programming by understanding simple things deeply.&lt;/p&gt;

&lt;p&gt;Most people quit because they try to sprint through concepts they barely understand.&lt;/p&gt;

&lt;p&gt;Your first month should simply focus on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;understanding variables&lt;/li&gt;
&lt;li&gt;functions&lt;/li&gt;
&lt;li&gt;loops&lt;/li&gt;
&lt;li&gt;conditions&lt;/li&gt;
&lt;li&gt;DOM manipulation&lt;/li&gt;
&lt;li&gt;basic layouts&lt;/li&gt;
&lt;li&gt;simple projects&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That foundation matters more than people think.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 4: Code Every Single Day
&lt;/h1&gt;

&lt;p&gt;This is probably the most important part.&lt;/p&gt;

&lt;p&gt;Not motivation.&lt;br&gt;
Not intelligence.&lt;br&gt;
Not talent.&lt;/p&gt;

&lt;p&gt;Consistency.&lt;/p&gt;

&lt;p&gt;I’ve seen average programmers become amazing simply because they stayed consistent for years.&lt;/p&gt;

&lt;p&gt;Meanwhile, talented people disappear because they stop practicing.&lt;/p&gt;

&lt;p&gt;If I restarted in 2026, I would code daily even if it was only:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;30 minutes&lt;/li&gt;
&lt;li&gt;1 hour&lt;/li&gt;
&lt;li&gt;2 hours&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Small progress compounds massively over time.&lt;/p&gt;

&lt;p&gt;Programming is a skill built through repetition.&lt;/p&gt;

&lt;p&gt;You cannot watch your way into becoming a developer.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 5: Escape Tutorial Addiction Early
&lt;/h1&gt;

&lt;p&gt;Tutorial addiction is one of the biggest hidden problems in tech.&lt;/p&gt;

&lt;p&gt;You watch video after video after video and feel productive…&lt;/p&gt;

&lt;p&gt;…but the moment you open an empty editor alone, your brain freezes.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;Because watching is passive.&lt;br&gt;
Building is active.&lt;/p&gt;

&lt;p&gt;Tutorials should introduce concepts, not replace practice.&lt;/p&gt;

&lt;p&gt;If I started again, I’d follow a very simple rule:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Learn something → build something with it immediately.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That single habit changes everything.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 6: Build Ugly Projects
&lt;/h1&gt;

&lt;p&gt;This part is important.&lt;/p&gt;

&lt;p&gt;Your first projects are supposed to look bad.&lt;/p&gt;

&lt;p&gt;Seriously.&lt;/p&gt;

&lt;p&gt;Most beginners quit because they compare their first project to applications built by senior engineers with 10 years of experience.&lt;/p&gt;

&lt;p&gt;That comparison destroys confidence.&lt;/p&gt;

&lt;p&gt;My first projects would probably include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Calculator App&lt;/li&gt;
&lt;li&gt;Todo App&lt;/li&gt;
&lt;li&gt;Weather App&lt;/li&gt;
&lt;li&gt;Notes App&lt;/li&gt;
&lt;li&gt;Portfolio Website&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Simple projects matter because they teach:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;debugging&lt;/li&gt;
&lt;li&gt;structure&lt;/li&gt;
&lt;li&gt;persistence&lt;/li&gt;
&lt;li&gt;problem-solving&lt;/li&gt;
&lt;li&gt;project completion&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finishing projects is a superpower.&lt;/p&gt;

&lt;p&gt;A lot of beginners start projects.&lt;br&gt;
Very few finish them.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 7: Learn Git and GitHub Properly
&lt;/h1&gt;

&lt;p&gt;In modern programming, coding is only part of the job.&lt;/p&gt;

&lt;p&gt;Developers collaborate.&lt;br&gt;
Track changes.&lt;br&gt;
Deploy updates.&lt;br&gt;
Manage versions.&lt;/p&gt;

&lt;p&gt;That’s where Git and GitHub become essential.&lt;/p&gt;

&lt;p&gt;If I restarted, I would learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;commits&lt;/li&gt;
&lt;li&gt;branches&lt;/li&gt;
&lt;li&gt;pull requests&lt;/li&gt;
&lt;li&gt;repositories&lt;/li&gt;
&lt;li&gt;version control workflows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because employers love proof.&lt;/p&gt;

&lt;p&gt;A strong GitHub profile can sometimes speak louder than certificates.&lt;/p&gt;

&lt;p&gt;Your projects become your resume.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 8: Learn How to Use AI Correctly
&lt;/h1&gt;

&lt;p&gt;In 2026, AI will absolutely become part of programming workflows.&lt;/p&gt;

&lt;p&gt;But there’s something important beginners misunderstand:&lt;/p&gt;

&lt;p&gt;AI is a tool, not a replacement for thinking.&lt;/p&gt;

&lt;p&gt;Good developers use AI to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;explain concepts&lt;/li&gt;
&lt;li&gt;debug errors&lt;/li&gt;
&lt;li&gt;optimize code&lt;/li&gt;
&lt;li&gt;learn faster&lt;/li&gt;
&lt;li&gt;generate ideas&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Bad developers copy-paste code without understanding it.&lt;/p&gt;

&lt;p&gt;That creates dependency instead of growth.&lt;/p&gt;

&lt;p&gt;If I restarted today, I’d treat AI like a mentor — not a shortcut.&lt;/p&gt;

&lt;p&gt;Because eventually you must understand what your code actually does.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 9: Focus on Problem-Solving
&lt;/h1&gt;

&lt;p&gt;A lot of people think programming is about memorizing syntax.&lt;/p&gt;

&lt;p&gt;It’s not.&lt;/p&gt;

&lt;p&gt;Syntax is searchable.&lt;/p&gt;

&lt;p&gt;The real skill is learning how to think logically.&lt;/p&gt;

&lt;p&gt;That means learning how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;break problems into smaller pieces&lt;/li&gt;
&lt;li&gt;debug systematically&lt;/li&gt;
&lt;li&gt;analyze behavior&lt;/li&gt;
&lt;li&gt;think step-by-step&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is why problem-solving platforms can help beginners improve.&lt;/p&gt;

&lt;p&gt;Not because interview questions are magical, but because they train your brain differently.&lt;/p&gt;

&lt;p&gt;Programming is applied thinking.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 10: Learn Backend Development
&lt;/h1&gt;

&lt;p&gt;Frontend development is a great start.&lt;/p&gt;

&lt;p&gt;But backend development is where things begin to feel “real.”&lt;/p&gt;

&lt;p&gt;That’s when you learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;APIs&lt;/li&gt;
&lt;li&gt;databases&lt;/li&gt;
&lt;li&gt;authentication&lt;/li&gt;
&lt;li&gt;servers&lt;/li&gt;
&lt;li&gt;requests/responses&lt;/li&gt;
&lt;li&gt;application logic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Suddenly you’re not just building interfaces anymore.&lt;/p&gt;

&lt;p&gt;You’re building complete systems.&lt;/p&gt;

&lt;p&gt;This stage is exciting because you finally understand how modern applications actually work behind the scenes.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 11: Learn SQL Early
&lt;/h1&gt;

&lt;p&gt;SQL is massively underrated among beginners.&lt;/p&gt;

&lt;p&gt;Many new developers focus only on frontend frameworks while ignoring databases completely.&lt;/p&gt;

&lt;p&gt;But almost every serious application needs data storage.&lt;/p&gt;

&lt;p&gt;Learning SQL teaches:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;structured thinking&lt;/li&gt;
&lt;li&gt;data relationships&lt;/li&gt;
&lt;li&gt;querying&lt;/li&gt;
&lt;li&gt;filtering&lt;/li&gt;
&lt;li&gt;optimization&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even basic SQL knowledge makes you more valuable immediately.&lt;/p&gt;

&lt;p&gt;And honestly?&lt;/p&gt;

&lt;p&gt;SQL is one of the most practical skills in tech.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 12: Start Freelancing Before You Feel Ready
&lt;/h1&gt;

&lt;p&gt;One of the best ways to grow fast is working on real problems.&lt;/p&gt;

&lt;p&gt;Real clients teach lessons tutorials never can.&lt;/p&gt;

&lt;p&gt;When real people use your software:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;bugs matter&lt;/li&gt;
&lt;li&gt;communication matters&lt;/li&gt;
&lt;li&gt;deadlines matter&lt;/li&gt;
&lt;li&gt;reliability matters&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your first freelance projects may pay very little.&lt;/p&gt;

&lt;p&gt;That’s okay.&lt;/p&gt;

&lt;p&gt;At the beginning, experience is more valuable than money.&lt;/p&gt;

&lt;p&gt;You are building:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;confidence&lt;/li&gt;
&lt;li&gt;proof&lt;/li&gt;
&lt;li&gt;communication skills&lt;/li&gt;
&lt;li&gt;practical understanding&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every small project compounds.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 13: Build an Online Presence
&lt;/h1&gt;

&lt;p&gt;This matters much more in 2026 than people realize.&lt;/p&gt;

&lt;p&gt;Opportunities often come from visibility.&lt;/p&gt;

&lt;p&gt;You do not need millions of followers.&lt;/p&gt;

&lt;p&gt;You simply need to show your journey consistently.&lt;/p&gt;

&lt;p&gt;I would post:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what I’m learning&lt;/li&gt;
&lt;li&gt;projects I’m building&lt;/li&gt;
&lt;li&gt;mistakes I fixed&lt;/li&gt;
&lt;li&gt;lessons I discovered&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because people hire developers they can SEE.&lt;/p&gt;

&lt;p&gt;The internet rewards visible builders.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 14: Accept That Progress Feels Slow
&lt;/h1&gt;

&lt;p&gt;This is where many beginners quit.&lt;/p&gt;

&lt;p&gt;The first year of programming can feel frustrating.&lt;/p&gt;

&lt;p&gt;You forget syntax.&lt;br&gt;
You get strange errors.&lt;br&gt;
Nothing works sometimes.&lt;/p&gt;

&lt;p&gt;That is normal.&lt;/p&gt;

&lt;p&gt;Programming often feels difficult because your brain is learning an entirely new way of thinking.&lt;/p&gt;

&lt;p&gt;But eventually something changes.&lt;/p&gt;

&lt;p&gt;Concepts start connecting.&lt;br&gt;
Debugging gets easier.&lt;br&gt;
Projects feel less intimidating.&lt;/p&gt;

&lt;p&gt;The confusion slowly becomes clarity.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 15: Understand the Real Secret
&lt;/h1&gt;

&lt;p&gt;The biggest secret in programming is this:&lt;/p&gt;

&lt;p&gt;Most successful developers are not geniuses.&lt;/p&gt;

&lt;p&gt;They simply stayed consistent longer than everyone else.&lt;/p&gt;

&lt;p&gt;That’s it.&lt;/p&gt;

&lt;p&gt;They kept learning.&lt;br&gt;
Kept building.&lt;br&gt;
Kept failing.&lt;br&gt;
Kept improving.&lt;/p&gt;

&lt;p&gt;Programming rewards patience more than talent.&lt;/p&gt;

&lt;p&gt;Small daily progress looks invisible at first…&lt;/p&gt;

&lt;p&gt;…but after a few years, it completely changes your life.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;If I had to restart from zero in 2026, I wouldn’t chase shortcuts.&lt;/p&gt;

&lt;p&gt;I wouldn’t obsess over becoming “perfect.”&lt;/p&gt;

&lt;p&gt;I’d focus on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;consistency&lt;/li&gt;
&lt;li&gt;fundamentals&lt;/li&gt;
&lt;li&gt;projects&lt;/li&gt;
&lt;li&gt;problem-solving&lt;/li&gt;
&lt;li&gt;patience&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because becoming a programmer is not one giant breakthrough moment.&lt;/p&gt;

&lt;p&gt;It’s thousands of small steps repeated over time.&lt;/p&gt;

&lt;p&gt;And eventually, one day, you realize:&lt;/p&gt;

&lt;p&gt;The beginner who once struggled to print “Hello World” is now building real software.&lt;/p&gt;

&lt;p&gt;That’s how the transformation happens. 🚀&lt;/p&gt;

</description>
      <category>programmers</category>
      <category>developers</category>
      <category>productivity</category>
      <category>code</category>
    </item>
    <item>
      <title>Fastest Programming Languages in 2026: Speed, Performance, and Real-World Use Cases</title>
      <dc:creator>Farhad Rahimi Klie</dc:creator>
      <pubDate>Tue, 19 May 2026 07:05:13 +0000</pubDate>
      <link>https://dev.to/farhadrahimiklie/fastest-programming-languages-in-2026-speed-performance-and-real-world-use-cases-1n4h</link>
      <guid>https://dev.to/farhadrahimiklie/fastest-programming-languages-in-2026-speed-performance-and-real-world-use-cases-1n4h</guid>
      <description>&lt;p&gt;Programming languages are not equally fast.&lt;/p&gt;

&lt;p&gt;Some languages are designed for raw hardware-level performance, while others focus on developer productivity, simplicity, safety, portability, or rapid development.&lt;/p&gt;

&lt;p&gt;When developers talk about the “fastest programming language,” they are usually talking about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Execution speed&lt;/li&gt;
&lt;li&gt;Memory efficiency&lt;/li&gt;
&lt;li&gt;CPU usage&lt;/li&gt;
&lt;li&gt;Startup time&lt;/li&gt;
&lt;li&gt;Latency&lt;/li&gt;
&lt;li&gt;Throughput&lt;/li&gt;
&lt;li&gt;Control over hardware&lt;/li&gt;
&lt;li&gt;Compiler optimizations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But performance is more complicated than simply asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Which language is the fastest?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Because different workloads produce different results.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A language that is extremely fast for operating systems may not be the best for AI.&lt;/li&gt;
&lt;li&gt;A language optimized for web applications may not perform best for embedded systems.&lt;/li&gt;
&lt;li&gt;Some languages trade raw speed for safety.&lt;/li&gt;
&lt;li&gt;Others trade safety for maximum hardware control.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this article, we will deeply explore the fastest programming languages, how they achieve performance, where they are used, their advantages, disadvantages, and which one should be chosen for different types of projects.&lt;/p&gt;




&lt;h1&gt;
  
  
  What Makes a Programming Language Fast?
&lt;/h1&gt;

&lt;p&gt;Before comparing languages, we must first understand what affects performance.&lt;/p&gt;

&lt;p&gt;A programming language itself is not magically fast or slow.&lt;/p&gt;

&lt;p&gt;Performance depends on many layers.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Compiler Quality
&lt;/h2&gt;

&lt;p&gt;A good compiler can heavily optimize code.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GCC&lt;/li&gt;
&lt;li&gt;Clang/LLVM&lt;/li&gt;
&lt;li&gt;MSVC&lt;/li&gt;
&lt;li&gt;Rust Compiler&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Compilers perform optimizations such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dead code elimination&lt;/li&gt;
&lt;li&gt;Loop unrolling&lt;/li&gt;
&lt;li&gt;Inline expansion&lt;/li&gt;
&lt;li&gt;Register allocation&lt;/li&gt;
&lt;li&gt;Vectorization&lt;/li&gt;
&lt;li&gt;Constant folding&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A powerful compiler can dramatically improve performance.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Memory Management
&lt;/h2&gt;

&lt;p&gt;Languages handle memory differently.&lt;/p&gt;

&lt;h3&gt;
  
  
  Manual Memory Management
&lt;/h3&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;C&lt;/li&gt;
&lt;li&gt;C++&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Developer controls memory directly.&lt;/p&gt;

&lt;p&gt;Advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maximum speed&lt;/li&gt;
&lt;li&gt;Fine-grained control&lt;/li&gt;
&lt;li&gt;Minimal overhead&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Disadvantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Memory leaks&lt;/li&gt;
&lt;li&gt;Dangling pointers&lt;/li&gt;
&lt;li&gt;Buffer overflows&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Garbage Collection (GC)
&lt;/h3&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Java&lt;/li&gt;
&lt;li&gt;Go&lt;/li&gt;
&lt;li&gt;C#&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The runtime automatically frees unused memory.&lt;/p&gt;

&lt;p&gt;Advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easier development&lt;/li&gt;
&lt;li&gt;Safer memory handling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Disadvantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GC pauses&lt;/li&gt;
&lt;li&gt;Extra CPU overhead&lt;/li&gt;
&lt;li&gt;Higher memory usage&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. Runtime Overhead
&lt;/h2&gt;

&lt;p&gt;Some languages require heavy runtimes.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JVM for Java&lt;/li&gt;
&lt;li&gt;CLR for C#&lt;/li&gt;
&lt;li&gt;Python Interpreter&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Runtime systems add features like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Memory management&lt;/li&gt;
&lt;li&gt;Security&lt;/li&gt;
&lt;li&gt;Reflection&lt;/li&gt;
&lt;li&gt;Dynamic typing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But these also introduce overhead.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Abstraction Level
&lt;/h2&gt;

&lt;p&gt;Higher-level languages usually sacrifice some speed.&lt;/p&gt;

&lt;p&gt;Low-level languages provide direct hardware access.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Level&lt;/th&gt;
&lt;th&gt;Languages&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Low-Level&lt;/td&gt;
&lt;td&gt;C, C++, Rust&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mid-Level&lt;/td&gt;
&lt;td&gt;Go, Java&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;High-Level&lt;/td&gt;
&lt;td&gt;Python, JavaScript&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;More abstraction usually means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easier development&lt;/li&gt;
&lt;li&gt;Lower performance&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5. JIT vs Ahead-of-Time Compilation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Ahead-of-Time (AOT)
&lt;/h3&gt;

&lt;p&gt;Code compiles before execution.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;C&lt;/li&gt;
&lt;li&gt;C++&lt;/li&gt;
&lt;li&gt;Rust&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Produces very fast native binaries.&lt;/p&gt;




&lt;h3&gt;
  
  
  Just-in-Time (JIT)
&lt;/h3&gt;

&lt;p&gt;Code compiles during execution.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Java&lt;/li&gt;
&lt;li&gt;JavaScript&lt;/li&gt;
&lt;li&gt;C#&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;JIT can become extremely optimized after warm-up.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Fastest Programming Languages
&lt;/h1&gt;

&lt;p&gt;Now let’s explore the fastest languages in detail.&lt;/p&gt;




&lt;h1&gt;
  
  
  1. C — The King of Raw Performance
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Why C is Fast
&lt;/h2&gt;

&lt;p&gt;C is one of the closest high-level languages to hardware.&lt;/p&gt;

&lt;p&gt;It provides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Direct memory access&lt;/li&gt;
&lt;li&gt;Minimal runtime overhead&lt;/li&gt;
&lt;li&gt;Manual memory management&lt;/li&gt;
&lt;li&gt;Extremely small abstractions&lt;/li&gt;
&lt;li&gt;Efficient compiled binaries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;C code is translated almost directly into machine instructions.&lt;/p&gt;

&lt;p&gt;That is why operating systems, databases, kernels, drivers, and embedded systems heavily use C.&lt;/p&gt;




&lt;h2&gt;
  
  
  Advantages of C
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Extremely Fast
&lt;/h3&gt;

&lt;p&gt;C has near-zero abstraction overhead.&lt;/p&gt;

&lt;h3&gt;
  
  
  Small Executables
&lt;/h3&gt;

&lt;p&gt;Compiled binaries are compact.&lt;/p&gt;

&lt;h3&gt;
  
  
  Direct Hardware Access
&lt;/h3&gt;

&lt;p&gt;Perfect for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Operating systems&lt;/li&gt;
&lt;li&gt;Drivers&lt;/li&gt;
&lt;li&gt;Embedded devices&lt;/li&gt;
&lt;li&gt;Database engines&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Portable
&lt;/h3&gt;

&lt;p&gt;C can run almost everywhere.&lt;/p&gt;




&lt;h2&gt;
  
  
  Disadvantages of C
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Unsafe Memory Management
&lt;/h3&gt;

&lt;p&gt;Programmers must manually manage memory.&lt;/p&gt;

&lt;p&gt;This can cause:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Memory leaks&lt;/li&gt;
&lt;li&gt;Crashes&lt;/li&gt;
&lt;li&gt;Security vulnerabilities&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Harder Development
&lt;/h3&gt;

&lt;p&gt;C development is more difficult than modern languages.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real-World Systems Built with C
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Linux Kernel&lt;/li&gt;
&lt;li&gt;MySQL&lt;/li&gt;
&lt;li&gt;PostgreSQL&lt;/li&gt;
&lt;li&gt;Redis&lt;/li&gt;
&lt;li&gt;SQLite&lt;/li&gt;
&lt;li&gt;Git&lt;/li&gt;
&lt;li&gt;Nginx&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Best Use Cases
&lt;/h2&gt;

&lt;p&gt;C is excellent for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Operating systems&lt;/li&gt;
&lt;li&gt;Database engines&lt;/li&gt;
&lt;li&gt;Embedded systems&lt;/li&gt;
&lt;li&gt;Game engines&lt;/li&gt;
&lt;li&gt;Compilers&lt;/li&gt;
&lt;li&gt;Device drivers&lt;/li&gt;
&lt;li&gt;Networking systems&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  2. C++ — High Performance with Abstraction
&lt;/h1&gt;

&lt;p&gt;C++ extends C with advanced programming features.&lt;/p&gt;

&lt;p&gt;It remains one of the fastest languages ever created.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why C++ is Fast
&lt;/h2&gt;

&lt;p&gt;C++ provides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Native compilation&lt;/li&gt;
&lt;li&gt;Zero-cost abstractions&lt;/li&gt;
&lt;li&gt;Template metaprogramming&lt;/li&gt;
&lt;li&gt;Fine memory control&lt;/li&gt;
&lt;li&gt;Powerful optimizations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Modern C++ compilers are incredibly advanced.&lt;/p&gt;




&lt;h2&gt;
  
  
  Advantages of C++
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Near-C Performance
&lt;/h3&gt;

&lt;p&gt;C++ can perform almost as fast as C.&lt;/p&gt;

&lt;h3&gt;
  
  
  Object-Oriented Programming
&lt;/h3&gt;

&lt;p&gt;Supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Classes&lt;/li&gt;
&lt;li&gt;Inheritance&lt;/li&gt;
&lt;li&gt;Polymorphism&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Powerful Standard Library
&lt;/h3&gt;

&lt;p&gt;Includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Containers&lt;/li&gt;
&lt;li&gt;Algorithms&lt;/li&gt;
&lt;li&gt;Smart pointers&lt;/li&gt;
&lt;li&gt;Threading&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  High Flexibility
&lt;/h3&gt;

&lt;p&gt;C++ supports multiple paradigms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Procedural&lt;/li&gt;
&lt;li&gt;Object-oriented&lt;/li&gt;
&lt;li&gt;Generic&lt;/li&gt;
&lt;li&gt;Functional&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Disadvantages of C++
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Complexity
&lt;/h3&gt;

&lt;p&gt;C++ is one of the most complex programming languages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Memory Safety Problems
&lt;/h3&gt;

&lt;p&gt;Still vulnerable to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Undefined behavior&lt;/li&gt;
&lt;li&gt;Pointer bugs&lt;/li&gt;
&lt;li&gt;Memory corruption&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Real-World Systems Built with C++
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Unreal Engine&lt;/li&gt;
&lt;li&gt;Chrome Browser&lt;/li&gt;
&lt;li&gt;Blender&lt;/li&gt;
&lt;li&gt;Adobe Software&lt;/li&gt;
&lt;li&gt;AAA Game Engines&lt;/li&gt;
&lt;li&gt;High-frequency trading systems&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Best Use Cases
&lt;/h2&gt;

&lt;p&gt;C++ is excellent for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High-performance applications&lt;/li&gt;
&lt;li&gt;Game development&lt;/li&gt;
&lt;li&gt;Real-time systems&lt;/li&gt;
&lt;li&gt;Graphics engines&lt;/li&gt;
&lt;li&gt;Simulation software&lt;/li&gt;
&lt;li&gt;Financial systems&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  3. Rust — Fast and Memory Safe
&lt;/h1&gt;

&lt;p&gt;Rust became extremely popular because it combines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;C/C++-level performance&lt;/li&gt;
&lt;li&gt;Memory safety&lt;/li&gt;
&lt;li&gt;Modern tooling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rust is often considered the future of systems programming.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Rust is Fast
&lt;/h2&gt;

&lt;p&gt;Rust uses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Native compilation&lt;/li&gt;
&lt;li&gt;Zero-cost abstractions&lt;/li&gt;
&lt;li&gt;Ownership system&lt;/li&gt;
&lt;li&gt;No garbage collector&lt;/li&gt;
&lt;li&gt;Aggressive optimizations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rust achieves safety without GC overhead.&lt;/p&gt;




&lt;h2&gt;
  
  
  Advantages of Rust
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Memory Safety
&lt;/h3&gt;

&lt;p&gt;Rust prevents:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Null pointer bugs&lt;/li&gt;
&lt;li&gt;Data races&lt;/li&gt;
&lt;li&gt;Use-after-free errors&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Excellent Performance
&lt;/h3&gt;

&lt;p&gt;Rust is often comparable to C++.&lt;/p&gt;

&lt;h3&gt;
  
  
  Concurrency Safety
&lt;/h3&gt;

&lt;p&gt;Rust makes multithreading safer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Modern Tooling
&lt;/h3&gt;

&lt;p&gt;Cargo package manager is excellent.&lt;/p&gt;




&lt;h2&gt;
  
  
  Disadvantages of Rust
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Steep Learning Curve
&lt;/h3&gt;

&lt;p&gt;Ownership and borrowing are difficult initially.&lt;/p&gt;

&lt;h3&gt;
  
  
  Longer Compile Times
&lt;/h3&gt;

&lt;p&gt;Rust compilation can be slower.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real-World Systems Built with Rust
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Firefox Components&lt;/li&gt;
&lt;li&gt;Cloudflare Systems&lt;/li&gt;
&lt;li&gt;Dropbox Infrastructure&lt;/li&gt;
&lt;li&gt;Linux Kernel Modules&lt;/li&gt;
&lt;li&gt;High-performance networking tools&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Best Use Cases
&lt;/h2&gt;

&lt;p&gt;Rust is excellent for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Systems programming&lt;/li&gt;
&lt;li&gt;Networking&lt;/li&gt;
&lt;li&gt;Blockchain&lt;/li&gt;
&lt;li&gt;Security tools&lt;/li&gt;
&lt;li&gt;Databases&lt;/li&gt;
&lt;li&gt;Game engines&lt;/li&gt;
&lt;li&gt;High-performance APIs&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  4. Go — Simplicity with Strong Performance
&lt;/h1&gt;

&lt;p&gt;Go was created by Google.&lt;/p&gt;

&lt;p&gt;Its goal was:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simplicity&lt;/li&gt;
&lt;li&gt;Fast compilation&lt;/li&gt;
&lt;li&gt;Concurrency&lt;/li&gt;
&lt;li&gt;Scalable backend systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Go is not as fast as C or Rust, but it performs extremely well for server-side workloads.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Go is Fast
&lt;/h2&gt;

&lt;p&gt;Go uses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Compiled binaries&lt;/li&gt;
&lt;li&gt;Lightweight goroutines&lt;/li&gt;
&lt;li&gt;Efficient runtime&lt;/li&gt;
&lt;li&gt;Optimized garbage collector&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Advantages of Go
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Very Fast Compilation
&lt;/h3&gt;

&lt;p&gt;Go compiles extremely quickly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Excellent Concurrency
&lt;/h3&gt;

&lt;p&gt;Goroutines are lightweight.&lt;/p&gt;

&lt;h3&gt;
  
  
  Simple Syntax
&lt;/h3&gt;

&lt;p&gt;Easy to learn and maintain.&lt;/p&gt;

&lt;h3&gt;
  
  
  Strong Backend Performance
&lt;/h3&gt;

&lt;p&gt;Perfect for cloud infrastructure.&lt;/p&gt;




&lt;h2&gt;
  
  
  Disadvantages of Go
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Garbage Collection Overhead
&lt;/h3&gt;

&lt;p&gt;GC still introduces some latency.&lt;/p&gt;

&lt;h3&gt;
  
  
  Less Low-Level Control
&lt;/h3&gt;

&lt;p&gt;Not as flexible as C or Rust.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real-World Systems Built with Go
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Docker&lt;/li&gt;
&lt;li&gt;Kubernetes&lt;/li&gt;
&lt;li&gt;Terraform&lt;/li&gt;
&lt;li&gt;Prometheus&lt;/li&gt;
&lt;li&gt;Many cloud-native systems&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Best Use Cases
&lt;/h2&gt;

&lt;p&gt;Go is excellent for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;APIs&lt;/li&gt;
&lt;li&gt;Microservices&lt;/li&gt;
&lt;li&gt;Cloud infrastructure&lt;/li&gt;
&lt;li&gt;Backend systems&lt;/li&gt;
&lt;li&gt;Networking servers&lt;/li&gt;
&lt;li&gt;DevOps tools&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  5. Java — High Performance Through JVM
&lt;/h1&gt;

&lt;p&gt;Many developers underestimate Java speed.&lt;/p&gt;

&lt;p&gt;Modern Java can be extremely fast because of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JVM optimizations&lt;/li&gt;
&lt;li&gt;JIT compilation&lt;/li&gt;
&lt;li&gt;Advanced garbage collectors&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why Java is Fast
&lt;/h2&gt;

&lt;p&gt;The JVM dynamically optimizes hot code paths.&lt;/p&gt;

&lt;p&gt;After warm-up, Java performance becomes impressive.&lt;/p&gt;




&lt;h2&gt;
  
  
  Advantages of Java
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Mature Ecosystem
&lt;/h3&gt;

&lt;p&gt;Huge libraries and frameworks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Strong Performance
&lt;/h3&gt;

&lt;p&gt;Excellent enterprise performance.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cross-Platform
&lt;/h3&gt;

&lt;p&gt;“Write once, run anywhere.”&lt;/p&gt;

&lt;h3&gt;
  
  
  Strong Tooling
&lt;/h3&gt;

&lt;p&gt;Excellent IDE support.&lt;/p&gt;




&lt;h2&gt;
  
  
  Disadvantages of Java
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Higher Memory Usage
&lt;/h3&gt;

&lt;p&gt;JVM consumes significant RAM.&lt;/p&gt;

&lt;h3&gt;
  
  
  Startup Time
&lt;/h3&gt;

&lt;p&gt;Slower startup compared to native binaries.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real-World Systems Built with Java
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Hadoop&lt;/li&gt;
&lt;li&gt;Elasticsearch&lt;/li&gt;
&lt;li&gt;Enterprise Banking Systems&lt;/li&gt;
&lt;li&gt;Android Applications&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Best Use Cases
&lt;/h2&gt;

&lt;p&gt;Java is excellent for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enterprise applications&lt;/li&gt;
&lt;li&gt;Large-scale backend systems&lt;/li&gt;
&lt;li&gt;Banking systems&lt;/li&gt;
&lt;li&gt;Big data systems&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  6. C# — Fast Modern Managed Language
&lt;/h1&gt;

&lt;p&gt;C# runs on the .NET runtime.&lt;/p&gt;

&lt;p&gt;Modern .NET performance has improved dramatically.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why C# is Fast
&lt;/h2&gt;

&lt;p&gt;C# uses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JIT compilation&lt;/li&gt;
&lt;li&gt;Runtime optimizations&lt;/li&gt;
&lt;li&gt;Efficient garbage collection&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Modern .NET is highly optimized.&lt;/p&gt;




&lt;h2&gt;
  
  
  Advantages of C
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Excellent Developer Experience
&lt;/h3&gt;

&lt;p&gt;Very productive language.&lt;/p&gt;

&lt;h3&gt;
  
  
  Strong Ecosystem
&lt;/h3&gt;

&lt;p&gt;Powerful frameworks and tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  Good Performance
&lt;/h3&gt;

&lt;p&gt;Very competitive runtime speed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Great for Games
&lt;/h3&gt;

&lt;p&gt;Unity uses C# heavily.&lt;/p&gt;




&lt;h2&gt;
  
  
  Disadvantages of C
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Runtime Dependency
&lt;/h3&gt;

&lt;p&gt;Requires .NET runtime.&lt;/p&gt;

&lt;h3&gt;
  
  
  GC Overhead
&lt;/h3&gt;

&lt;p&gt;Still affected by garbage collection.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real-World Systems Built with C
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Unity Games&lt;/li&gt;
&lt;li&gt;Enterprise Systems&lt;/li&gt;
&lt;li&gt;ASP.NET Applications&lt;/li&gt;
&lt;li&gt;Windows Applications&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Best Use Cases
&lt;/h2&gt;

&lt;p&gt;C# is excellent for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Game development&lt;/li&gt;
&lt;li&gt;Enterprise software&lt;/li&gt;
&lt;li&gt;Desktop apps&lt;/li&gt;
&lt;li&gt;APIs&lt;/li&gt;
&lt;li&gt;Cross-platform applications&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  7. Zig — A Rising High-Performance Language
&lt;/h1&gt;

&lt;p&gt;Zig is a modern systems programming language.&lt;/p&gt;

&lt;p&gt;It focuses on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simplicity&lt;/li&gt;
&lt;li&gt;Performance&lt;/li&gt;
&lt;li&gt;Manual control&lt;/li&gt;
&lt;li&gt;Better C interoperability&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why Zig is Fast
&lt;/h2&gt;

&lt;p&gt;Zig compiles directly to native machine code.&lt;/p&gt;

&lt;p&gt;It has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minimal runtime&lt;/li&gt;
&lt;li&gt;Explicit memory management&lt;/li&gt;
&lt;li&gt;Strong compiler optimizations&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Advantages of Zig
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Very Predictable Performance
&lt;/h3&gt;

&lt;h3&gt;
  
  
  Excellent C Interoperability
&lt;/h3&gt;

&lt;h3&gt;
  
  
  Simple Language Design
&lt;/h3&gt;

&lt;h3&gt;
  
  
  No Hidden Allocations
&lt;/h3&gt;




&lt;h2&gt;
  
  
  Disadvantages of Zig
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Young Ecosystem
&lt;/h3&gt;

&lt;p&gt;Libraries and tooling are still growing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Smaller Community
&lt;/h3&gt;

&lt;p&gt;Compared to established languages.&lt;/p&gt;




&lt;h2&gt;
  
  
  Best Use Cases
&lt;/h2&gt;

&lt;p&gt;Zig is excellent for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Systems programming&lt;/li&gt;
&lt;li&gt;Embedded software&lt;/li&gt;
&lt;li&gt;Performance-critical tools&lt;/li&gt;
&lt;li&gt;Replacing C in modern projects&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Performance Comparison Table
&lt;/h1&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Language&lt;/th&gt;
&lt;th&gt;Speed&lt;/th&gt;
&lt;th&gt;Memory Efficiency&lt;/th&gt;
&lt;th&gt;Safety&lt;/th&gt;
&lt;th&gt;Ease of Use&lt;/th&gt;
&lt;th&gt;Best For&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;C&lt;/td&gt;
&lt;td&gt;Extremely High&lt;/td&gt;
&lt;td&gt;Extremely High&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;Kernels, databases&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C++&lt;/td&gt;
&lt;td&gt;Extremely High&lt;/td&gt;
&lt;td&gt;Extremely High&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;Hard&lt;/td&gt;
&lt;td&gt;Games, engines&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rust&lt;/td&gt;
&lt;td&gt;Extremely High&lt;/td&gt;
&lt;td&gt;Extremely High&lt;/td&gt;
&lt;td&gt;Very High&lt;/td&gt;
&lt;td&gt;Hard&lt;/td&gt;
&lt;td&gt;Safe systems programming&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Go&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Good&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Easy&lt;/td&gt;
&lt;td&gt;Cloud backends&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Java&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;Enterprise systems&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C#&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Easy&lt;/td&gt;
&lt;td&gt;Enterprise + games&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Zig&lt;/td&gt;
&lt;td&gt;Extremely High&lt;/td&gt;
&lt;td&gt;Extremely High&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;Modern low-level software&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  Which Language is Actually the Fastest?
&lt;/h1&gt;

&lt;p&gt;There is no single universal answer.&lt;/p&gt;

&lt;p&gt;But generally:&lt;/p&gt;

&lt;h2&gt;
  
  
  Raw Native Speed
&lt;/h2&gt;

&lt;p&gt;Usually:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;C&lt;/li&gt;
&lt;li&gt;C++&lt;/li&gt;
&lt;li&gt;Rust&lt;/li&gt;
&lt;li&gt;Zig&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These languages compile directly into optimized machine code.&lt;/p&gt;




&lt;h2&gt;
  
  
  Best Performance + Safety Balance
&lt;/h2&gt;

&lt;p&gt;Rust is often considered the strongest balance between:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Performance&lt;/li&gt;
&lt;li&gt;Reliability&lt;/li&gt;
&lt;li&gt;Modern tooling&lt;/li&gt;
&lt;li&gt;Concurrency safety&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Best Performance for Backend Development
&lt;/h2&gt;

&lt;p&gt;Go is often preferred because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easy concurrency&lt;/li&gt;
&lt;li&gt;Fast development&lt;/li&gt;
&lt;li&gt;Excellent deployment&lt;/li&gt;
&lt;li&gt;Strong scalability&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Best Enterprise Performance
&lt;/h2&gt;

&lt;p&gt;Java and C# dominate enterprise software.&lt;/p&gt;

&lt;p&gt;Their ecosystems are enormous.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why Python and JavaScript Are Not in the Fastest List
&lt;/h1&gt;

&lt;p&gt;Python and JavaScript are incredibly popular.&lt;/p&gt;

&lt;p&gt;But they are not raw-performance languages.&lt;/p&gt;




&lt;h2&gt;
  
  
  Python
&lt;/h2&gt;

&lt;p&gt;Python is slower because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Interpreted execution&lt;/li&gt;
&lt;li&gt;Dynamic typing&lt;/li&gt;
&lt;li&gt;Heavy runtime overhead&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However:&lt;/p&gt;

&lt;p&gt;Python dominates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI&lt;/li&gt;
&lt;li&gt;Machine learning&lt;/li&gt;
&lt;li&gt;Data science&lt;/li&gt;
&lt;li&gt;Automation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because development speed matters.&lt;/p&gt;




&lt;h2&gt;
  
  
  JavaScript
&lt;/h2&gt;

&lt;p&gt;JavaScript engines are highly optimized.&lt;/p&gt;

&lt;p&gt;But JavaScript still cannot usually match:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;C&lt;/li&gt;
&lt;li&gt;C++&lt;/li&gt;
&lt;li&gt;Rust&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;for low-level performance.&lt;/p&gt;

&lt;p&gt;However, JavaScript dominates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Web development&lt;/li&gt;
&lt;li&gt;Frontend applications&lt;/li&gt;
&lt;li&gt;Node.js backends&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Speed vs Productivity
&lt;/h1&gt;

&lt;p&gt;One important truth:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The fastest language is not always the best language.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A team can build a Python application much faster than a C++ application.&lt;/li&gt;
&lt;li&gt;Developer productivity sometimes matters more than CPU speed.&lt;/li&gt;
&lt;li&gt;Faster development can save millions of dollars.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is why companies choose different languages for different goals.&lt;/p&gt;




&lt;h1&gt;
  
  
  Real-World Engineering Truth
&lt;/h1&gt;

&lt;p&gt;Large systems rarely use only one language.&lt;/p&gt;

&lt;p&gt;Example architecture:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Language&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Kernel&lt;/td&gt;
&lt;td&gt;C&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database Engine&lt;/td&gt;
&lt;td&gt;C/C++&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Backend APIs&lt;/td&gt;
&lt;td&gt;Go/Java&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AI Systems&lt;/td&gt;
&lt;td&gt;Python&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Frontend&lt;/td&gt;
&lt;td&gt;JavaScript&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;High-Performance Modules&lt;/td&gt;
&lt;td&gt;Rust/C++&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Modern software engineering is multi-language.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Ranking (General Purpose Performance)
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Tier 1 — Absolute Performance
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;C&lt;/li&gt;
&lt;li&gt;C++&lt;/li&gt;
&lt;li&gt;Rust&lt;/li&gt;
&lt;li&gt;Zig&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Tier 2 — High Performance + Productivity
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Go&lt;/li&gt;
&lt;li&gt;Java&lt;/li&gt;
&lt;li&gt;C#&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Tier 3 — Slower but Extremely Productive
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;JavaScript&lt;/li&gt;
&lt;li&gt;Ruby&lt;/li&gt;
&lt;li&gt;PHP&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Performance is not only about benchmarks.&lt;/p&gt;

&lt;p&gt;A truly great programming language balances:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Speed&lt;/li&gt;
&lt;li&gt;Safety&lt;/li&gt;
&lt;li&gt;Maintainability&lt;/li&gt;
&lt;li&gt;Ecosystem&lt;/li&gt;
&lt;li&gt;Developer productivity&lt;/li&gt;
&lt;li&gt;Scalability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maximum hardware control → C&lt;/li&gt;
&lt;li&gt;Powerful performance engineering → C++&lt;/li&gt;
&lt;li&gt;Modern safe systems programming → Rust&lt;/li&gt;
&lt;li&gt;Cloud-native backend development → Go&lt;/li&gt;
&lt;li&gt;Enterprise systems → Java/C#&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The “best” language depends on your goals.&lt;/p&gt;

&lt;p&gt;But in terms of pure raw execution speed, low-level native languages like C, C++, Rust, and Zig continue to dominate the performance world.&lt;/p&gt;




&lt;h1&gt;
  
  
  What Do You Think?
&lt;/h1&gt;

&lt;p&gt;Which programming language do you think offers the best balance between:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Speed&lt;/li&gt;
&lt;li&gt;Safety&lt;/li&gt;
&lt;li&gt;Productivity&lt;/li&gt;
&lt;li&gt;Simplicity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Share your opinion in the comments.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>programming</category>
      <category>coding</category>
      <category>computerscience</category>
    </item>
  </channel>
</rss>
