| Thread overview | ||||||
|---|---|---|---|---|---|---|
|
October 25, 2008 Roles of Variables | ||||
|---|---|---|---|---|
| ||||
Quoted from the article: "Roles of Variables and Learning to Program" by Jorma Sajaniemi http://cs.joensuu.fi/~saja/var_roles/abstracts/didinf05.html Roles of variables in novice-level procedural programming: *Fixed value: A variable initialized without any calculation and not changed thereafter *Stepper: A variable stepping through a systematic, predictable succession of values *Follower: A variable that gets its new value always from the old value of some other variable *Most-recent: A variable holding the latest value encountered in going through a holder succession of values, or simply the latest value obtained as input *Most-wanted: A variable holding the best or otherwise most appropriate value holder encountered so far *Gatherer: A variable accumulating the effect of individual values *Transformation: A variable that always gets its new value with the same calculation from values of other variables *One-way flag: A two-valued variable that cannot get its initial value once its value has been changed *Temporary: A variable holding some value for a very short time only *Organizer: An array used for rearranging its elements I like that list. Even if it's not complete it covers many important cases. The "Fixed value" case is so important that in Java the language gives you an attribute to specify it. So if certain languages have an attribute to specify the fist case, I ask myself if in a language it can be useful to have attributes to specify other of those cases. I think not... Bye, bearophile | ||||
October 25, 2008 Re: Roles of Variables | ||||
|---|---|---|---|---|
| ||||
Posted in reply to bearophile | On Sat, 25 Oct 2008 22:02:42 +0400, bearophile <bearophileHUGS@lycos.com> wrote:
> Quoted from the article: "Roles of Variables and Learning to Program" by Jorma Sajaniemi
> http://cs.joensuu.fi/~saja/var_roles/abstracts/didinf05.html
>
> Roles of variables in novice-level procedural programming:
> *Fixed value: A variable initialized without any calculation and not changed thereafter
> *Stepper: A variable stepping through a systematic, predictable succession of values
> *Follower: A variable that gets its new value always from the old value of some other variable
> *Most-recent: A variable holding the latest value encountered in going through a holder succession of values, or simply the latest value obtained as input
> *Most-wanted: A variable holding the best or otherwise most appropriate value holder encountered so far
> *Gatherer: A variable accumulating the effect of individual values
> *Transformation: A variable that always gets its new value with the same calculation from values of other variables
> *One-way flag: A two-valued variable that cannot get its initial value once its value has been changed
> *Temporary: A variable holding some value for a very short time only
> *Organizer: An array used for rearranging its elements
>
> I like that list. Even if it's not complete it covers many important cases.
>
> The "Fixed value" case is so important that in Java the language gives you an attribute to specify it. So if certain languages have an attribute to specify the fist case, I ask myself if in a language it can be useful to have attributes to specify other of those cases. I think not...
>
> Bye,
> bearophile
Nice indeed!
| |||
October 25, 2008 Re: Roles of Variables | ||||
|---|---|---|---|---|
| ||||
Posted in reply to bearophile | bearophile wrote:
> Quoted from the article: "Roles of Variables and Learning to Program" by Jorma Sajaniemi
> http://cs.joensuu.fi/~saja/var_roles/abstracts/didinf05.html
>
> Roles of variables in novice-level procedural programming:
> *Fixed value: A variable initialized without any calculation and not changed thereafter *Stepper: A variable stepping through a systematic, predictable succession of values *Follower: A variable that gets its new value always from the old value of some other variable *Most-recent: A variable holding the latest value encountered in going through a holder succession of values, or simply the latest value obtained as input *Most-wanted: A variable holding the best or otherwise most appropriate value holder encountered so far *Gatherer: A variable accumulating the effect of individual values *Transformation: A variable that always gets its new value with the same calculation from values of other variables *One-way flag: A two-valued variable that cannot get its initial value once its value has been changed *Temporary: A variable holding some value for a very short time only *Organizer: An array used for rearranging its elements
>
> I like that list. Even if it's not complete it covers many important cases.
>
> The "Fixed value" case is so important that in Java the language gives you an attribute to specify it. So if certain languages have an attribute to specify the fist case, I ask myself if in a language it can be useful to have attributes to specify other of those cases. I think not...
>
> Bye,
> bearophile
I'm sure that list is being used in some CS 101 class and the tests all have "label the type of each variable". The day the test is returned there will then be 100 unhappy students arguing that every variable can fall into multiple categories.
| |||
October 28, 2008 Re: Roles of Variables | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Robert Fraser | Robert Fraser wrote: > bearophile wrote: >> Quoted from the article: "Roles of Variables and Learning to Program" by Jorma Sajaniemi >> http://cs.joensuu.fi/~saja/var_roles/abstracts/didinf05.html >> >> Roles of variables in novice-level procedural programming: >> *Fixed value: A variable initialized without any calculation and not changed thereafter *Stepper: A variable stepping through a systematic, predictable succession of values *Follower: A variable that gets its new value always from the old value of some other variable *Most-recent: A variable holding the latest value encountered in going through a holder succession of values, or simply the latest value obtained as input *Most-wanted: A variable holding the best or otherwise most appropriate value holder encountered so far *Gatherer: A variable accumulating the effect of individual values *Transformation: A variable that always gets its new value with the same calculation from values of other variables *One-way flag: A two-valued variable that cannot get its initial value once its value has been changed *Temporary: A variable holding some value for a very short time only *Organizer: An array used for rearranging its elements >> >> I like that list. Even if it's not complete it covers many important cases. >> >> The "Fixed value" case is so important that in Java the language gives you an attribute to specify it. So if certain languages have an attribute to specify the fist case, I ask myself if in a language it can be useful to have attributes to specify other of those cases. I think not... >> >> Bye, >> bearophile > > I'm sure that list is being used in some CS 101 class and the tests all have "label the type of each variable". The day the test is returned there will then be 100 unhappy students arguing that every variable can fall into multiple categories. Pretty much, yeah, and rightly so. -- Bruno Medeiros - Software Developer, MSc. in CS/E graduate http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply