Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'tries': 0.05; 'plenty': 0.07; 'purpose.': 0.07; 'subject:don': 0.09; 'language,': 0.11; 'syntax': 0.13; '"global"': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'received:192.168.1.4': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'subject:python.': 0.16; 'then...': 0.16; 'title?': 0.16; 'wrote:': 0.16; "shouldn't": 0.18; 'language': 0.19; 'variable': 0.20; 'mind.': 0.22; 'programming': 0.23; 'code.': 0.23; 'seems': 0.24; 'header:In-Reply-To:1': 0.24; 'words': 0.24; 'example': 0.25; 'header:User-Agent:1': 0.26; 'specify': 0.27; "doesn't": 0.28; 'looks': 0.29; 'flying': 0.29; 'subject:like': 0.29; 'allows': 0.30; 'window': 0.31; 'maybe': 0.31; 'code': 0.31; 'language.': 0.32; 'received:84': 0.32; 'class': 0.33; 'problem': 0.33; 'another': 0.34; 'languages': 0.34; 'could': 0.35; 'to:addr :python-list': 0.35; 'clear': 0.35; 'something': 0.35; 'but': 0.36; 'there': 0.36; 'should': 0.37; "didn't": 0.37; 'subject:: ': 0.37; 'self': 0.38; 'end': 0.39; 'wanted': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'subject:the': 0.40; 'some': 0.40; 'skip:u 10': 0.62; 'more': 0.62; '(that': 0.63; 'skip:n 10': 0.63; 'managers': 0.63; 'goal': 0.64; 'equals': 0.66; 'subject:. ': 0.66; 'natural': 0.67; 'believe': 0.67; 'business': 0.69; 'obvious': 0.72; 'subject:self': 0.84; 'try.': 0.91 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=OoyysHLt c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=QrohdLjRRo4A:10 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=ERl2tjPDlcWVuDnFaDIA:9 a=QEXdDO2ut3YA:10 X-AUTH: mrabarnett@:2500 Date: Thu, 11 Jun 2015 13:16:57 +0100 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: I don't like the OO part of python. In particular the "self" keyword everywhere. References: <77496$55797095$5419aafe$48148@news.ziggo.nl> In-Reply-To: <77496$55797095$5419aafe$48148@news.ziggo.nl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 64 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1434025019 news.xs4all.nl 2836 [2001:888:2000:d::a6]:50157 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:92474 On 2015-06-11 12:27, Skybuck Flying wrote: > Then again... > > I also believe the highest goal for a programming language is "natural > spoken" language. > Natural language is full of ambiguities. > If "self.somefield" equals 10 then... > > Does have some understandable ring to it. > > However... time constraints also have to be kept in mind. > > In another words if the code looks like > > begin of class section > Shouldn't that be "beginning of class section"? > if somefield equals 10 then... > > > end of class section > You should have a look at Cobol. If was designed with a more natural- looking syntax so that business managers could write their own code. It turned out that the managers didn't write code because programming harder then they anticipated. Then there's AppleScript. It also tries to have a more natural-looking syntax, but the problem is that it's then not so clear what's legal. For example, it allows "title of window" or "window's title". So what is the title of the script's title? It's "title of window of me" or "me's window's title". Yes, "me's", not "my". It's an example of the "Uncanny Valley". I prefer a language that doesn't look like a natural language, because it isn't, that's not its purpose. > Should be pretty obvious that somefield belongs to class section... > > So no need to specify self... > > If I wanted to access a global variable I would use the existing "global" > thing > > global SomeField... > > maybe if I wanted to use a local variable for routine: > > local SomeField... > > seems nicer... then having to use self everywhere... > "then"? Should be "than"... (That seems to be happening more and more these days...) Anyway, the use of "self" is something that's not going to change. If you don't like it, there are plenty of other programming languages out there for you to try.