Calling Conventions and Pass By Reference
simon at thegestalt.org
Tue Sep 2 20:13:12 BST 2008
On Tue, Sep 02, 2008 at 09:43:32PM +0300, Yuval Kogman said:
> but conversly you have:
> my $x = 3;
> my $y = $x;
> $y; # 4
> IIRC python works like that.
There was an interesting paper a while back [goes off to find it ...
about the cognitive models used when learning to program.
Students are asked questions like
What is the value of c?
Now what is the value of c?
For the first example, the answer is pretty clearly 14 but for the
second the answer could arguably be either 14 *or* 24.
I think most programmers are going to go with 14 but I wonder if a
totally pass by reference language would cause effects that would mean
that you would get used to it being 24.
More importantly - if that happened would it even matter? Would old
programmers have a problem with it but new programmers just adapt?
More information about the london.pm