anything like C++ references?

Dave Brueck dave at pythonapocrypha.com
Tue Jul 15 16:07:55 CEST 2003


On Tuesday 15 July 2003 02:18 am, Stephen Horne wrote:
> >Why don't you respect the possibility of a language that is *designed* to
> > deal with entities and relationships in ways you are not used to? ;-)
>
> Basically, because I've seen too many threads started by confused
> people who've made a mistake because of this, and because I've made
> the mistake an annoying number of times myself.

But the problem is that you're inferring from those threads that this is a 
widespread problem. It is not. Compared to the total number of people using 
Python, this issue isn't brought up that often (especially compared to, say, 
"can I make an EXE of a Python app?").

Also, in *every* case it is someone "thinking in C" rather than Python. Once 
they reset their brains to the way Python does things, then the problem goes 
away, if they had a problem with it in the first place. This is not the same 
thing as people "just dealing with it" or forcing themselves to think in and 
odd way but a slightly *different* way.

At most I'd concede that this is a documentation problem, but nothing more - 
for many, many people the way Python does it works terrifically well. I just 
don't see how having to adjust your thinking a little when using a different 
language implies the new language isn't doing the right thing, especially 
when the new way works so well in practice.

> It's not just about theory - it's about peoples intuitions about how
> things should work.

Obviously it can't match everyone's intuitions. Besides, intuitions are 
heavily influenced by past experience, so there do exist times when it's best 
to go against the grain in that respect. The "problem" here is that newcomers 
to Python often make an incorrect assumption. The moment they let go of that 
assumption, everything is fine.

Guido has a pretty good track record as a language designer, so when you see 
something in Python that is different than previous languages you've used it 
might be wart, but it might also be a place where there's good reason for 
being different. This is an example of the latter - in real programs this 
approach works well and is quite powerful and elegant. As a result I'm more 
comfortable with languages that work this way and less so with those that 
don't.

> A goal of Python is to be a 'very high level language'. Another is to
> 'do the right thing'.

If so, then in the opinion of most users it *is* succeeding at both goals. The 
theoretical or mathematical parallels may be interesting, but they're  
irrelevent because (for a large number of users, probably the overwhelming 
majority) the way references and binding are handled in Python works very, 
very well in practice, plain and simple.

> > If you
> >read "variable" where you should be reading "alias"
>
> If I should be reading "alias", then how come the Python manuals say
> "variable"?

Perhaps because most people don't have a hangup about it? And perhaps because 
the few who do get over it rather quickly? Seriously - it's such a tiny 
thing.

-Dave





More information about the Python-list mailing list