PM & AI Chronicles

From Product Thinking to Prompt Engineering โ€“ One Tool at a Time

Programming Languages ๐Ÿ“˜: How Modern Code Runs, One Layer at a Time ๐Ÿ“‘<>๐Ÿ“š

In the last article, we explored Assembly Language ๐Ÿ“Ÿ โ€” the closest you can get to talking directly to the processor. If youโ€™d like to see how low-level instructions work before jumping into modern programming languages, check it out here: ๐Ÿ‘‰Low-Level Programming.

Programming languages can go very deep โ€” the kind of deep where even seasoned developers start staring at diagrams and sipping strong coffee. But donโ€™t worry! This article is a beginner-friendly tour. No compiler theory, no confusing internals, no brain-twisting jargon. Just simple, clear explanations to help you understand how different types of languages actually run your code.

Programming languages have come a long way from the low-level, instruction-by-instruction world of assembly. Today, developers write code using languages that are easier to read, faster to build with, and powerful enough to handle everything from web apps to data analytics.

But not all programming languages work the same way. Some are converted directly into machine code before running. Others execute line-by-line as you type. And some are designed to ask questions and retrieve information.

In this article, weโ€™ll explore how different types of programming languages work behind the scenes, focusing on three important categories:

  • Compiled Languages โ€“ where your code becomes lightning-fast machine instructions
  • Interpreted Languages โ€“ where code runs line-by-line for flexibility and ease
  • Query Languages โ€“ where you tell the computer what you want, not how to do it

Letโ€™s dive into how each of these languages transforms human-friendly code into computer-ready actions.

Trying to write an entire modern application in assembly would beโ€ฆ well, heroic โ€” but also painfully slow and incredibly tedious. Thatโ€™s why high-level programming languages became the norm. They allow developers to write code in a cleaner, more human-readable way, without worrying about every tiny CPU instruction.

Compiled and interpreted languages both help shorten the amount of work you need to do, but when building new software, developers often need to choose which type of language to use. Letโ€™s start with compiled languages.

A compiled language uses a compiler โ€” a tool that translates high-level source code into machine code that the computer can execute directly. Creating and running a compiled program typically involves three simple steps:

  • Write the application in a programming language such as Java, C++, or C#. This is called the source code.
  • Use a compiler to convert that source code into machine code.(Most programming tools and IDEs have a built-in compiler.)
  • Run the program file, which on Windows often has an .exe extension.

There are dozens of compiled languages, but unless a project has a very specific requirement, programmers usually pick one of the mainstream ones. In the past, that mightโ€™ve been Fortran, BASIC, or Pascal. Today, common compiled languages include Java, C, C++, and C#.

  • The Linux and Windows kernels are written in C.
  • Much of the rest of Windows is written in C++, with a sprinkle of custom assembly.
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, world!");
    }
}

Even without understanding every part of the code, a few differences stand out:

  • The program is much shorter than an assembly program.
  • Java uses braces { } to group code blocks โ€” every opening brace has a matching closing brace.
  • Comments begin with // (instead of ; in assembly).
  • Java uses double quotes for text, whereas assembly often uses single quotes.

Donโ€™t worry about understanding all the Java keywords right now. The goal here is simply to get a feel for how compiled languages look.

Your next stop: C++, another widely used compiled language.

#include <iostream>

int main() {
    std::cout << "Hello, world!" << std::endl;
    return 0;
}

C++ and Java share some similarities because they both evolved from the C language:

  • Both use brace-based code blocks.
  • Both use // for single-line comments.
  • Both contain a main function where execution begins.
  • Both use double quotes for printed text.
  • Most statements end with a semicolon.

Finally, hereโ€™s the same program written in C# (pronounced โ€œC sharpโ€):

using System;

class HelloWorld {
    static void Main() {
        Console.WriteLine("Hello, world!");
    }
}

C# is also a descendant of the C family, so youโ€™ll notice a familiar feel โ€” braces, semicolons, main method, and similar structure.

Indentation doesn’t affect how the program runs in these languages, but it greatly improves readability. In the C# example, indentation makes it easy to see:

  • There are three opening braces, and
  • three matching closing braces.

Good indentation is like good handwriting โ€” not required, but it makes life easier for everyone reading your code.

Weโ€™ve already learned what a compiler does โ€” it takes human-written source code and turns it into machine code that the computer can understand. Technically, a programmer could write code in a plain text editor, send it to the compiler, and call it a day. But by todayโ€™s standards, that feels almostโ€ฆ barbaric.

