var
Var is short for variable. People use it to mean something that changes or differs, like weather or prices. It can also mean a particular thing in a particular case.
What a model may hear
- variable declaration JavaScript, programming
- create a function-scoped variable with hoisting, not block-scoped like let or const
- variance statistics, machine learning
- measure spread or dispersion in data, or trade bias for variance in models
- value at risk finance
- calculate maximum expected loss at a confidence level for a portfolio
- virtual address register computer architecture
- refer to memory mapping hardware in CPU design
- /var directory Unix/Linux systems
- expect variable data files like logs, spools, and temporary runtime data
Where people and models part ways
“Store this in var”
Meant: Save this value somewhere
May be taken as: Declare a JavaScript variable with outdated scoping rules
Say instead: “Save this value for later”
“Check the var”
Meant: See if the number changed
May be taken as: Look for a variance calculation or inspect /var/log
Say instead: “Check whether this value has changed”
“What's the var of this set?”
Meant: How much do these numbers differ?
May be taken as: Compute statistical variance instead of simple range or standard deviation
Say instead: “How spread out are these numbers?”
“Clean up the var”
Meant: Remove old changing data
May be taken as: Delete system files in /var or clear all variables
Say instead: “Remove old temporary data files”
Tips
- Say 'variable' in full when you mean programming storage
- Say 'variance' in full for statistics to avoid finance or ML confusion
- Say 'spread' or 'range' if you do not need the technical statistical measure
- Specify the language when asking about code behavior: 'in JavaScript, what does var do?'
- Use 'changing value' or 'fluctuating amount' for everyday talk about things that vary
Often confused with
- let
- block-scoped declaration, preferred in modern JavaScript
- const
- declaration that cannot be reassigned
- volatile
- memory that may change unexpectedly, not just any variable
- parameter
- input to a function, not a stored changing value
- attribute
- property of an object, often fixed in structure
- variant
- a distinct version or form, not a changing quantity