User Tools

Site Tools


atelier:coding_gouter:ppour:variables

This is an old revision of the document!


Variables

The variables is things where you can have some values, like numbers, text, maybe more complex things like pictures, files, links, video, etc. You can say that anything can be stored in variables, but usually there following ways how variables are used.

Role Description
Fixed value Initialized once and not changed thereafter.
Stepper Steps through a systematic, predictable succession of values (e.g., a loop counter).
Walker Traverses a data structure element by element, where each new value depends on the previous position.
Follower Always receives the previous value of some other variable (e.g., prev = current before current is updated).
Most-recent holder Holds the latest value encountered in an unpredictable series, typically successive inputs.
Most-wanted holder Holds the best value found so far (e.g., maximum or minimum).
Gatherer Accumulates the combined effect of individual values (e.g., running sum or count).
One-way flag A two-valued variable that, once changed from its initial value, never reverts (e.g., an error flag set to True and never reset).
Temporary Holds a value for a very short time only, most commonly in a swap operation.
Organizer A collection used only to rearrange its elements (e.g., sorted in place), never to add or remove them.
Container A collection whose elements are added and/or removed during the computation.

We will eventually show each of this usage during the course.

atelier/coding_gouter/ppour/variables.1776870480.txt.gz · Last modified: by Andrii Kurdiumov