Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!news2.euro.net!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'syntax': 0.03; 'subject:Python': 0.05; '21,': 0.07; 'interpreted': 0.07; 'python': 0.09; '"if': 0.09; '(although': 0.09; 'programmer': 0.11; 'language': 0.14; 'weird': 0.15; '"int': 0.16; 'blocks': 0.16; "can't.": 0.16; 'example?': 0.16; 'expression,': 0.16; 'indent': 0.16; 'parentheses': 0.16; 'sharp': 0.16; 'syntax,': 0.16; 'syntax.': 0.16; 'tabs': 0.16; 'there?': 0.16; 'wrote:': 0.17; 'tend': 0.17; 'thu,': 0.17; 'windows': 0.19; 'feb': 0.19; 'variable': 0.20; 'trying': 0.21; 'addition,': 0.21; 'error.': 0.21; 'work.': 0.23; 'statement': 0.23; "haven't": 0.23; 'header :In-Reply-To:1': 0.25; 'looks': 0.26; '(which': 0.26; 'message- id:@mail.gmail.com': 0.27; 'this?': 0.28; 'initial': 0.28; 'editors': 0.29; 'indentation': 0.29; 'starts': 0.29; 'source': 0.29; 'expect': 0.31; 'code': 0.31; 'point': 0.31; 'file': 0.32; 'could': 0.32; 'date.': 0.33; 'doubt': 0.33; 'impression': 0.33; 'problem': 0.33; 'to:addr:python-list': 0.33; "can't": 0.34; 'received:google.com': 0.34; 'consistent': 0.35; 'open': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'add': 0.36; 'but': 0.36; 'should': 0.36; 'problems': 0.36; 'editor': 0.37; 'being': 0.37; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'easier': 0.38; 'fact': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'takes': 0.39; 'easily': 0.39; 'space': 0.39; 'where': 0.40; 'most': 0.61; 'matter': 0.61; 'different': 0.63; 'more': 0.63; 'making': 0.64; 'results': 0.65; 'due': 0.66; 'levels': 0.66; 'manner.': 0.66; '2013': 0.84; 'matters.': 0.84; 'surround': 0.84; 'to:name:python': 0.84; 'frustrating': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=0Y4sG3Cf7g6Nt2w98lV/ar0xTYL4HsKcyAtUJhgirNM=; b=Z8JtaAViirD9eAED5l6bz8OQh8xnpGwz/3b7cIKmULfjauCvRJ52SpDQcO6BfuAtkN RD98Ee+BJMxqd9z3Yny53FDmpMIM/zBuVmJRYDEGJ2/ooBXHui/QXclStiyBFE7q6z5k cw+A7dMRve3ITTnqqdiWpJLh7VvbyM1EGIevXuVwwjrXjFRj6H2WhE15siJnP6L9Mdg2 /+aidJySMXrjUR5Gjv6X66DU4v48UoxH124u+CPO0l7Wr7U4BcxhUjHK9i6qG/8kM7nK eF5d/rZiSksjAuRfEGBrpbc5Vy3J37t93YYKALh7AUJVsnTOZjBC6+bjMn600H5H4sqF pFxA== X-Received: by 10.66.155.104 with SMTP id vv8mr333605pab.165.1361483684681; Thu, 21 Feb 2013 13:54:44 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: From: Ian Kelly Date: Thu, 21 Feb 2013 14:54:04 -0700 Subject: Re: Python Newbie To: Python Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 40 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361483688 news.xs4all.nl 6958 [2001:888:2000:d::a6]:57901 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39466 On Thu, Feb 21, 2013 at 2:26 PM, Piterrr wrote= : > I am a long time C sharp dev, just learning Python now due to job require= ments. My initial impression is that Python has got to be the most ambiguou= s and vague language I have seen to date. I have major issues with the fact= that white space matters. How do you deal with this? For example, you open= a source file in different editors and the indentation levels change even = though i only have spaces, no tabs (compare Windows Notepad and Notepad++).= Which editor do you trust? I have never had this problem (although I don't use either of those editors either). Are you sure you don't have any tabs in there? > In addition, code is difficult to read because you cannot lay it out in e= asily discernable blocks. For example, I always tend to indent a full 'if' = statement block so that it is easier to see where the if block starts and e= nds. Can't do that in Python. I don't understand what it is that you want to do but can't. Can you give an example? The whole point of making indentation matter in Python is to *force* the programmer to lay out their blocks in a consistent and easily discernible manner. > What is even more frustrating is that Python is inconsistent with its syn= tax. For example, when I write "if (myVariable !=3D 0):" then this is OK bu= t "for (i in intAry):" results in syntax error. Apparently Python has probl= ems with my use of parentheses. The former works because the if statement only takes one expression, and the parentheses are interpreted as part of that expression, not part of the syntax for the if. The for statement requires both a variable name and an expression, distinguished by syntax, which again includes no parentheses. You could surround just the expression part in parentheses if you like -- "for i in (intAry):" -- but it looks pretty weird if you ask me. I don't know why you should expect to be able to add parentheses to arbitrary syntax and have it just work. It strikes me as being like trying to declare a variable as "int (x=3D3);" in C# (which I haven't tested, but I doubt that is valid syntax).