Instead, most programmers use an Integrated Development Environment (IDE) โ€” a software package that includes:

  • a code editor,
  • a compiler, and
  • a debugger (to help find and fix errors)

all in one place.

IDEs make life easier by bringing everything together. They also include features such as:

  • syntax highlighting (coloring your code so itโ€™s easier to read)
  • auto-complete / auto-suggestions
  • built-in tools and shortcuts to speed up development

Some of the most popular IDEs today include Visual Studio Code, Visual Studio, and Eclipse.

The second major category of modern, high-level programming languages is interpreted languages. With an interpreted language, each line of code is read and executed by an interpreter every time the program runs. This is the key difference from compiled languages:

  • Compiled languages โ†’ code is translated once, then run many times.
  • Interpreted languages โ†’ code is translated every time you run it.

Both a compiler and an interpreter have the same ultimate goal โ€” turn high-level source code into machine code the computer understands. But they differ in how they do it.

TaskInterpreterCompiler
Translating source codeTranslates line by line while runningTranslates entire code at once before running
Executing programsExecutes immediately as it readsExecutes after full compilation
Analyzing source codeChecks code as it goesAnalyzes code in advance
Executing codeRuns slower (translation happens every run)Runs faster (already machine code)
Using memoryUses less memory upfrontNeeds more memory for compiled output
DebuggingEasierโ€”errors appear exactly where they occurHarderโ€”errors may be buried in compiled output

Debugging interpreted code is generally easier because the interpreter reads the program line by line.If it reaches a line thatโ€™s incorrect, it stops immediately, and shows you the exact error.

A compiler, on the other hand, processes all the code first.If something is wrong anywhere:

  • It generates an error after the entire compilation phase
  • It may or may not point clearly to the line causing the issue
  • Troubleshooting often feels like detective work

This is why beginners often find interpreted languages more forgiving.

For our beginner-friendly overview, weโ€™ll focus on two major categories of interpreted languages:

  • Markup Languages
  • Scripting Languages

These will be the next stops on your journey into how modern programming languages work

A markup language is a language used to annotate or โ€œmark upโ€ text so the computer knows how to process, structure, or display it. Youโ€™ve seen markup outside of computers too โ€” for example:

  • A teacher marking up a studentโ€™s essay with comments
  • A proofreader adding notes and highlights to a manuscript

In all these cases, the markings donโ€™t change the original text, but they add instructions about how it should be handled. Markup languages work the same way. To function properly, a markup language needs a defined set of rules so the computer knows exactly what to do when it encounters a specific mark or tag.

The most widely used markup language today is HTML โ€” HyperText Markup Language. HTML is the language used to create almost every web page on the internet. It allows web developers to structure and format content on a page. The current major version used in the industry is HTML5. HTML is a little unique compared to other languages because:

  • The HTML files are stored on a web server
  • When you visit a website, the server sends the HTML page to your computer
  • Your web browser (Chrome, Edge, Safari, Firefox) interprets the HTML and displays the final formatted webpage

You follow this process every day, even if you never thought about it โ€” open browser โ†’ visit website โ†’ see the rendered HTML.

Another example of a markup language is XML โ€” Extensible Markup Language, which is used to store and transport data.

HTML works by using tags, which tell the browser what to do with the content. A tag normally has:

  • an opening tag โ†’ <Tag>
  • a closing tag โ†’ </Tag>

Hereโ€™s a simple example showing how to make text bold:

<b>Hello, world!</b>

Tags can control almost everything about a webpage:

  • Text formatting (bold, italics, colors)
  • Page structure (headers, paragraphs)
  • Layout (divisions, sections)
  • Images and multimedia
  • Creating tables, lists, forms, buttons, and more

Letโ€™s create a very simple Hello World webpage.

Step 1 โ€” Write the HTML file. Open Notepad (Windows) or any simple text editor, and type:

<!DOCTYPE html>
<html>
<head>
    <title>Hello Page</title>
</head>
<body>
    <h1>Hello, world!</h1>
</body>
</html>

Save the file as hello.html.

Step 2 โ€” Open It in Your Web Browser. Double-click the file. Your browser will open and show the big Hello, world! heading.

Step 3 โ€” Make One Simple Change. Now change something small โ€” for example, add text color, Or add a background color to the page:

<h1 style="color: blue;">Hello, world!</h1>
<body style="background-color: lightyellow;">

Save the file again โ†’ refresh the browser โ†’ see the change instantly. This simple exercise shows how markup languages control appearance and structure with just a few tags.

