tabs do WHAT?

Samuel A. Falvo II kc5tja at garnet.armored.net
Mon Jan 24 18:50:45 EST 2000


In article <0mPi4.3349$bp2.155298 at newsread2.prod.itd.earthlink.net>, Warren
Postma wrote:

>yellow nicotine stains. Sorry for the visual image, but hey, I gotta say, it
>just doesn't fit with the rest of the language, and I don't buy it one bit.

Then why are you still using Python?  Perl offers _all_ the features that
Python supports now, but is not white-space significant (for the most part).

>A programmer/professor I once had for a software engineering course told us
>about the "principle of least amazement": Anything weird or hard to explain
>that you write into your software will later become the thing you regret.

Precisely why Python's indentation-based scoping works so well.  It
eliminates suprises.

>As an embedded language, Python needs to be usable beyond the ivory towers
>where functional programming or object oriented programming or metaclasses
>are fodder for discussion.   Python looked eminently useable by

Python is a scripting and rapid development language.  It's not a systems
language.  Do not confuse the two.  For instance, I'm going to be using
Python to develop the filesystem (DNFS) for my operating system.  But I can
guarantee you I won't be using it for the finished product.  :)

>non-programmers until I found out that whitespace was meaningful.  Try to
>explain scope to someone who doesn't write programs for a living.

Everything you want done under the IF statement goes under the IF statement,
as if writing an outline on a piece of paper.

	IF a=b:
		do this
		then do this
		then do that
		and finally, do that.

Now try explaining brace-delimited constructs to a newbie:

Everything you want done under the IF statement needs to go inside these
things called Braces. You need these braces to group the things you want
done to treat them as a unit.  My recommendation is to write your code like
this, but you don't have to.  Just make sure, whichever style you choose to
write your code in, make it consistent so you'll know what you wrote two
months ago:

	if( a == b )
	{
	   do this;
	   then do this;
	   then do that;
	   and finally, do that.
	}

I can absolutely guarantee a new-comer to programming, computer science
major or otherwise, will have their head spinning with the latter
description.  The former is a piece of cake, because _everyone alive today_
writes outlines in almost exactly the same way, and in every way, they are
whitespace sensitive.

>Even BASIC, ugly as it is from a functionality point of view, is miles ahead

BASIC is actually quite a capable language, and a good implementation offers
a nice, clean, and consistent syntax.

>from the point of view of useability by people who are skilled technical
>people, yet who are not "programmers".    Ergo, Visual Basic's popularity.

No; VB is popular for one reason and one reason only: Microsoft.  TONS of
other companies had released RAD solutions based on all sorts of languages,
>INCLUDING BASIC<.  But none has succeeded until Visual Basic came to the
scene.  Why?  Because Microsoft sets the standards for development for their
operating system.

Had Microsoft chosen assembly language for the RAD solution, and adequately
demonstrated its features, I can guarantee you that Visual MASM would be the
RAD tool of choice.

>The language is a dog's breakfast, but at least the basic feature set you
>use every day is clear and clean enough to keep in your head, and still have
>room for your other domain-specific knowledge.

And Python isn't?  Syntactically speaking, they're almost identical.  That's
why you keep seeing "Python Vs. Visual Basic" messages from people all over.

>Unreadable Languages, )...   So close, and yet so far away. Has anyone built
>a version of Python that totally ignores tabs and whitespace, or a filter
>that you can use on top of Python? Perhaps  it could support both 'begin'

Yes -- they call it BASIC.

>and 'end', or  '{' and '}' for scoping.  Heck, at least you could write it
>in Python.  An interpreter within an interpreter. That would probably be
>very slow, wouldn't it?

No, because the interpretation is done on bytecodes.  The pre-compiler is
responsible for morphing the code to .pyc files.  All one needs to do is
re-implement the compiler.

-- 
KC5TJA/6, DM13, QRP-L #1447
Samuel A. Falvo II
Oceanside, CA



More information about the Python-list mailing list