Glossary coding Term Page
Function
A named block of code with a clear input-output contract
Core Idea
A function is a reusable block of code that takes input, performs work, and returns a result. It lets you give behavior a name instead of copying the same logic repeatedly, which makes programs easier to explain, test, and extend.
The key is to keep the input-output contract explicit. Once that is clear, patterns such as callbacks or larger file boundaries such as modules become much easier to reason about.
Why It Matters Here
Mathbong uses functions as the shared idea behind JavaScript array methods, Python reuse, C function declarations, and Rust signatures. The syntax changes by language, but the habit of reading "input -> work -> output" stays the same.