Swipe
SwipeSwipe
Swipe Apps

Paths

Motivation

Information

How C# Works · Lesson 5 of 27

Source Code

A free lesson from Swipe Coding · C#, level 1 · updated October 2026

By the Swipe team, founded by Colin · how we make lessons

🤖
Source code is just text you write — the .NET tools turn it into something real. 📝

When you write a C# program, you type text into a file — for example Program.cs. This human-readable text is called "source code". It consists of words and symbols that follow strict, well-defined rules, but is still readable to you.

using System;

class Program
{
    static void Main()
    {
        Console.WriteLine("Hello, World!");
    }
}
This is source code. You can read and understand it, even if you don't know every detail yet.

A computer, however, cannot execute this text directly. A processor only understands "machine language" — tiny electrical signals represented as zeros and ones. Source code is therefore an intermediate stage: understandable for humans, but not yet directly executable by the hardware.

True or false

A computer processor can execute C# source code directly, without translating it first.

C# source code is always saved in files with the extension ".cs". Unlike some other languages, C# does not require the file name to match the name of a class inside it — you could name the file above "Greeting.cs" and it would still work fine, as long as it's part of the project.

Fill in the blank

C# source code files always have the file extension ____.

🤖
You've got the starting point down — next up, how it becomes runnable. ➡️

In summary: source code is the starting point of every C# program. It is the text that you, as a developer, write, read, and edit yourself. Later — with the help of another tool — this text becomes something the computer can actually execute. You will learn about that tool in the next lesson.

Quick check

What best describes "source code"?

Keep your streak going in Swipe Coding

Swipe through every level of C# on your iPhone — with XP, stars, streaks, a personal advisor and the full track beyond these free levels.

Get the Swipe apps →