X-Received: by 10.224.208.9 with SMTP id ga9mr274690qab.8.1361486438042; Thu, 21 Feb 2013 14:40:38 -0800 (PST) X-Received: by 10.49.15.6 with SMTP id t6mr2122828qec.20.1361486438023; Thu, 21 Feb 2013 14:40:38 -0800 (PST) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!dd2no1884139qab.0!news-out.google.com!t2ni627qaj.0!nntp.google.com!dd2no1884130qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.python Date: Thu, 21 Feb 2013 14:40:37 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=77.98.108.31; posting-account=KNmrtAoAAAD-o0n7P5clulJjssENqvZt NNTP-Posting-Host: 77.98.108.31 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <5c262e95-b3a8-4f2a-b752-84b30bf4f81e@googlegroups.com> Subject: Re: Python Newbie From: piterrr.dolinski@gmail.com Injection-Date: Thu, 21 Feb 2013 22:40:38 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: csiph.com comp.lang.python:39479 Thanks to all for quick relies. Chris, you are (almost) spot on with the if blocks indentation. This is wha= t I do, and it has served me well for 15 years. code code if (some condition) { code code } code code This is what I call code clarity. With Python, I am having to do this code code ############################## if (some condition): code code ############################## code code It does the job, but is not ideal. I am nervous about using variables "out of the blue", without having to dec= lare them. For example, when I write "i =3D 0" it is perfectly OK to Python= without 'i' being declared earlier. How do I know that I haven't used this= variable earlier and I am unintentionally overwriting the value? I find I = constantly have to use the search facility in the editor, which is not fun. You see, Javascript, for one, behaves the same way as Python (no variable d= eclaration) but JS has curly braces and you know the variable you have just= used is limited in scope to the code within the { }. With Python, you have= to search the whole file. Thanks to Chris, Ian and Dave for explaining the () issue around if and for= statement. I don't agree with this, but I understand your points. The reas= on why I like parentheses is because they help with code clarity. I am obse= ssed with this. :-) After all, there is a reason why so many languages have= required them for several decades. What about Python's ambiguity? For example, in C you would write if (myVar !=3D 0) do something in Python, this is legal if (not myVar): do something What does this mean? Is it a test for myVar being equal to zero or a test f= or null, or else? I want to learn a new language but Python's quirks are a bit of a shock to = me at this point. I have been Pythoning only for about a week. In the mean time, thanks to most of you for encouraging me to give Python a= chance. I will do my best to like it, w/o prejudice. Peter