FirstHack Learn
Log in Sign up free

Glossary

The words everyone uses and nobody defines.

Algorithm

A step-by-step method for solving a problem. A recipe is an algorithm.

Argument

A value you pass into a function when calling it. The function receives it as a parameter.

Array

A numbered collection of values stored together. Position 0 is the first one, not position 1.

Bug

Code doing something other than what you intended. Normal, constant, not a sign of failure.

Compile error

The compiler could not understand your code, so nothing ran at all. Usually a typo or a missing semicolon.

Compiler

A program that turns your source code into machine code before it runs. C, C++ and Java use one.

Debugging

Finding out why code does the wrong thing. Mostly printing values and narrowing down where reality diverges from your expectation.

Function

A named block of code you can run repeatedly. Takes inputs, usually returns a value.

IDE

Integrated Development Environment — an editor with extras like error highlighting and a debugger built in.

Index

The position of an item in an array or string. Counting starts at 0 in almost every language.

Infinite loop

A loop whose condition never becomes false, so the program never stops. The most common cause of a timeout.

Interpreter

Runs your code line by line rather than compiling it first. Python uses one.

Iteration

One pass through a loop. Also just means "repeating".

Library

Code someone else wrote that you can use instead of writing your own.

Loop

Code that repeats. for when you know how many times, while when you do not.

Off-by-one error

Looping one time too many or too few — usually < where you needed <=. Extremely common.

Parameter

The named placeholder in a function definition that receives an argument.

Recursion

A function that calls itself. Needs a base case, or it never stops.

Return

Sending a value back out of a function to whoever called it.

Runtime error

The code compiled fine but crashed while running — dividing by zero, reading past the end of an array.

Scope

Where a variable exists. A variable created inside a function usually does not exist outside it.

Semantic error

Code that runs perfectly and produces the wrong answer. Harder to find than a crash.

Stack trace

The list of function calls that led to a crash. Read it from the bottom up — the last line is usually where it broke.

Syntax

The grammar rules of a language. Break them and you get a compile or syntax error.

Time complexity

How much slower an algorithm gets as the input grows. Written as Big-O, like O(n) or O(n²).

Variable

A named box holding a value that can change.