CREATE TABLE students (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL
);
CREATE TABLE enrollments (
student_id INTEGER REFERENCES students(id)
);Glossary
112 programming words explained in plain language, most with a short example and a link to the course that teaches them. The same words are underlined inside lessons; click one for a quick definition.
A
- Aggregate function
- A SQL function that collapses many rows into one value: COUNT, SUM, AVG, MIN, MAX. With GROUP BY it runs once per group.SQL
SELECT age, AVG(grade) AS avg_grade, COUNT(*) AS n FROM students GROUP BY age HAVING COUNT(*) > 1; - Algorithm
- A precise sequence of steps that turns an input into an output. Sorting a list, finding a route, and compressing an image are all algorithms; the same one can be written in any language.Data Structures & AlgorithmsPython
def is_prime(n): return n > 1 and all(n % d for d in range(2, int(n ** 0.5) + 1)) print([n for n in range(20) if is_prime(n)]) - APIalso: REST, endpoint
- Application Programming Interface: the set of functions, endpoints or commands one piece of software exposes so another can use it. A web API is usually URLs that accept and return JSON.JavaScriptPythonHow the Internet Works
import json, urllib.request with urllib.request.urlopen("https://api.example.com/books/1") as r: book = json.load(r) # the API answers with JSON print(book["title"]) - Argumentalso: parameter
- A value you pass into a function when calling it. The names in the function definition are parameters; the values at the call site are arguments.PythonJavaScript
def greet(name, greeting="Hello"): # parameters return f"{greeting}, {name}!" greet("Ada", greeting="Hi") # arguments - Arrayalso: list
- An ordered collection of values accessed by numeric index, starting at 0. Python calls its flexible version a list; C arrays are fixed-size blocks of memory.JavaScriptCData Structures & Algorithms
scores = [90, 85, 77] # a Python list scores.append(100) print(scores[0], len(scores)) - Arrow function
- JavaScript's short function syntax: (a, b) => a + b. Arrows have no this of their own, which makes them ideal for callbacks inside methods.JavaScriptTypeScript
const double = n => n * 2 const add = (a, b) => a + b [1, 2, 3].map(n => n * n) - Assembly
- Human-readable names for a CPU's raw instructions. One line of assembly is one machine operation, which is why it is the last stop before the hardware.AssemblyComputer Architecture
- assert
- A statement that checks a condition you believe must hold and raises AssertionError if it does not. Used in tests and as a sanity check during development.Python
def split_bill(total, people): assert people > 0, "need at least one person" return total / people - Async / awaitalso: asynchronous, concurrency
- Syntax for writing code that waits on slow operations (network, disk) without blocking everything else. await pauses one task; other tasks keep running on the same thread.PythonJavaScript
import asyncio async def fetch(name, delay): await asyncio.sleep(delay) return name async def main(): print(await asyncio.gather(fetch("a", 0.2), fetch("b", 0.1))) asyncio.run(main())
B
- Big O notationalso: complexity, time complexity
- A way to describe how an algorithm's cost grows with input size, ignoring constants. O(1) is constant, O(log n) barely grows, O(n) is proportional, O(n²) doubles the input and quadruples the work.Data Structures & Algorithms
# O(n): one pass total = sum(numbers) # O(n^2): a pass inside a pass pairs = [(a, b) for a in numbers for b in numbers] # O(log n): halving each step import bisect i = bisect.bisect_left(sorted_numbers, 42) - Binaryalso: bit, byte
- Base 2: numbers written with only 0 and 1. Everything a computer stores is ultimately binary, which is why 8 bits (one byte) give 256 possible values.Computer Architecture
- Boolean
- A value that is either true or false. Comparisons produce booleans, and if statements consume them. Named after George Boole.PythonJavaScript
is_open = 9 <= hour < 17 print(type(is_open), is_open and not holiday) - Branch (git)
- An independent line of commits. You create a branch to work on something without disturbing main, then merge it back when it is ready.Git
git switch -c feature/search # ...work, commit... git switch main git merge feature/search - break and continue
- Two loop controls. break leaves the loop entirely; continue skips the rest of the current iteration and moves to the next one.PythonJavaScript
for n in range(10): if n == 7: break # stop the whole loop if n % 2: continue # skip odd numbers print(n) # 0 2 4 6 - Bugalso: debugging
- A mistake in a program that makes it behave incorrectly. Reading the error message calmly is the first debugging step; the second is shrinking the input until the smallest failing case is clear.Python
C
- Cachealso: memoisation, memoization
- A copy of data kept somewhere faster than its source, so the next request does not pay the full cost. CPUs, browsers, and functools.cache all use the same idea.Computer ArchitecturePython
from functools import cache @cache def fib(n): return n if n < 2 else fib(n - 1) + fib(n - 2) print(fib(90)) # instant: each n computed once - Callback
- A function you hand to another function to be called later, when something happens or finishes. Event handlers and setTimeout use callbacks; promises were invented to tame them.JavaScript
button.addEventListener('click', () => { console.log('clicked') // this arrow function is the callback }) setTimeout(() => console.log('later'), 500) - Classalso: object-oriented, OOP, instance
- A blueprint for objects: it names the data each object holds and the methods that operate on it. An instance is one concrete object made from the class.PythonJavaScriptJavaC#
class Account: def __init__(self, owner): self.owner = owner self.balance = 0 def deposit(self, amount): self.balance += amount acct = Account("Ada") # an instance acct.deposit(50) - CLIalso: command line, shell
- Command-line interface: a program you run by typing its name and options into a terminal rather than clicking. Fast to automate and easy to combine with other tools.How the Terminal WorksBash
- Closure
- A function bundled with the variables from the scope it was created in. The inner function keeps those variables alive, which is how private state and counters work in JavaScript and Python.JavaScriptPython
def make_counter(): count = 0 def bump(): nonlocal count count += 1 return count return bump c = make_counter() print(c(), c()) # 1 2 — count lives on inside bump - Comment
- Text in source code the computer ignores, written for people. Good comments explain why, not what; the code already says what.PythonJavaScript
- Commit (git)
- A saved snapshot of your project with a message describing the change. Commits form a history you can inspect, revert and share.Git
git add . git commit -m "Add the search page" git log --oneline - Compiler
- A program that translates source code into another form, typically machine code, before it runs. C, Rust and Go are compiled; the compiler catches many errors up front.CompilersCRust
- Comprehension
- Python's compact syntax for building a list, set or dict from an iterable in one expression: [x * 2 for x in data if x > 0].Python
squares = [n * n for n in range(10) if n % 2 == 0] lengths = {w: len(w) for w in ["apple", "banana"]} - const and let
- Modern JavaScript declarations. const binds a name that cannot be reassigned; let can be. Both are block-scoped. Avoid var.JavaScriptTypeScript
const limit = 10 // cannot be reassigned let count = 0 // can count += 1 - CSS
- Cascading Style Sheets: the language that controls how HTML looks — colours, spacing, layout, animation. It cascades because several rules can apply and the most specific wins.CSSTailwind CSS
.card { padding: 1rem; border-radius: 8px; } .card h1 { color: darkred; font-family: Georgia, serif; }
D
- Database
- Software that stores structured data and answers questions about it reliably, even with many users at once. Relational databases organise data into tables and are queried with SQL.SQL
- Dataclass
- A Python class declared with @dataclass that gets __init__, __repr__ and __eq__ generated from its field annotations. The default choice for simple records.Python
from dataclasses import dataclass @dataclass class Point: x: float y: float print(Point(1, 2) == Point(1, 2)) # True, for free - Decorator
- A function that takes a function and returns a new one, applied with the @name syntax. Used for caching, logging, timing and registering handlers without touching the original code.Python
import functools def shout(func): @functools.wraps(func) def wrapper(*a, **kw): return func(*a, **kw).upper() return wrapper @shout def greet(name): return f"hello {name}" print(greet("sam")) # HELLO SAM - def
- The Python keyword that defines a function. The name comes next, then the parameters in parentheses, then a colon and an indented body.Python
def hypotenuse(a, b): return (a ** 2 + b ** 2) ** 0.5 - Dependencyalso: package, library
- Code your project needs that someone else wrote: a package from PyPI or npm. Recorded in requirements.txt, pyproject.toml or package.json so others can install the same versions.PythonNode.js
- Destructuring
- Unpacking values from arrays or objects into variables in one statement, with defaults and rest collection.JavaScriptTypeScript
const { host, port = 8080, ...rest } = config const [first, ...others] = list - Dictionaryalso: hash map
- A collection that maps keys to values with fast lookup: phone book, not list. Called dict in Python, object or Map in JavaScript, hash map in general.PythonJavaScriptData Structures & Algorithms
ages = {"Sam": 32, "Maya": 28} ages["Leo"] = 41 print(ages.get("Ada", "unknown"), list(ages)) - Docstring
- A string literal placed first inside a function, class or module that documents it. help() and editors read it; it lives on the __doc__ attribute.Python
def area(r): """Return the area of a circle of radius r.""" return 3.14159 * r * r print(area.__doc__) - DOM
- Document Object Model: the browser's live tree of objects representing the page. JavaScript changes what you see by changing the DOM.JavaScriptHTML
const h1 = document.querySelector('h1') h1.textContent = 'Changed by JavaScript' document.body.append(document.createElement('p')) - Duck typing
- Caring about what an object can do rather than what it is. If it has the methods you need, it works — the name comes from "if it quacks like a duck".Python
def total_length(items): return sum(len(x) for x in items) # anything with len() works print(total_length(["hello", [1, 2], {"a": 1}]))
E
- Enumerate
- A built-in that pairs each item of an iterable with its index, so you loop over both at once without managing a counter.Python
for i, name in enumerate(["Ada", "Sam"], start=1): print(i, name) - Environment variable
- A named value every program inherits from its parent: HOME, PATH, USER. export sets one for the current shell and its children.How the Terminal WorksBash
echo $HOME export EDITOR=nano env | grep EDITOR - Event loop
- The mechanism that lets a single thread handle many waiting operations: it runs a task, and when the task awaits something slow, it picks up the next ready task. asyncio and the browser both work this way.JavaScriptPythonNode.js
console.log('one') setTimeout(() => console.log('three'), 0) console.log('two') // the timeout waits for the loop to come round - Exceptionalso: error, traceback, stack trace
- An error object raised when something goes wrong. Code can catch it with try/except (Python) or try/catch (JavaScript) and recover; uncaught, it stops the program with a traceback.PythonJavaScript
try: n = int("forty") except ValueError as e: print("bad number:", e) finally: print("always runs") - Exit codealso: exit status
- The number a program returns when it finishes: 0 means success, anything else means failure. The shell stores the last one in $? and uses it for && and ||.How the Terminal WorksBash
ls /nope echo $? # 2 make && ./run # run only if make succeeded
F
- f-stringalso: formatted string literal
- A string literal prefixed with f whose {braces} evaluate expressions inline, with an optional format spec after a colon. The modern way to build text in Python.Python
name, price = "notebook", 24.5 print(f"{name:<10}{price:>8.2f}") print(f"{name=}") - Function
- A named, reusable block of code that takes inputs, does something, and usually returns a result. The basic unit of organisation in almost every language.PythonJavaScript
def area(width, height=1): """Return the area of a rectangle.""" return width * height print(area(3, 4), area(5))
G
- Generatoralso: iterator, lazy
- A function that yields values one at a time instead of returning a whole list, so it can produce huge or infinite sequences lazily. Python uses yield; JavaScript uses function*.PythonJavaScript
def countdown(n): while n > 0: yield n n -= 1 print(list(countdown(3))) # [3, 2, 1] - Generic
- A type parameter that lets a function or class work with many types while staying type-safe: Stack<T> is a stack of whatever T you choose.TypeScriptRustJava
function firstOr<T>(items: T[], fallback: T): T { return items.length ? items[0] : fallback } firstOr([1, 2], 0) // T is number firstOr([], 'none') // T is string - Gitalso: version control, GitHub
- The standard version-control system. It records every change to a project, lets many people work in parallel, and makes it safe to experiment because anything can be undone.Git
- Global and nonlocal
- Keywords that let a function assign to a variable from an enclosing scope instead of creating a new local one. nonlocal reaches the enclosing function; global reaches module level. Use sparingly.Python
def make_counter(): count = 0 def bump(): nonlocal count count += 1 return count return bump
H
- Hoisting
- JavaScript moves function declarations (and var declarations, without their values) to the top of their scope before running. let and const are not hoisted the same way, which is one reason to prefer them.JavaScript
greet() // works: function declarations are hoisted function greet() { console.log('hi') } console.log(x) // undefined, not an error, because of var hoisting var x = 1 - HTML
- HyperText Markup Language: the structure of every web page, written as nested tags such as <h1>, <p> and <a>. Content lives in HTML, appearance in CSS, behaviour in JavaScript.HTML
<article> <h1>Hello, world</h1> <p>Read the <a href="/about">about page</a>.</p> </article> - HTTPalso: request, response, status code
- The protocol browsers and servers use to talk. A request names a method (GET, POST) and a URL; the response carries a status code (200 OK, 404 Not Found) and a body.How the Internet WorksNode.js
GET /books/1 HTTP/1.1 Host: api.example.com HTTP/1.1 200 OK Content-Type: application/json {"title": "The Hobbit"}
I
- IDEalso: editor
- Integrated Development Environment: an editor with a debugger, run button and language tooling built in. VS Code with extensions is the common middle ground.
- Immutablealso: mutable
- Cannot be changed after creation. Strings and tuples in Python are immutable; a method like upper() returns a new string. Immutability makes code easier to reason about.PythonRust
s = "hello" t = s.upper() # a new string; s is unchanged point = (3, 4) # point[0] = 5 -> TypeError: tuples cannot be changed - Indentation
- Python uses leading whitespace to mark blocks: the body of an if, loop, function or class is everything indented beneath it. Four spaces is the convention; mixing tabs and spaces is an error.Python
if hour < 12: print("good") # inside the if print("morning") print("always") # outside - Index
- Two meanings. In a sequence, the position of an element, counting from 0. In a database, a lookup structure that makes searching a column fast.PythonSQL
names = ["Ada", "Sam"] print(names[0], names[-1]) # positions count from 0 -- SQL: CREATE INDEX idx_email ON users(email); - Interface
- A named description of an object's shape in TypeScript: which properties it has and their types. Interfaces can be extended and merged; they vanish at compile time.TypeScript
interface Person { name: string age: number skills?: string[] } const ada: Person = { name: 'Ada', age: 36 } - Interpreter
- A program that runs source code directly, statement by statement, instead of compiling it first. Python and JavaScript are interpreted, which makes them quick to try and easy to script.PythonCompilers
- Iterable and iteratoralso: iterator protocol
- An iterable is anything a for loop can walk over (lists, strings, dicts, files, generators). An iterator is the object that hands out the items one at a time via next().Python
it = iter(["red", "blue"]) print(next(it)) # red print(next(it)) # blue # next(it) -> StopIteration
J
- JOIN
- Combines rows from two tables where a condition matches, usually a foreign key equalling a primary key. INNER keeps matches only; LEFT keeps every row from the left table.SQL
SELECT s.name, c.name AS course, e.score FROM enrollments e JOIN students s ON s.id = e.student_id JOIN courses c ON c.id = e.course_id; - JSON
- JavaScript Object Notation: a text format for structured data using objects, arrays, strings, numbers, booleans and null. The default language of web APIs and config files.PythonJavaScript
import json text = '{"name": "Maya", "books": 3, "member": true}' data = json.loads(text) print(data["books"], json.dumps(data, indent=2))
K
- Keyword argumentalso: kwargs
- An argument passed by name rather than position: greet(name="Ada"). Keyword arguments make calls readable and let you skip defaults you do not want to change.Python
def order(item, qty=1, gift_wrap=False): ... order("candles", gift_wrap=True) # qty keeps its default
L
- Lambda
- An anonymous one-expression function. Handy as a sort key or a short callback; anything longer deserves a def with a name.Python
people = [("Sam", 41), ("Maya", 28)] people.sort(key=lambda p: p[1]) print(people) - List
- Python's ordered, mutable sequence. Append, insert, slice, sort in place, and index from 0 (or from the end with negatives).Python
scores = [23, 51, 100] scores.append(150) print(scores[0], scores[-1], scores[1:3]) - Loop
- A statement that repeats a block: for iterates over a sequence, while repeats as long as a condition holds. break exits early; continue skips to the next round.PythonJavaScript
for word in ["one", "two", "three"]: print(word) n = 3 while n > 0: n -= 1
M
- Method
- A function that belongs to an object and is called with dot notation: text.upper(), list.append(x). Inside a class, methods receive the instance as self.PythonJavaScript
class Dog: def bark(self, times=1): return "woof " * times print(Dog().bark(3)) # Dog().bark is a method - Modulealso: import, package
- A file of code you can import into another. Python modules are .py files; a package is a directory of them. Modules keep names organised and code reusable.PythonJavaScript
import math from datetime import date print(math.sqrt(2), date.today().year) - Mutable
- Can be changed in place. Lists, dicts and sets are mutable; strings, tuples and numbers are not. Mutable default arguments are a classic trap because they are shared between calls.Python
a = [1, 2] b = a # same list, two names b.append(3) print(a) # [1, 2, 3] — a changed too
N
- Namespace
- A mapping from names to objects: each module, function call and class has its own. That is why two modules can both define a function called run without colliding.Python
import math import statistics math.sqrt(9) # sqrt lives in the math namespace statistics.mean([1, 2]) - Narrowing
- TypeScript refining a broad type to a specific one inside a branch, using typeof, instanceof, in, equality checks or a custom type guard.TypeScript
function describe(v: string | number) { if (typeof v === 'string') return v.toUpperCase() // v is string here return v.toFixed(2) // v is number here } - None / nullalso: undefined
- The value that means "nothing here". Python has None, JavaScript has both null and undefined. Many crashes are a method called on one of these by accident.PythonJavaScript
result = None if result is None: print("nothing yet") # JavaScript: let x = null; let y; // y is undefined - NULL
- SQL's marker for a missing value. It is not equal to anything, including itself, so you test it with IS NULL. Aggregates skip it; COALESCE replaces it.SQL
SELECT name FROM students WHERE email IS NULL; SELECT COALESCE(email, 'no email') FROM students;
O
- Operating systemalso: kernel, process
- The software that manages the hardware and runs your programs: Linux, macOS, Windows. It provides files, processes, memory and networking through system calls.Operating Systems
P
- Package manageralso: pip, npm
- A tool that installs libraries and records which versions your project uses: pip for Python, npm for JavaScript, cargo for Rust. A lock file makes installs reproducible.PythonNode.js
pip install requests pip freeze > requirements.txt npm install express npm ci # exact versions from package-lock.json - pass
- A statement that does nothing. Python needs a body after a colon, so pass fills the gap while you sketch a function or class.Python
class Placeholder: pass def todo(): pass - Pipe
- The | operator in a shell: it connects the output of one command to the input of the next, so small tools compose into pipelines.How the Terminal WorksBash
cat data/team.csv | cut -d , -f 2 | sort | uniq -c - Pointeralso: reference, memory
- A variable holding a memory address. C and C++ use them explicitly; most other languages hide them behind references. Getting them wrong is the source of many security bugs.CC++Rust
- Primary keyalso: foreign key
- The column (or columns) that uniquely identifies each row in a database table, usually an auto-incrementing id. Foreign keys in other tables point at it.SQL
- Promise
- A JavaScript object representing a value that will arrive later. It resolves with a result or rejects with an error; await unwraps it.JavaScript
const wait = ms => new Promise(resolve => setTimeout(resolve, ms)) async function main() { await wait(100) console.log('done') } main() - Property
- A method that is accessed like an attribute, declared with @property. It lets a class compute or validate a value while callers write obj.value without parentheses.Python
class Circle: def __init__(self, r): self.r = r @property def area(self): return 3.14159 * self.r ** 2 print(Circle(2).area) # no parentheses - Prototype
- The object a JavaScript object delegates to when a property is missing. class syntax builds prototype chains for you; instance.method looks up Class.prototype.method.JavaScript
class Dog { bark() { return 'woof' } } const d = new Dog() console.log(Object.getPrototypeOf(d) === Dog.prototype) // true
R
- Recursion
- A function that calls itself on a smaller version of the problem until a base case stops it. Natural for trees and nested data; a loop is better for flat sequences.PythonData Structures & Algorithms
def factorial(n): if n <= 1: # base case return 1 return n * factorial(n - 1) print(factorial(5)) - Redirection
- Sending a command's output to a file instead of the screen: > overwrites, >> appends, 2> captures errors, < feeds a file in as input.How the Terminal WorksBash
ls -l > files.txt echo "done" >> files.txt cat missing 2> errors.log sort < names.txt - Regular expressionalso: regex
- A pattern language for matching text: \d+ means "one or more digits". Available in every language; excellent for validation and extraction, terrible for parsing nested structures.PythonJavaScript
import re print(re.findall(r"\d{4}-\d{2}-\d{2}", "joined 2024-01-15, left 2026-05-26")) - Repositoryalso: repo
- A project tracked by Git, including its full history. A remote repository on GitHub is the shared copy everyone pushes to and pulls from.Git
- Return
- Ends a function and hands a value back to the caller. A function with no return (or a bare return) gives back None in Python and undefined in JavaScript.PythonJavaScript
def sign(n): if n < 0: return "negative" return "non-negative" # unreachable when n < 0
S
- Scope
- The region of code where a name is visible. Variables defined inside a function are local to it; module-level names are global. Blocks create scope in JavaScript (let/const) but not in Python.PythonJavaScript
total = 0 # module scope def add(n): result = total + n # result is local to add return result print(add(5)) # print(result) -> NameError: only exists inside add - self
- The conventional name for the first parameter of a method: the instance the method was called on. Python passes it automatically; you must declare it.Python
class Person: def __init__(self, name): self.name = name # store on this instance def greet(self): return f"Hi, {self.name}" Person("Ada").greet() # Python passes the instance as self - Set
- An unordered collection of unique values with fast membership tests and set algebra: union, intersection, difference.Python
design = {"Ada", "Maya", "Leo"} support = {"Maya", "Sam"} print(design & support, design | support, "Ada" in design) - Shellalso: bash, zsh, terminal
- The program that reads your typed commands and runs them: bash and zsh on Unix, PowerShell on Windows. Shell scripts automate sequences of commands.BashPowerShellHow the Terminal Works
ls -l | grep ".txt" | wc -l echo "$HOME" cat missing.txt 2> errors.log - Slice
- A sub-sequence taken with start:stop:step inside square brackets. The stop index is excluded; negative steps reverse.Python
s = "programming" print(s[0:7], s[-3:], s[::2], s[::-1]) - Spread and rest
- The same three dots doing opposite jobs. Spread expands an array or object into pieces; rest collects leftover pieces into an array or object.JavaScriptTypeScript
const merged = { ...defaults, ...overrides } // spread function sum(...nums) { // rest return nums.reduce((t, n) => t + n, 0) } - SQL
- Structured Query Language: how you ask a relational database questions and change its data. SELECT reads, INSERT/UPDATE/DELETE write, JOIN combines tables.SQL
SELECT name, grade FROM students WHERE age = 17 ORDER BY grade DESC LIMIT 3; - Stackalso: queue, call stack
- A last-in, first-out collection: push adds to the top, pop removes from it. The call stack tracks which functions are running; a stack overflow is recursion that never stopped.Data Structures & AlgorithmsPython
stack = [] stack.append("a") # push stack.append("b") print(stack.pop()) # b — last in, first out - Standard libraryalso: stdlib
- The modules that ship with the language itself: math, json, re, datetime, pathlib and hundreds more in Python. No installation needed — just import.Python
import json, re, datetime, pathlib, collections, itertools, statistics print(statistics.median([3, 1, 2])) - Strict equality
- The === operator compares value and type without converting anything. Loose == coerces first, which makes 0 == "" true. Use === by default.JavaScriptTypeScript
console.log(0 == '', 0 === '') // true false console.log(null == undefined, null === undefined) // true false - String
- A sequence of characters — text. Immutable in Python and JavaScript; every method returns a new string. f-strings and template literals embed values inside them.PythonJavaScript
name = "Maya" print(name.upper(), name[0], len(name), f"{name} from Leeds") - Subqueryalso: CTE, common table expression
- A SELECT nested inside another statement. It can return one value, a list for IN, or a whole derived table in FROM. A CTE (WITH ...) names one so the query reads in order.SQL
WITH big AS ( SELECT customer_id FROM orders WHERE total > 500 ) SELECT name FROM customers WHERE id IN (SELECT customer_id FROM big);
T
- Template literal
- A JavaScript string in backticks that can span lines and embed expressions with ${...}. The counterpart of Python's f-string.JavaScriptTypeScript
const name = 'Maya' console.log(`${name} has ${2 + 3} books`) - Testalso: unit test, pytest
- Code that runs other code and checks the result. Automated tests catch regressions the moment they happen; pytest (Python) and Vitest (JavaScript) are the common runners.PythonJavaScript
def add(a, b): return a + b def test_add(): assert add(2, 3) == 5 assert add(-1, 1) == 0 # run with: pytest - this
- In JavaScript, the object a function was called on — decided at call time, not where the function was written. Arrow functions capture the surrounding this instead.JavaScript
const timer = { ticks: 0, start() { setTimeout(() => this.ticks++, 10) } // arrow keeps this } - Transaction
- A group of SQL statements that succeed or fail together. BEGIN starts it, COMMIT makes it permanent, ROLLBACK undoes it. This is how a bank transfer never loses money halfway.SQL
BEGIN TRANSACTION; UPDATE accounts SET balance = balance - 100 WHERE id = 1; UPDATE accounts SET balance = balance + 100 WHERE id = 2; COMMIT; - Tuple
- An immutable ordered sequence, written with parentheses (or just commas). Good for fixed records, multiple return values and dictionary keys.Python
point = (3, 4) x, y = point # unpacking def min_max(xs): return min(xs), max(xs) # returns a tuple - Typealso: type hint, static typing, dynamic typing
- The kind of a value: integer, string, list, function. Static languages check types before running; dynamic ones check as they go. Type hints let Python have both.PythonTypeScript
print(type(42), type("42"), type([])) def double(n: int) -> int: # a type hint return n * 2 - Type hintalso: annotation
- An annotation that states the intended type of a variable, parameter or return value. Python ignores it at runtime; tools such as mypy, pyright and your editor use it to catch mistakes early.PythonTypeScript
def total(prices: list[float], tax: float = 0.0) -> float: return sum(prices) * (1 + tax)
U
- Union type
- A type that is one of several alternatives, written with |. Discriminated unions add a literal tag so the compiler can narrow inside a switch.TypeScript
type Payment = | { kind: 'card'; last4: string } | { kind: 'cash' } function label(p: Payment) { return p.kind === 'card' ? `Card ${p.last4}` : 'Cash' }
V
- Variable
- A name bound to a value. Assignment binds; later reads look the value up. In Python the name has no fixed type, so the same name can hold different kinds of value over time.PythonJavaScript
pages = 12 pages = pages + 3 # rebind the name to a new value name, age = "Maya", 28 # two at once - Virtual environmentalso: venv, pip
- A private, per-project Python installation so different projects can use different package versions without conflict. Created with python -m venv .venv and activated in the shell.Python
python3 -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate pip install requests pip freeze > requirements.txt
W
- WebAssemblyalso: wasm
- A binary instruction format browsers can run at near-native speed. It is how this site runs a full Python interpreter and SQLite inside your browser tab.How the Internet WorksCompilers
- Window function
- A SQL function that computes over a set of related rows — a running total, a rank within a group — while keeping every row in the output. Written with OVER (PARTITION BY ... ORDER BY ...).SQL
SELECT name, department, salary, RANK() OVER (PARTITION BY department ORDER BY salary DESC) AS dept_rank FROM employees; - with statementalso: context manager
- Runs a block with a resource that is set up before and cleaned up after, no matter what — files are closed, locks released. The resource is a context manager.Python
with open("notes.txt") as f: text = f.read() # f is closed here, even if read() raised
Y
- yield
- Turns a function into a generator: each yield hands out one value and pauses, resuming from the same spot on the next request.Python
def evens(): n = 0 while True: yield n n += 2 g = evens() print(next(g), next(g), next(g))