The second major category of interpreted languages is scripting languages. In the early days of computers, operating systems had very simple interfaces โ€” usually a command prompt โ€” and could typically run only one task at a time. When scripting languages appeared, they allowed users to execute a list of tasks automatically, instead of typing each command manually.

One of the earliest and most widely used scripting languages was Bash (Bourne Again SHell), which also became a popular command interface (or shell) for Unix-based operating systems. A user could create a file containing multiple commands and run it to perform all those actions at once.

Modern scripting languages have evolved a lot, but their primary goal is still the same: ๐Ÿ‘‰ Execute a series of tasks or process data with less code than a compiled language would require. Their advantages include:

  • Less code-intensive โ€” you can accomplish more with fewer lines
  • Support for objects, variables, and functions
  • Easy to write and fast to test.
  • Great for automating tasks or adding behavior to existing systems
  • JavaScript
  • Python (when run as a script)
  • Bash
  • PowerShell
  • Ruby
  • Perl

Perhaps the most common modern use of scripting languages is inside web pages created with HTML.

  • Markup languages (like HTML) focus on formatting and presenting information.
  • They cannot perform actions by themselves.

So developers insert scripting languages to make web pages interactive โ€” to perform actions, respond to clicks, validate forms, and more. The most widely used scripting language for web pages is JavaScript.

Hereโ€™s a simple example of HTML with embedded JavaScript:

<!DOCTYPE html>
<html>
<head>
    <title>JavaScript Example</title>
</head>
<body>
    <script>
        alert("Hello, world!");
    </script>
</body>
</html>

When you open this page in a browser, an alert box pops up saying Hello, world! But, how Did the Browser Know This Is JavaScript?

Because of the <script> tag. HTML assumes that a <script> block contains JavaScript unless told otherwise. (No need to specify “text/javascript” โ€” that’s the default.)

Hereโ€™s a simple Python version of โ€œHello, world!โ€:

print("Hello, world!")

Python can be run as a standalone program, but itโ€™s also commonly used as a scripting language because itโ€™s:

  • simple
  • readable
  • great for automation
  • powerful for data processing

Of all the language categories, query languages are the most different. The word query simply means question, and thatโ€™s exactly what these languages do โ€” they are specialized for asking questions and retrieving data, usually from a database.

Query languages arenโ€™t designed to build apps, automate tasks, or control hardware. Their job is simple and powerful: Get specific information from large collections of data.

The most widely used query language is SQL โ€” Structured Query Language. SQL is used in almost every industry today โ€” banking, healthcare, e-commerce, government, mobile apps, and more โ€” because data is stored in databases, and SQL is the tool used to retrieve that data.

Another example of a query language is LDAP (Lightweight Directory Access Protocol) , which is used to query directory services like Microsoft Active Directory (common in enterprise networks).

SQLโ€™s basic format is very easy to understand. To retrieve information from a database, you use the SELECT statement:

SELECT column_name
FROM table_name
WHERE condition;

In plain English, this means:

  • Select this specific column
  • From this specific table
  • Only for records that match this condition (optional)

Despite its simple start, SQL can grow into extremely powerful expressions.

While the basic syntax is beginner-friendly, SQL can become very advanced. It can:

  • Insert new data into tables
  • Update existing information
  • Delete data
  • Join related data from multiple tables
  • Use mathematical functions (min, max, count, average, sum)
  • Filter and sort results
  • Combine multiple conditions and operators

SQL is the backbone of data-driven applications and remains one of the most important languages in the world of technology.

Programming languages may look different on the surface โ€” some compile into machine code, some run line-by-line, some format text, and some simply ask questions โ€” but they all share a common purpose: helping us communicate with computers more easily and more effectively.

In this article, we explored the four major categories youโ€™ll encounter as a beginner:

  • Compiled Languages โ€” fast, efficient, and translated ahead of time
  • Interpreted Languages โ€” flexible, executed line-by-line
  • Markup Languages โ€” used to structure and present information
  • Query Languages โ€” designed to retrieve data with precision

Each plays its own role in modern technology, and together they form the foundation of how apps, websites, and systems work behind the scenes.

As you continue learning, youโ€™ll start to recognize which languages are used where โ€” and why. But for now, youโ€™ve taken the most important first step: understanding the โ€œbig pictureโ€ of how different languages work and how developers choose the right tool for the job.

This article is part of the Software Development Series โ€” where we break down how software works, how programmers communicate with computers, and what happens behind the scenes when code runs. ๐Ÿ‘‰ โ€” Software Development: Modern Software Basics.