<div dir="ltr">I agree with Brett.<br><br>While it's true that $ is four character shorter than 'self.', it also loses expressiveness by doing so. The point here seems to be that it distinguishes local variables with instance variables. Whereas 'self.' conveys the idea that this is an instance variable clearly, a symbol such as '$' or '@' does not.<br>
<br>It's also true that using 'self' is a convention -- you can easily use 's'. So if you're enough of a nutcase to REALLY want to save those precious four extra characters, well, you can save three. Meanwhile, adding @ or $ to syntax would confuse a well-established, well-understood, and newbie-friendly practice and complicate the language's grammar. Not to mention, prefixing a variable with $ might be distracting to programmers who do PHP for a living. Yet another mental load to bear.<br>
<br>It is not a blind spot. I have said before, if not on this list, then to
fellow programmers, that I like Python because 'self.' is not implicit
or substituted with a symbol that I don't automatically grok. This is,
in my opinion, what Brett meant by self-documenting, and I'm inclined to agree. I don't like programming in languages that don't make as clear a distinction between local variables and instance variables. And it's not because I'm used to programming in Python, either, as I am a student have seen more Java code than Python, and took up Python as a hobby. Perhaps it is you who, having (possibly) seen implicit or abbreviated instance variables day in and day out, have burnt them into *your* brain. I certainly haven't.<br>
<br>--Andy<br><br><div class="gmail_quote">On Sun, Aug 24, 2008 at 10:04 PM, Russ Paielli <span dir="ltr"><<a href="mailto:russ.paielli@gmail.com">russ.paielli@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">On Sun, Aug 24, 2008 at 9:39 PM, Brett Cannon <span dir="ltr"><<a href="mailto:brett@python.org" target="_blank">brett@python.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div>On Sun, Aug 24, 2008 at 7:25 PM, Russ Paielli <<a href="mailto:russ.paielli@gmail.com" target="_blank">russ.paielli@gmail.com</a>> wrote:<br><br>
> Think about this way: it's 80% less clutter. I am a compulsive minimalist,<br>
> and one of the reasons I like Python is because it minimizes clutter. I<br>
> probably let clutter bother me more than I should. I really appreciate the<br>
> lack of semicolons all over the place. Some would call that trivial, but I<br>
> call it significant.<br>
<br>
</div></div>You call it clutter, I call it information. We have kept 'self'<br>
explicit for a reason; it's self-documenting.<br>
<div></div></blockquote><div><br>First, "self." conveys no more "information" than the "$" I am proposing, but it requires five times as many characters. If that's not clutter, I don't know what is.<br>
<br>Second, "self." actually conveys *less* information than "$", because it's meaning depends on whether or not the first formal argument was actually "self".<br></div><br>For the record, I gladly concede that I probably don't know as much about Python as most of the other people on this mailing list (as I wrote earlier, I am an aerospace engineer). But I also sense that many Python experts have a blind spot on this matter for some reason. I guess these folks are just so used to seeing "self." everywhere that it has burned itself into their brain to the point that they don't see it as the clutter that it is.<br>
<br></div>
</div>
<br>_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
<br></blockquote></div><br></div>