Paul Johnson wrote: > On Sat, Apr 03, 2004 at 11:53:59AM -0800, R. Joseph Newton wrote: > > > Paul Johnson wrote: > > > > > $_ = "Leave me alone!"; > > > $s = "0"; > > > > Better yet: > > $lower_or-mixed_case_string = 'o'; > > I worry that you may have missed the point of the example, which was the > value of the variable being passed into the to_upper subroutine. That > has since been discussed elsewhere in this thread, but you could argue > that I should have been more explicit.
Not really. Ithought you addressed that quite well. > > A couple of interesting points he makes on variable name length are that > the length of a variable name should reflect the scope of the variable. > A short variable name is fine in a restricted scope. For a larger > scope, use a longer name. I always start global variables with a > capital letter. I can see how the meaning of a variable is less likely to be lost in a narrow scope. I still think it is better to use the language to express meaning as clearly and naturally as possible. In my view, the biggest stumbling block for beginners is a sort of techno-fetishism, almost a subconcious belief that there is some gain in efficiency from saving keystrokes. Meantime, they get distracted from the actual flow of logic. I know my examples are a bit exxagerated, but I do think beginners will benefit by using a more plain-language approach. > > > He also mantions that i is often a very good name for a loop variable in > a restricted scope. Absolutely. There are a few, like i for the loop iterator, and x and y for Cartesian coordinates, that are so uniquitous as to be immediately identifiable. I would still sugest that literals should be kept to very familiar mathematical constructs. > The first edition was very good. The second looks like it will be even > better. Well, if my income ever allows for buying books, I will have to take a look. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>