invert or reverse a string... warning this is a rant

Ron Adam rrr at ronadam.com
Sat Oct 21 02:58:33 EDT 2006


Steven D'Aprano wrote:
> On Thu, 19 Oct 2006 20:07:27 -0400, Brad wrote:
> 
>> Steven D'Aprano wrote:
>>
>>> Gah!!! That's *awful* in so many ways.
>> Thanks... I'm used to hearing encouragement like that. After a while you 
>> begin to believe that everything you do will be awful, so why even 
>> bother trying?
> 
> Well obviously I hit a sore point. I wrote a little hastily, and wasn't
> quite as polite as I could have been -- but it is true, the function you
> wrote isn't good: a seven line function with five problems with it.
> 
> Your function was not at all Pythonic; but it isn't even good style for
> any serious programming language I know of. I'm sorry if I came across as
> abrasive, but I'm even sorrier that you can't take constructive criticism.
> Some techniques are bad practice in any language.

Steven, I think just took things a little out of context, and yes you were a bit 
overly harsh.  But I've also read enough of your post to know you most likely 
did not mean any insult either.

Brad's little reminder program was not meant to be actually used in a program as 
is of course, but was a small script for him to run so he could see what was 
happening visually. Yes, it could be improved on for that purpose too.  But for 
what it's purpose is, does it really matter that much?  It does what he meant it 
to do.

Yes, a small dose of politeness, (tactfulness isn't quite the same as suger 
coating), always helps when pointing out where others can make improvements 
especially while they are still learning their way around.

With that said, If it were me who wrote something that you really thought was 
bad, then blast away! ;) (without insulting me of course.)  I'd probably take a 
second look and agree with you.  But I've been programming python since version 
2.3 and as a more experienced programmer will appreciate the honest feed back.


[You said from an earlier post...]

> (That's a complaint I have about the dis module -- it prints its results,
> instead of returning them as a string. That makes it hard to capture the
> output for further analysis.)

I have a rewritten version of dis just sitting on my hard disk that fixes 
exactly that issue.  It needs to be updated to take into account some newer 2.5 
features and the tests will need to be updated so they retrieve dis's output 
instead of redirecting stdout.  If you'd like to finish it up and submit it as a 
patch, I can forward it to you.  It would be good to have a second set of eyes 
look at it also.

Cheers,
    Ron



More information about the Python-list mailing list