Re: commabominations
- Posted by George Henry <ghenryca at HOTMAIL.COM> Jan 21, 2001
- 440 views
Okay, this is interesting. <snip> Actually, this is what I normally do. Not global, but local to the module. I define my dummies at the start of my code. Then there is no need for the extra declarations. Which, maybe I'm wrong, but if they are declared in a routine, aren't they defined dynamically? This would eat up speed, declaring the same variable everytime that paricular routine is called? This is my reasoning for having a universal dummy var </snip> Actually, according to my recollection/knowledge, although calling a routine involves some overhead, it doesn't matter how many local variables you declare inside the routine - there is no additional overhead for declaring variables. That MIGHT depend on the implementation, i.e. I am not 100% sure that would be true in an interpreted language. <snip> >What I would be particularly concerned about would be a global variable's retaining a value from one part of a program, that could be inadvertently, and almost certainly erroneously, accessed elsewhere. Never do that. I KNOW that is a NO-NO. use globals as least often as possible. Even if we DID have namespacing conventions. </snip> Well, good for you, but a language design must take into account programmers (users) of all kinds, and not make it too easy for (relative) ignoramuses/novices to hang themselves / shoot themselves in the foot. <snip> I think What I was trying to say is that there should be better standardization of these DUMB vars. This is why I had suggested adding them to EU. People would be much more likely to stick to standards, if it were implicit to the langauge. </snip> You actually want a variable named "junk" to be a part of the language? This idea seems strange to me. Wouldn't it be better to enable programmers to declare their own types and names (as in all other times and places), just making it more convenient to do so, and giving them an incentive for consistency? If Rob added "junk" to the language itself, there would be just as many people who wouldn't like the NAME itself, and therefore would declare their own "temp" or "foo" or whatever, as weould use "junk." Betcha. (I might be one of them.) An additional reason for letting users roll their own junk variables is that you never know exactly how many will be needed, what types they should be, etc. It would seem kind of arbitrary, deciding that "programmers in this language will probably need an object/atom/integer/sequence named junk/temp/foo/whatsit" - see what I mean? What I am trying to do is help refine your idea. Let's also see how this dovetails with my original concern about commas.... I don't think it does. I still want a syntactic way to avoid having the last item in a list be DIFFERENT from all the others (i.e. not being followed by a comma). That really has nothing directly to do with issues relating to utility variables. Utility variables entered the discussion because they are a (not very acceptable, IMO) way of handling the comma problem - whether or not a variable is needed at that point for any other purpose. George _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com