The Artima Developer Community
Sponsored Link

Weblogs Forum
What Matters About Python?

19 replies on 2 pages. Most recent reply: Oct 3, 2007 6:55 PM by Steve Holden

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 19 replies on 2 pages [ « | 1 2 ]
Merriodoc Brandybuck

Posts: 225
Nickname: brandybuck
Registered: Mar, 2003

Re: What Matters About Python? Posted: Aug 17, 2007 7:01 PM
Reply to this message Reply
Advertisement
> > I used to cringe a little at the whitespace thing. Now
> I
> > just don't care. Almost everybody I know who cringes
> ends
> > up not caring. But, I think, that topic has gotten
> beaten
> > to death. The only syntax flakiness that I even think
> > about sometimes is that trailing ':' after if
> statements,
> > for loops, etc.
>
> I think Elizabeth was in favor of the 'whitespace thing'.
> I too find it odd that this is considered by many to be a
> a deficiency in Python because I think it's great. At
> first, I was a little skeptical but when I realized that I
> can't stand when people don't indent properly, I
> reconsidered.
>

I believe she was, too. I just found it interesting because so many people complain about it. Indent properly is subjective in just about every other language. It can be maddening when other people's version of 'proper' does not match your own :-)


> I would even like to use this idea to create a simplified
> form of XML equivalent documents. When I've suggested
> this in the past, people have claimed that whitespace is
> 'dangerous' because it's too easy to change.
>

I don't think easy to change is the issue. Easy to confuse tabs and spaces is what causes problems. All text is easy to change. whitespace is annoying because it is hard to see.

> Has anyone ever had this occur to them in Python where
> reformatting the code changing the meaning? It seems kind
> of like a theoretical problem.

The only issue I've had with whitespace is in moving from one editor to another loading old code where tabs are used instead of spaces. emacs untabify is a lifesaver in cases like this. But then, the meaning doesn't really change, the code just doesn't run.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: What Matters About Python? Posted: Aug 20, 2007 6:33 AM
Reply to this message Reply
> > > I used to cringe a little at the whitespace thing.
> Now
> > I
> > > just don't care. Almost everybody I know who cringes
> > ends
> > > up not caring. But, I think, that topic has gotten
> > beaten
> > > to death. The only syntax flakiness that I even think
> > > about sometimes is that trailing ':' after if
> > statements,
> > > for loops, etc.
> >
> > I think Elizabeth was in favor of the 'whitespace
> thing'.
> > I too find it odd that this is considered by many to be
> a
> > a deficiency in Python because I think it's great. At
> > first, I was a little skeptical but when I realized that
> I
> > can't stand when people don't indent properly, I
> > reconsidered.
> >
>
> I believe she was, too. I just found it interesting
> because so many people complain about it. Indent properly
> is subjective in just about every other language. It can
> be maddening when other people's version of 'proper' does
> not match your own :-)

What I mean is inconsistently or in confusing ways. I've seen code like this:
if (a) blah;
  if (b) blah;
     if (c) blah;

Or where nested ifs were not indented compared to their parents. I've seen just plain random indentation.

Code formatters help with this but can make it hard to track changes in source control, if not done carefully. Mostly, I annoys me that people can be so sloppy. It's no surprise I find so many bugs in this kind of code.

Merriodoc Brandybuck

Posts: 225
Nickname: brandybuck
Registered: Mar, 2003

Re: What Matters About Python? Posted: Aug 20, 2007 6:45 AM
Reply to this message Reply
> What I mean is inconsistently or in confusing ways. I've
> seen code like this:
>
> if (a) blah;
>   if (b) blah;
>      if (c) blah;
> 

> Or where nested ifs were not indented compared to their
> parents. I've seen just plain random indentation.
>
> Code formatters help with this but can make it hard to
> track changes in source control, if not done carefully.
> Mostly, I annoys me that people can be so sloppy. It's
> s no surprise I find so many bugs in this kind of code.

wow, that would make me cranky, too.

ian o

Posts: 8
Nickname: iano
Registered: Aug, 2007

Re: What Matters About Python? Posted: Aug 20, 2007 10:49 PM
Reply to this message Reply
>>What are the warts, and what have you found Python to be especially good or bad for?

Warts? As another poster already noted- the complexity of distributing python apps is problematic. Not only is the interpreter not always present by default, but anyone wanting to distibute apps to end users as pyc code has to worry about which verion or generate the cryptic 'bad magic number' messages. (why can't installations deal with prior version pycs?)

Good for....web apps where the app resides on the server and distribution is not an issue :)

Steve Holden

Posts: 42
Nickname: holdenweb
Registered: Apr, 2003

Re: What Matters About Python? Posted: Oct 3, 2007 6:55 PM
Reply to this message Reply
Thank you all for your contributions. I have been heavily occupied elsewhere since writing the post (and have already written a couple of pieces for the magazine, editorial schedules being what they are), but this gives me a huge vein of interesting stuff.

The pieces I have done so far have mostly been opinion. I will, in response to clear demand, be trying to ensure from now on that every piece includes at least a little code.

Flat View: This topic has 19 replies on 2 pages [ « | 1  2 ]
Topic: What Matters About Python? Previous Topic   Next Topic Topic: One Laptop Per Child

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use