Git Course 0%

What software development is

Beginner Core Git ≈ 8 min

What you will learn

  • What source code is and how it becomes a running program
  • The difference between an application, a project and a repository
  • Why developers work with plain text files

After this lesson you can

  • I can open a source file, recognize what it is, and say how it relates to the program people use
  • I can use the words "source code", "application", "project" and "repository" correctly

Why this matters

Everything Git does is about files that developers write. If those files are a mystery, Git will be one too. This lesson opens the box: what is in a program, who writes it, and what the words mean that your colleagues use without thinking.

Software is written, not built from parts

An application is a program people use: a website, a phone app, a command-line tool, a report generator. Every application is made from source code: instructions written by people, in a programming language, as plain text files. Source code is readable, at least in part, by anyone who knows the language, and the instructions are followed literally by the computer.

Here are the first lines of the playground program, src/trailguide.py, written in Python:

src/trailguide.py
def load_trails(path=DATA_FILE):
    """Read the CSV file and return a list of trails (one dictionary per trail)."""
    with open(path, newline="", encoding="utf-8") as f:
        trails = list(csv.DictReader(f))
    for trail in trails:
        trail["distance_km"] = float(trail["distance_km"])
    return trails

You do not need to understand it. Notice three things: it is text; it has structure (a named block, load_trails, with indented lines inside); and it tells the computer what to do step by step: open a file, read the rows, turn the distance column into a number, hand the list back.

From source code to a running program

Source code does nothing by itself. Something has to run it:

  • Some languages (Python, JavaScript) are interpreted: a program called the interpreter reads the source and executes it directly. python3 src/trailguide.py means "Python, run this file".
  • Others (Java, C#, Go, Rust) are compiled first: a compiler translates the source into a form the machine runs faster, producing a build (files such as .jar or .exe). Then that build is run.

Either way, the source code is the original, and everything else is produced from it. That is why teams keep source code in Git and usually do not keep the produced files there (lesson 1.4 has more).

Application, project, repository

The three words are used loosely and mean different things:

Word Means In the playground
Application (or program, app, service) The running thing people use The trailguide command that prints trails
Project The folder with everything needed to build and run the application: source code, tests, documentation, data, configuration The trailguide/ folder
Repository (repo) A project folder whose history Git tracks, thanks to a hidden .git folder inside it trailguide/ after you ran git init

A project can contain several applications; a repository is one project with a history. On GitLab a repository lives inside a "project" (GitLab's word for the page with issues, merge requests and the repository); on GitHub the repository is the project.

Why plain text matters to you

Developers do not write code in Word. Source code, tests, configuration and documentation are all plain text: characters, line by line, nothing hidden. That has a consequence you will feel every day:

  • Git can show exactly which lines changed between two versions, and who changed them.
  • Reviewers can comment on a single line.
  • Two people can change different lines of the same file and Git can combine the results.

This is why documentation lives in Markdown files next to the code (lesson 1.11), and why a .docx in a repository makes developers unhappy: Git can store it, but it cannot show what changed inside.

Do and don't

Do

  • Open source files and read them; you will understand more than you expect.
  • Use "project" for the folder and "repository" once Git is involved.
  • Keep your own files (documentation, data, scripts) as plain text whenever possible.

Don't

  • Don't edit source code outside the project folder and paste it back; the project is the only place Git can see.
  • Don't assume the running application and the source are the same version; a change is not "live" until it is built and deployed (lesson 1.5).
  • Don't put binary documents into a repository when a Markdown file would do.

Common mistakes

  • Calling the application "the code". Colleagues say "the code" for the source and "the app" or "the service" for what runs. Mixing them causes confusion in bug reports.
  • Looking for the program in the repository. The repository has the source; the runnable program may be produced from it by a build. If you cannot find a .exe, that is normal.
  • Editing a copy. Double-clicking a file in a downloaded ZIP and editing it there changes nothing in the repository. Work inside the project folder that Git tracks.

Try it yourself

Goal: connect a line of source code to what the program prints.

  1. In your playground, open src/trailguide.py in any editor and find the line containing trail(s).
  2. In a terminal inside the trailguide folder, run the program:

    Terminal
    $ python3 src/trailguide.py --list
  3. Compare the last line of the output with the line you found.

Expected result: the program prints 10 trail(s) and the source line print(f"{len(trails)} trail(s)") is where that text comes from.

Show solution

The line is print(f"{len(trails)} trail(s)") near the end of main. len(trails) counts the rows read from data/trails.csv, so the output changes if you add a trail to the CSV file. Source code produces the behaviour; changing the source (or the data it reads) changes the behaviour.

Check yourself

1. Which statement is correct?
2. Why do developers keep documentation as Markdown text files rather than Word documents?
3. python3 src/trailguide.py --list is an example of…

Key terms

Repository (repo) Git Version control