two ideoms at one blow: line-reading and regexp-matching

Gustavo Cordova gcordova at hebmex.com
Thu Feb 21 12:54:22 EST 2002


> 
> Anyway, =/== is a dead horse--didn't we agree that using := for assigments
> in expressions totally fixes it?  So there's no reason to keep coming
> back to it.
> 

Er, no, we didn't :-)

_YOU_ and _I_ agreed that it's more readable and less
error prone than simply using "=" in an expression.
That's it. Don't include me in your revolution.

> > Also, putting multiple conceptual things on one line isn't good for code
> > clarity.
> 
> That depends on your style and on the context.
> 

I agree with the earlier statement.

> 
> If you want Python to catch more typos for you,
> you're better off asking for Python to check for
> variable declarations (I don't mean static types,
> I just mean "local x") and flag undeclared variables
> like you can with perl's "use strict" option.
> That will prevent a lot more bugs than := is likely to cause.
> 

Now this is just plain nasty.

> 
> And it fills more space on the screen, crowding
> out other code, so you can't see as much of the
> program flow.  I like the short version better.
>

So, get a larger monitor, or use a smaller font,
or make the editor window larger, or change
your text mode (if using text mode), or ...

>
> > But in the end, neither of our subjective opinions
> > matter - Guido's does. That's probably why this
> > language is so great.
> 
> Guido doesn't write our code; we do.

That's all nice and useful. I'm not defending
Guido, but hey, let's keep this civil, ok?

*If* it weren't for Guido, we/you wouldn't *have*
Python to hack on.

Second, Guido's a pretty smart person. So maybe
he did give quite a bit of thought about the
expression/asignment thing.

Now, I have an idea which is at the back of my
mind. I don't know if it's worth anything, it's
my own hypothesis, it may be totally bogus, on
the other hand, it may be real and we don't know
about it. So here it is, for your perusal and
entertainment.

"Language" is the expression of a person's thoughts,
and thoughts and ideas expressed in a Language tend
to reflect the structure of that persons thoughts.

On the other hand, the inverse process also happens:
"Language" tends to impose, with time, it's structure
and semantics upon it's users mind. Like a kind of
feedback. The Object modifying the Observer.

One thing which is quite delightful about Python is
it's high-quality, simple-to-use, and quite powerful,
included library. Even if lots of modules have "amateur"
origins, it's of very high quality, and usability.

So. If the Language (Python) changes, in a way that
it doesn't impose a Neat, Orderly, Clean, programming
style, then I really believe that the Language will
--passively-- encourage sloppy code.

There.

That's the stone in my beans (er, mexican saying :-)

I love Python because it steadily forces upon me
some rules about writing neat, readable, correct
code.

I liked C because it let me get away with some
sloppy and hideous stuff.

Hmmm... no need to mention assembler. :-)

On the other hand, I may be totally, utterly
wrong; but it won't be the first or last time :-)

Thursday!!

-gustavo




More information about the Python-list mailing list