Content deleted Content added
m Robot-assisted disambiguation (you can help!): C programming language |
m Robot-assisted disambiguation (you can help!): Haskell programming language |
||
Line 3:
Local variables are special because in most languages they are stored on the [[call stack]] directly. This means that when a [[Recursion (computer science)|recursive function]] calls itself, local variables in each instance of the function are given separate memory [[address space]]. Hence variables of this scope can be declared, written to, and read, without any risk of [[Side-effect (computer science)|side-effects]].
Some advocate that all variables should be of local scope to avoid issues with [[Side-effect (computer science)|side-effects]]. In other cases, programming paradigms and languages themselves, such as the [[functional programming]] paradigm and the [[Haskell (programming language)|Haskell]] language require all "variables" (or the closest equivalent under that paradigm to variables) to be of local scope, and the functionality of the program is achieved only by passing local variables from one function to another.
==Static local variables==
|