Linkr
Home Resources Tools Documentation Blog Demo
FR
Learn programming
  • Why learn to code?
  • Programming fundamentals
  • Introduction to SQL
2/5
12 min Boris Delange, Martin Castan, Lou Vignais · 03/07/2026

Programming fundamentals

For anyone who has never coded: what a variable, a function, a loop are; script or console; where you write code, with which software, and how you run it.

In a nutshell

Programming means writing a sequence of instructions that a computer runs step by step. Before tackling a specific language, a few universal notions are enough: the variable (a label on a value), the function (a reusable action), the condition and the loop. This article also explains where you write code, with which software, and how you run it. No prior knowledge is required.

This article is for those who have never written a line of code. If you already have some notions, you can jump straight to the introduction to SQL. Otherwise, take the time to read what follows: the concepts introduced here are found identically in SQL, R and Python.

What does “programming” mean?

Programming means giving instructions to a computer, in a language it understands, so that it carries out a task on your behalf. A cooking recipe is a good image for it: a list of steps, executed in order, that turn ingredients into a dish.

The difference with a classic piece of software (like a spreadsheet): instead of clicking buttons, you write the steps. The computer runs them exactly as you wrote them — no more, no less. It’s confusing at first, but it’s also what makes code reproducible: the same recipe always gives the same dish.

A computer is very obedient, but not clever

It does precisely what it is told. A forgotten comma or a misspelled word, and it stops with an error message. That’s not a problem: reading errors and fixing them is part of the job.

The basic vocabulary

Four notions come up in every language. The examples below are written in Python because its syntax is close to everyday language, but the idea is the same everywhere.

The variable

A variable is a label you stick onto a value in order to reuse it. You create it by giving it a name and a value.

age = 72            # we store 72 in a variable named "age"
name = "Dupont"     # a variable can hold text
age = age + 1       # we can modify it: age is now 73

The name is up to you (pick a telling one: age, creatinine, nb_patients). The = sign does not mean “equal” in the mathematical sense, but “store the value on the right into the variable on the left”.

The function

A function is a reusable action, to which you give values (the arguments) and which returns a result. You will use far more of them than you will write.

# "round" is a function provided by the language: it rounds a number
result = round(3.14159, 2)      # we give it 3.14159 and 2 (decimals)
print(result)                  # displays 3.14

Here round(...) and print(...) are functions. You recognize a function by its parentheses, which contain what you give it. print is used to display a result on screen.

The condition

A condition runs code only if something is true. It’s the word if.

temperature = 38.6

if temperature >= 38:
    print("Fever")
else:
    print("No fever")

The loop

A loop repeats an action on each item of a list, without having to rewrite the code. It’s the word for (“for each”).

ages = [72, 45, 34, 78]
for a in ages:          # for each value in the list...
    print(a)            # ...we display it

You won't write many loops

In data analysis, you manipulate whole tables at once (“compute the mean of this column”) rather than row by row. Loops are still useful to know, but languages like SQL, R and Python spare you from writing them for most common tasks.

Where do you write code?

A question that often puzzles beginners: concretely, where do I type this? Two places, complementary.

The console (or terminal)

The console is an area where you type one instruction at a time; it runs as soon as you press Enter, and the result appears just below. Ideal for quickly testing an idea or exploring data.

The script

A script is a file that contains the whole sequence of instructions, saved. You write it in an editor, then run it in full (or piece by piece). It’s what you keep, what you share, what you re-run identically — the heart of reproducibility.

Console to explore, script to keep

In practice, you fiddle around in the console, then copy what works into a script to preserve it. An analysis project is one or several scripts that you can replay from start to finish.

Which software?

You rarely write code in a plain text editor. You use a development environment, or IDE (Integrated Development Environment): software that brings together, in a single window, the script editor, the console, the display of results and help. Depending on the language:

For SQL

A tool connected to the database (DBeaver, the PostgreSQL interface…) or, to practice, a tutorial in the browser — like our OMOP tutorials.

For R

RStudio, free, is the reference environment. Editor, console, plots and help in a single window. Its publisher, Posit, also offers Positron, a more recent environment that handles both R and Python.

For Python

A Jupyter notebook or the VS Code editor.

The notebook: code, results and text in one place

A notebook (Jupyter) is a document that alternates code cells, their results (tables, plots) and explanatory text. You run a cell with a keyboard shortcut and the result appears just below. It’s the most comfortable format to get started and to share a commented analysis.

How do you install and run it?

Two paths, from the simplest to the most complete:

  1. Without installing anything. Online environments run code in your browser, such as the interactive tutorials for SQL. Perfect for the first steps. The Linkr online demo is one of them: from a project’s IDE, you write and run R, Python or SQL directly on sample health data.
  2. By installing on your computer. You install the language (R, or Python) then its environment (RStudio, VS Code). It’s essential as soon as you work on your own data. The following articles point to the resources for each installation.

To run code, the gesture is almost always the same: place the cursor on a line or select a block, then press Ctrl + Enter (or ⌘ + Enter on Mac). The result appears in the console or below the cell.

And the data in all this?

Programming for data science is above all about manipulating data tables. It is therefore useful to understand how these data are organized before coding them: rows, columns, tables linked together, long format and wide format. We detail all of this in the article How this data is organized — an ideal complementary read before tackling SQL.

A resource to get started gently

If you want a real first step-by-step course before continuing, this one covers the notions of this article without tying them to a particular language. The following articles (SQL, R, Python) offer other resources targeted by language.

OpenClassrooms — Discover How to Build Programs With Algorithms
Type: Online course Language: English Cost: Free Duration: ~6 h Level: Complete beginner Prerequisites: None

What you'll learn

  • Programming logic, independent of any language: variables, conditions, loops, functions.
  • Data types and the structures that hold them (lists, arrays).
  • The last part (sorting, complexity, recursion) goes beyond what you need to analyse data: it is optional.
  • Programming means writing instructions that run step by step; the computer does exactly what it is told.
  • Four universal notions: the variable (a label on a value), the function (a reusable action), the condition (if) and the loop (for).
  • You write code in a console (one instruction at a time, to explore) and in a script (a file you keep and replay).
  • You use a suitable environment: RStudio for R, a Jupyter notebook or VS Code for Python.
  • You can start without installing anything thanks to online environments, then install the tools on your computer.
  • Understanding how data is organized is the natural complement to these basics.
Next article : Introduction to SQL

About the author

View profile
Boris Delange
Boris Delange

Intensive-care physician · academic lecturer in medical informatics

Trained in intensive care medicine, I have worked since 2023 as an academic lecturer in medical informatics at the Clinical Data Centre (CDC) of Rennes University Hospital. I am also a researcher at LTSI (University of Rennes), in the DOMASIA team (Massive Data and Learning Health Information Systems).

Working at the crossroads of care and data science, I created Linkr to connect clinicians, data scientists, engineers and health students around healthcare data analysis.

View LinkedIn profile View ResearchGate profile
PreviousWhy learn to code?NextIntroduction to SQL

Product

  • Home
  • Demo

Resources

  • Documentation
  • Resources
  • Tools
  • Blog

Community

  • Framagit source code
  • Github source code

About

  • InterHop.org
  • Contact

2021–2026 InterHop — CC BY-NC-SA 4.0 (site) · GPLv3 (software)