digitalmars.D - Roles of Variables
- bearophile (17/17) Oct 25 2008 Quoted from the article: "Roles of Variables and Learning to Program" by...
- Denis Koroskin (3/34) Oct 25 2008 Nice indeed!
- Robert Fraser (5/26) Oct 25 2008 I'm sure that list is being used in some CS 101 class and the tests all
- Bruno Medeiros (5/42) Oct 28 2008 Pretty much, yeah, and rightly so.
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
Oct 25 2008
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, bearophileNice indeed!
Oct 25 2008
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, bearophileI'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.
Oct 25 2008
Robert Fraser wrote:bearophile wrote:Pretty much, yeah, and rightly so. -- Bruno Medeiros - Software Developer, MSc. in CS/E graduate http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#DQuoted 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, bearophileI'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.
Oct 28 2008