Framework for a beginner

Chris Angelico rosuav at gmail.com
Thu Apr 19 08:02:40 EDT 2012


On Thu, Apr 19, 2012 at 9:14 PM, Kiuhnm
<kiuhnm03.4t.yahoo.it at mail.python.org> wrote:
> There are many things I don't like about Python. The first flaw is the
> absence of anonymous code blocks, but I've already solved this problem.

You mean lambdas? Yeah, they're a lot more limited in Python than in
some other languages. However, you can always define a local function
and just use it. It may as well be anonymous since nobody else can use
that name.

> I don't like the inability of using assignments inside of expressions.

Yes, I'm fond of assignment-as-expression too. But it has its
downsides, and by forbidding it, Python makes available a variety of
syntax elements such as keyword arguments (rather than positional);
it's a perfectly tenable design choice.

> I don't like the fact that regexps are implemented as a library. Perl is
> much more readable and expressive in this regard.

Definitely not. As a library, it can be extended or even totally
replaced without tampering with the language itself. Much more
flexible. Yes, it may be a little more readable in Perl or Javascript
- but ONLY if you consider regexps as the most important part of the
language. They're not - they're only one thing that Python does. Why
should they merit special syntax when there's none for, say,
retrieving the contents of a document based on its URL?

> Operator overloading is too limited.
> I sometimes avoid classes because prefixing hundreds of identifiers with
> 'self.' makes the code uglier and much less readable.

Stylistic choice. In the absence of variable declarations, everything
has to be more explicit. Again, I would prefer declared variables, but
the Python choice is quite viable.

> The absence of type inference makes it difficult to find many errors at
> "writing"-time. Dynamic typing is useful, but there are times when I know
> what type a variable is but the IDE won't help me because it doesn't know.

Valid point. Again, design choice because there's no declaration of variables.

> I don't like when a community imposes style on a programmer. For instance,
> many told me that I shouldn't use camelCase and I should adhere to PEP8.
> Well, that's not me. I write my code the way I like it and if that is
> frowned upon by some "standardizing" community, so be it.
> I want to retain my freedom of expression.

PEP 8 is by no means demanded. It's recommendations. I violate it all
the time, especially as regards placement of whitespace :)

> You say that Python programmers are smarter. I think that the greater part
> of them are too fond of their language.
> The problem is that they see Python as their language. When you know more
> than 30 languages you stop thinking that way and you also don't try to
> defend your language against "infidels".

I know (many) more than thirty languages, and I still want to defend
Python against turning into Perl, or turning into C, or turning into
lisp. That's not because those are bad languages, but they are *not
Python*.

> Python is a very good language, but so is Ruby, Scala and many other
> languages. Denying that fact is deluding oneself.

Does anyone honestly deny that? I doubt it. Bye-bye, straw-man.

ChrisA



More information about the Python-list mailing list