+1

even if I understand since from time to time I need to add a new local  
to modify an
arg. Now I have the impression that when I have to do that it may be  
better to
have an instance variable instead.

Stef

On Dec 24, 2008, at 11:11 AM, Michael Rueger wrote:

> On Wed, Dec 24, 2008 at 10:58 AM,  <[email protected]> wrote:
>
>> This is a language design point. Is the convenience of knowing that
>> an argument is never modified worth more than the convenience of  
>> being
>> able to modify the argument?
>
> What really is the convenience of modifying an argument? Having not to
> think up another name? I never understood this argument especially if
> you need to use the original value of the argument in several places.
>
> IMHO it is all about how much  mental load reading code imposes (the
> readability Stephane mentioned).
>
> If we allow modification of arguments, then I can't just look at code
> and "know" that the argument has the value it was passed.
>
> Same with shadowed variables, a truly horrible idea. I look at code
> and see an inst var, but fail to notice it is also an argument or
> method var and I'm off being confused about what the code does.
>
> Same for upper/lowercase conventions, let alone uppercase method  
> names.
>
> Breaking the kind of conventions makes you think harder about what
> code does and that distracts you from what you really trying to do. Or
> should be doing ;-)
>
> Michael
>
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>


_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to