Look at this VFP code
Do while <some expression>
Code Line 1
Code Line 2
enddo
Code Line 3
Python code
Python Do Construct
Code Line 1
Code Line 2
Code Line 3
Both are correct. If Python loses the tab before line 2 it behaves
incorrectly. If VFP loses it, it behaves correctly, but just looks ugly
(and if it loses the ENDIF, it won't compile). The tab is invisible because
when you look at the Python code, you can't tell there is a problem, but
there is a problem. I could probably learn to live with it (especially
given the other things I think Python does well), but it just seems too easy
for an error to happen. I'm not saying this type of error would happen all
the time, but why not just make it clear and less error prone? But that's
not up to us, is it? <g>
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Ed Leafe
Sent: Wednesday, September 27, 2006 2:39 PM
To: [EMAIL PROTECTED]
Subject: Re: [NF] Python - Thinking Differently
On Sep 27, 2006, at 2:10 PM, Russell Campbell wrote:
> My point is that the loss of a tab character - an *invisible*
> character -
> changes how the program operates, where as in VFP, if the
> programmer gets
> the code in the right spot with the right placement of the ENDIF,
> the loss
> of a tab at line 4 (line 4 should be in the loop) will not cause a
> problem.
> In Python it will cause a problem, in VFP it won't.
First, I don't quite agree that the tab is invisible. I can clearly
see that Line 4 is not part of the block. But yes, if you don't know
the code, you might make that mistake. But IMO, it's no different
than a misplaced ENDIF: the code *looks* OK, but unless you know that
Line 4 is supposed to be inside the block, you have no way of telling.
> I don't like the idea
> of the loss or addition of invisible characters making code run
> differently.
> But let me emphasize that I do like many of the other things I saw in
> Python. I guess it's a matter of what someone can live with after
> evaluating the entire language.
Well, I guess that the proof of the pudding...
This list, and all the others I run here, is 100% Python, and it
seems to work pretty well. BitTorrent, which by many estimates is
responsible for 1/3 the traffic on the internet today, is 100%
Python, and doing quite nicely. Dabo is 100% Python, and the only
problems we have is stupid programmer mistakes; I've never run into
the scenario you are painting. When I'm coding in Python, the
indentation matches my thought processes, and feels completely
natural. I may write a conceptual bug, but I can't ever recall one
that was due to indentation mysteriously changing.
-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.