Unexpected Python Behavior

Ville Vainio ville at spammers.com
Sat Oct 2 06:37:25 EDT 2004


>>>>> "Andrea" == Andrea Griffini <agriff at tin.it> writes:

    >> through the face meetings here, not just net acquaintanceship)
    >> This guy was the technical editor for my book, and I know him
    >> to be not only technically brilliant but also an affable and
    >> congenial person).

    Andrea> Yes... I can very well understand that this is not the
    Andrea> Alex you know, but it's the Alex I know. Would you just
    Andrea> please blank out the names and read the messages instead ?

Doesn't help much.


    >>> that one is a problem he has with me and not the other way
    >>> around... may be he can try to find a solution inside himself
    >>> or talking to a good psychotherapist... I don't think I can be
    >>> of any help about it.

    >> Well, clearly not with an attitude like that. Frankly that's
    >> about as insulting as you should be getting around here. In
    >> fact I think you've gone too far. I preferred the sarcasm.

    Andrea> Can you take the time to read my messages in this thread
    Andrea> and Alex' replies to my messages, and tell me when was
    Andrea> that I passed the reasonable limit ?

Actually, you appeared to pass the reasonable limits for this
particular newsgroup. This newsgroup is noticeably friendlier than
most of the other newsgroups out there - I don't know why, it might be
a byproduct of some cosmic similarity between people who dig Python,
or just a nice, contagious tradition. 

What you might consider appropriate in a C++ newsgroup sticks out like
a sore thumb here. Going for Ad Hominem is always a bad idea,
especially when provoked by a purely technical discussion. I believe
you will learn to appreciate this tradition when you hang out more
around here. 

    Andrea> The problem (as I see it) started many years ago in a C++
    Andrea> newsgroup when I simply noted that at that time it was IMO
    Andrea> unfair to compare what the return code approach was
    Andrea> actually able to deliver (basically *all* the software we
    Andrea> were using at that time) with what the exception approach
    Andrea> was just promising.

I guess comparing the ups and downs is reasonable, rewriting a big
pile of code is a different thing. Surely you agree that in Python the
exceptions are the way to go?

    Andrea> off in complex systems (I think exceptions are just
    Andrea> wonderful in a few special cases - i.e. when you can
    Andrea> "rollback" or at least "restart" a subsystem - but they're
    Andrea> not a panacea in general when your program state is
    Andrea> complex, distributed and unprotected... the core problem I

Coding using exceptions is just much less ledious and
error-prone. Also, the code is much more readable when every line
doesn't have CroakIfError(stuff_that_needs_to_be_done()). Exceptions
are slighly less cool in C++ because of all the memory management
complications.

    Andrea> May be is the "pythonic" way to always privately import
    Andrea> and then bind functions to local names and doing all this
    Andrea> by using fake parameters with a default value ?

Of course not.

    Andrea> I was also quite suprised about the discussion moving to
    Andrea> the microseconds when if I care about microseconds the
    Andrea> python is a questionable choice. True that python is often
    Andrea> "fast enough", but If I've to write uglier code to get a
    Andrea> 1.2x speedup then I can do it with other languages instead
    Andrea> of using something that is *essentially* slow and get a
    Andrea> 10x speedup. Ugly for ugly I'd use C++ (or

1.2x speedup just isn't worth the ugly code, for typical
situations. Just go ahead and write pretty code, it's probably fast
enough as well. Premature optimization is the root of all evil.

    Andrea> But the key point is that your name is just not enough to
    Andrea> make drink what you say without thinking; sorry if this
    Andrea> sounds offending, but that philosophy is a part of me I
    Andrea> just can't shut off.

Name, perhaps not, but when you are a newbie at something, the more
experienced ones are right surprisingly often. Questioning stuff when
you are new is almost a rite of passage :-).

    Andrea> And (drumrolls) Alex Martelli name is surely not the
    Andrea> biggest I've had discussion with. By far.

Again, completely unnecessary.

People do get pissed off on usenet, for one reason or another. When I
feel insulted (once here, a few times elsewhere), I just like to point
out briefly that what the other guy said was insulting, and stop
there. Unlike in "real life", the parent comment is there for all to
see, and everyone can draw their own conclusions. Perhaps the other
guy had a bad day, or has some personal issues to sort out; rarely is
it worth it fire back. There are no "debate points" to score, and
nobody thinks that whoever wields the sharpest sarcasm wins. It's not
slashdot, we are here with our real names :-).

    Andrea> But tell me that

    Andrea> def foo(x,my_personal_cache_so_please_dont_pass_this_parm=[]):
    Andrea> ...

    Andrea> is beautiful and I can sign a paper where is stated that
    Andrea> you're either kidding or a dork.

It's not beautiful, but it works, and is already in the language. Come
on, you are an old C++ hand, you are used to dealing with the horrors
of chtulhuan proportions daily. I'm a C++ programmer as well, and
nothing in Python compares to the dirt I deal with every day. Private
cache in param list is a minor issue.

-- 
Ville Vainio   http://tinyurl.com/2prnb



More information about the Python-list mailing list