Programming Fundamentals
Programming fundamentals are the core building blocks used to write any computer program, in any language: variables that hold data, control flow that decides what runs and when, and functions that break logic into reusable pieces. This topic covers that shared vocabulary and mental model so you can read and write code before specializing in one language or paradigm.
itSoftware engineering | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — Programming Fundamentals
Programming is the business of writing instructions precise enough for a computer to carry out. That is less mystical than it sounds and more literal than it first appears. The computer is not being difficult when it follows the words rather than the intention; it has only been given words. The useful response is to make the steps visible.
The central creature here is a variable, a name bound to a value. Assignment changes that binding. It is not a tiny declaration of eternal mathematical truth, which is fortunate, because a running total would otherwise have a very awkward afternoon. A value also has a type, so numbers, strings, and booleans can support different operations without everyone pretending that text can be divided by seven.
Then comes control flow, the arrangement that decides what runs and when. A conditional selects the first true branch. A loop repeats a block, either while a condition remains true or once for each item in a collection. If a result is puzzling, trace the state through one loop iteration. A program is a machine for producing changes over time; staring at the final output alone is like reading a mystery from the last page and blaming the book for being brief.
A function gives a sequence of steps a name, input through parameters, and sometimes a result through a return value. Its local scope keeps the names made for one call from wandering into another call's business. That boundary matters. Heavy reliance on global names makes a program harder to follow because any function might change them. Keep a small piece of logic together, then call it with a different argument when the job repeats.
Values also travel in groups. A list keeps an ordered sequence. A tuple keeps a fixed grouping. A dictionary stores values under keys. The catch is mutability: assigning a list to another name does not copy it. Both names can reach the same underlying data, so an update through one is visible through the other. The surprise is not that the list changed; it is that the second name was never a separate list in the first place.
For a working map, open the Intro when a term needs its full explanation, the Slides when relationships need a compact picture, and the Cheatsheet when you need the comparison at hand. Then use the practice reference to trace state before writing code, and build the score-summary exercise to make the pieces cooperate. After that, paradigms explain larger organization, algorithms explain better procedures, and testing explains how to establish that a program works rather than merely runs.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://docs.python.org/3/tutorial/introduction.html
Supports
- The equal sign assigns a value to a variable; using an undefined name is an error
- Multiple assignment evaluates all right-hand-side expressions before any name is rebound, which is what allows swapping two variables and updating a running pair of values without a temporary variable
- Integers are whole numbers and floats have a fractional part; division (/) always returns a float, while floor division (//) returns an integer
- Strings are immutable, support indexing (0-based) and slicing, and can be concatenated
- Assigning a mutable value such as a list to a second name creates a reference to the same underlying data rather than a copy, so a mutation through one name is visible through the other
- Lists are mutable ordered collections supporting indexing, slicing, concatenation, item assignment, and methods such as append
- The tutorial's "First Steps Towards Programming" section shows a while loop computing a Fibonacci series using simultaneous multiple assignment (a, b = b, a+b)
- https://docs.python.org/3/tutorial/controlflow.html
Supports
- An if statement can be followed by zero or more elif clauses and an optional else clause; branches are evaluated in order and only the first true branch runs
- A for statement iterates over the items of a sequence in order
- break exits the innermost enclosing loop and continue skips to the loop's next iteration
- The def keyword introduces a function definition; a function with no explicit return statement returns None
- Function parameters are placeholders in the definition; the values supplied at a call site are arguments
- Variable name resolution inside a function follows the local, enclosing, global, built-in (LEGB) scope order
- Default argument values are evaluated once, at the point the function is defined, not on every call — so a mutable default (such as a list) that is mutated persists that mutation across later calls that rely on the default
- https://docs.python.org/3/tutorial/datastructures.html
Supports
- Tuples are an immutable sequence type; once created, their elements cannot be reassigned
- Dictionaries store values indexed by keys rather than by position, and dictionary keys must be immutable (such as strings, numbers, or tuples of immutable elements) — a list cannot be used as a key
- List methods such as append add items in place and typically return None rather than a new list
- https://docs.python.org/3/tutorial/classes.html
Supports
- A namespace maps names to objects; Python has local, enclosing-function, global (module), and built-in namespaces, searched in that order
- Assignments inside a function create a local binding by default unless the name is declared global or nonlocal
- https://docs.python.org/3/tutorial/errors.html
Supports
- A syntax error is detected while parsing, before the program executes, and means the code is not valid
- An exception is an error detected during execution of code that is otherwise syntactically valid, such as ZeroDivisionError or a missing dictionary key
- A try/except statement lets a program catch a specific exception type and respond instead of terminating
- https://xlinux.nist.gov/dads/HTML/recursion.html
Supports
- Recursion is an algorithmic technique where a function, to accomplish a task, calls itself with some part of the same task
- A recursive function requires a base case to terminate; without one, it keeps calling itself indefinitely
- https://cs50.harvard.edu/x/
Supports
- CS50x is Harvard's introduction to computer science, assumes no prior programming background, and explicitly teaches functions, variables, conditionals, loops, arrays, and computational thinking
- The course progresses from C to Python and other languages, including web technologies
- https://ocw.mit.edu/courses/6-0001-introduction-to-computer-science-and-programming-in-python-fall-2016/
Supports
- MIT 6.0001 is an introductory course using Python for students with little to no prior programming experience, providing lecture videos, problem sets, and solutions
- https://ocw.mit.edu/courses/6-0001-introduction-to-computer-science-and-programming-in-python-fall-2016/pages/syllabus/
Supports
- The course syllabus covers branching and iteration, decomposition and functions, tuples, lists, aliasing, mutability and cloning, recursion, dictionaries, testing, debugging, exceptions and assertions, and an introduction to object-oriented programming
- https://docs.python.org/3/tutorial/index.html
Supports
- The Python Tutorial is the official, authoritative introduction to the language's syntax and built-in data types, including control flow and function definitions
- https://xlinux.nist.gov/dads/terms.html
Supports
- NIST's Dictionary of Algorithms and Data Structures is a dictionary of algorithms, techniques, and data structures, cross-referenced by term
- https://exercism.org/
Supports
- Exercism is a free platform offering practice exercises across 83 programming languages, from beginner to advanced, with free human mentoring on submitted solutions
- https://www.codewars.com/
Supports
- Codewars offers short coding challenges ("kata") ranked from beginner to expert across 55+ languages, solved in-browser using test cases, with solutions comparable after completion
- https://github.com/freeCodeCamp/freeCodeCamp
Supports
- freeCodeCamp is a free, open-source curriculum to learn math, programming, and computer science, offering free certifications on completion
- https://github.com/ossu/computer-science
Supports
- OSSU Computer Science is a free, self-taught computer science curriculum built from online course material, structured like an undergraduate CS major, whose intro sequence covers computation, imperative programming, and basic data structures
- https://www.codecademy.com/catalog/language/python
Supports
- Codecademy offers an interactive, in-browser Python curriculum with free introductory courses alongside paid skill and career paths
- https://www.ibm.com/history/fortran
Supports
- IBM created Fortran in 1954 and commercially released it in 1957; it moved programming away from machine-language instructions toward a higher-level notation compiled for the IBM 704.
- https://archive.computerhistory.org/resources/text/algol/ACM_Algol_bulletin/1064069/frontmatter.pdf
Supports
- The 1960 ALGOL 60 report documents a language with identifiers, arithmetic and Boolean expressions, assignment statements, and conditional statements.
- https://www.dartmouth.edu/basicfifty/basic.html
Supports
- Dartmouth records that BASIC and its time-sharing system ran on May 1, 1964, and that BASIC was designed to introduce beginners to programming.
- https://www.cs.utexas.edu/~EWD/transcriptions/EWD02xx/EWD215.html
Supports
- Dijkstra's 1968 article argued that unrestricted goto statements make program progress difficult to describe and favored conditional and repetitive clauses that preserve a manageable control structure.
- https://www.cs.utexas.edu/~EWD/transcriptions/EWD02xx/EWD273.html
Supports
- Dijkstra describes programming as designing computations and argues that sequencing rules should keep the mapping between program progress and computation progress understandable.
- https://www.nokia.com/bell-labs/about/dennis-m-ritchie/chist.html
Supports
- Dennis Ritchie records that C emerged during 1969–1973, with its most creative period in 1972, as a system implementation language for Unix.
- https://www.stroustrup.com/hopl2.pdf
Supports
- Bjarne Stroustrup's history records the first use of the name C++ in a 1983 publication after the C with Classes work.
- https://legacy.python.org/doc/essays/ppt/jpf001/tsld006.htm
Supports
- Python.org records Python's first public release in February 1991.
- https://education.oracle.com/file/general/4955_BriefHistoryOfJava_7.pdf
Supports
- Oracle's Java history records Java's public debut in 1995.
- https://download.oracle.com/otndocs/jcp/jls1-spec/license.html
Supports
- Oracle records the first edition of the Java Language Specification as a final release in August 1996.
- https://code.visualstudio.com/
Supports
- Visual Studio Code is an open-source code editor with an integrated terminal, facilities to run and debug code, and extensions for major programming languages.
- https://www.jetbrains.com/pycharm/
Supports
- PyCharm offers Python support, code completion, inspections, a debugger, and a free tier with a time-limited Pro trial.
- https://replit.com/pricing
Supports
- Replit offers a free Starter plan alongside paid Core and Pro plans.
- https://github.com/features/codespaces
Supports
- GitHub Codespaces provides hosted development environments; individual GitHub accounts include free monthly usage before pay-as-you-go charges apply.
- https://www.codecademy.com/pricing
Supports
- Codecademy provides an always-free Basic plan and paid Plus and Pro plans, including courses, quizzes, and projects at the paid tiers.
