Slashdot Mirror


Python Conference Coming Soon

nnorwitz writes "PyCon 2004 is coming to Washington, DC at the end of March. It's a great place to meet lots of smart people and learn new things. Many interesting discussions go far beyond Python into other programming languages and topics. We should find out more about the Pie-thon, the OSAF since Mitch Kapor is the keynote speaker. There may even be a few surprises. The price is only $175, but early bird registration ends soon. It's not too late to submit a presentation either. I hope to see lots of new faces this year! I want to talk to some Perl and Ruby zealots^Wconverts^Wprogrammers. :-)"

45 comments

  1. You mean this isn't Monty Python? by Anonymous Coward · · Score: 0, Funny

    Sorry, stumbled into the wrong item. No need now to get my hopes up about an entire conference of us going "Ni!" and arguing about unladen sparrows and testing our John Cleese impersonations.

  2. MovableType SPAMMING script!!! by (gnaa)RKZ · · Score: 0, Flamebait

    Python is great.
    import urllib
    import sys
    from whrandom import choice
    import string
    entryid = 2979
    cgiurl = "http://www.jayallen.org/cgi-bin/mt/mt-comments.cg i"

    message_text = """

    """

    def GenEmail():
    chars = string.letters
    username = ""
    hostname = ""
    for i in range(5):
    username = username + choice(chars)
    hostname = hostname + choice(chars)
    email = username + "@" + hostname + ".com"
    return email

    def GenWebsite():
    chars = string.letters
    site = ""
    for i in range(8):
    site = site + choice(chars)
    site = site + ".com"
    return site

    def RandomProxy():
    # high anonymity from 2004.01.06
    proxylist = ["http://213.131.72.19:8080/", "http://203.124.247.50:80/", "http://66.123.154.53:80/", "http://200.29.132.50:8000/"]
    rtnprox = choice(proxylist)
    return rtnprox
    def pseudoname():
    chars = string.letters
    name = ""
    for w in range(6):
    name = name + choice(chars)
    return name

    def rndmessage():
    chars = string.letters
    msize = [10, 15, 20, 25]
    wsize = [2, 4, 5, 6, 7, 8, 10, 12]
    message = ""
    for l in range(choice(msize)):
    for m in range(choice(wsize)):
    message = message + choice(chars)
    message = message + " "
    return message
    thisproxy = RandomProxy()

    for i in range(int(sys.argv[1])):
    proxies = {'http': thisproxy}
    opendev = urllib.FancyURLopener(proxies)
    par = urllib.urlencode(
    {
    'entry_id': entryid,
    'author': pseudoname(),
    'email': GenEmail(),
    'text': rndmessage(),
    #'text': message_text
    'post': " Post ",
    'checkbox': "false",
    'url': GenWebsite()}
    )
    f = opendev.open(cgiurl, par)
    print f.read(8096)

    --
    This shows how much of a non-issue spam is, and a small but loud minority shout about spam until their head explodes.
  3. uhm, I'm not going from Ruby to Python by Anonymous Coward · · Score: 4, Interesting

    Sorry, Python is a lot better than Perl but then again so's VB, eh?

    The Python community is turning into a bizarre mirror-image of the Perl community: full of themselves and a little too eager to show off the latest "trick" you can do in Python.

    I read Python books/sites and they say with a straight face "the great thing about Python is there's only one way to do things" .. what they fail to mention is, one way *per Python version*.

    I first used Python at 1.5 when it was pushed as a "prototyping language". I'm not coming back until they finish figuring out their object model and scoping rules.

    Someday, a bright Pythoner will get hit by lightning and realize, "hey, str(obj) just calls obj.__repr__() .. why the heck don't we all just call obj.__repr__() directly? And do we really need *four* underscores? And do we really need to type 'self' all the time???" At that moment, the Rubification will begin.

    Sincerely,
    Ruby Zealot

    1. Re:uhm, I'm not going from Ruby to Python by Anonymous Coward · · Score: 1, Insightful

      Unlikely. Why use Ruby or Python when Common Lisp is better than either. Like most scripting languages, python is slowly reinventing lisp, badly. This is no accident. Like Gosling and Java, van Rossum drip-feeds lisp concepts to his willing sheep rather than truly innovating.

    2. Re:uhm, I'm not going from Ruby to Python by Anonymous Coward · · Score: 0

      Lisp is like Perl for academics...

      I once peeked into a Lisp newgroup because it came up on a Google search I was doing on something about Perl. The poster displayed a paragraph of obfuscated Perl gobbledygook with non-alphanumeric variables, code that created strings that were eval'd and produced more code to eval after variable substitions, and a few other perl tricks.

      He then wrote how unreadable it was. Then he presented an example from a Lisp project he was working on.

      It was an equally incomprehensible mass of macros, and evals. He then praised his own code for being "elegant" and "readable". Followups agreed.

      I don't laugh out loud often when sitting at my computer, that was one of those rare moments.

      PS: Where's the Lisp in Java?

    3. Re:uhm, I'm not going from Ruby to Python by Anonymous Coward · · Score: 0

      It is incredibly unlikely that lisp code involving eval would be praised as elegant by a lisper. I call bullshit.

    4. Re:uhm, I'm not going from Ruby to Python by Tagren · · Score: 0

      len() looks somewhat more cleaner :)

      ---

    5. Re:uhm, I'm not going from Ruby to Python by Slash.ter · · Score: 3, Insightful

      I read Python books/sites and they say with a straight face "the great thing about Python is there's only one way to do things" .. what they fail to mention is, one way *per Python version*. I first used Python at 1.5 when it was pushed as a "prototyping language". I'm not coming back until they finish figuring out their object model and scoping rules.

      So you're saying Python evolves. Doesn't C, C++, Java, and ... Ruby do the same? It is easy to have many Python versions installed and usable at the same time. It is as easy to add packages to any of the installed versions. Is it easier to manage change in Ruby?

      Someday, a bright Pythoner will get hit by lightning and realize, "hey, str(obj) just calls obj.__repr__() .. why the heck don't we all just call obj.__repr__() directly? And do we really need *four* underscores? And do we really need to type 'self' all the time???" At that moment, the Rubification will begin.

      You're confusing 'str(obj)' with 'repr(obj)' but that's OK - you're Ruby Zealot. I think you're to picky and if I was as picky about Ruby, here's what I'm reading here : 'obj.__id__' is the same as 'obj#id' and 'obj.__send__' is the same as 'obj#send'. So not only that I see four underscores (was it borrowed from Python by any chance?) and two ways of doing the same (there are more examples on the web page) but there is another peculiarity: '#' has two meanings: you can use it as in 'obj#id' and you can use it to start comments!

      Now about 'self'. It comes from Smalltalk and Matz (creator of Ruby) claims that Ruby borrows ideas from Smalltalk. So I don't see your point. On top of that, you don't have to use 'self'. You can use 'this', 'that', and 'other' or even 'S' if you aim at brevity.

    6. Re:uhm, I'm not going from Ruby to Python by angel'o'sphere · · Score: 2, Informative

      Now about 'self'.

      Thats not correct. The parent poster is reffering to the fact that methods in Python have a argument called self, which you sometimes have to type, sometimes to declare, sometimes not.

      In SmallTalk self is a reference, like in Python, to the object the current running method belongs to, but you have never to type it except you need it.

      For the C++/Java folks, self is the equivalent of this. No one likes code like that: self.doThis(); self.doThat();

      Python is in some parts really brain deadly designed, e.g. the __init__(self) methods instead of CTORS like Java or C++. Class methods aka static methods are ugly as well. Prepending every method call with self is ugly ... and that is what the parent was talking about.

      Of course you can ahve several Python versions installed. I'm sure the parent knew that.

      But how should a class of PYthon 3.0 load a class from Python 1.0 over installatino boundaries? And why does Python evolve that uncoordinated?

      IMHO it would make sense to define now a Python 7.0, or something. And put everything into it you want, and then let the implementations evolve from the current point towards 7.0. So everyone knows what the final language will look like and kows that the current state is only an interims state.

      angel'o'phere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    7. Re:uhm, I'm not going from Ruby to Python by Eric+Desrosiers · · Score: 1

      I do not find that static method have any real uses in python. In C++, their main use is to be able to write a non friend function that has access to member of the class. I guess it also allows nicer grouping. In python, every function has access to member of the class because there are no access modifiers for members. Also, losts of classes are inside a module that has a name very close or similar to the class used. So, a function defined in the module is the same as a static method. self is a small burden, but I put that in the language quirks bag(like parentheses in lisp). I actually do use the this pointer in C++ and java if the editor has code completion but won't give me class members without an object. Constructors would be nice, but it's just syntactic sugar, even in Java or C++ I prefer that function with a name that describe the constructor wraps the real constructor. But, if you are looking for real ugliness in Python, just look at the properties. I really hope they will had prop_get and prop_set, prop_del keywords in the future.

    8. Re:uhm, I'm not going from Ruby to Python by Slash.ter · · Score: 3, Informative

      Thats not correct. The parent poster is reffering to the fact that methods in Python have a argument called self, which you sometimes have to type, sometimes to declare, sometimes not.
      I'm well aware of that. But 'self' is not a keyword. If you don't like to type it, use something shorter, say: 's'.
      I have no clue what you mean by "declaring" and "sometimes not". It is always there, it can be called differently. And you never declare things in Python.

      For the C++/Java folks, self is the equivalent of this. No one likes code like that: self.doThis(); self.doThat();
      Except when you have class member 'thing', method argument 'thing', and a local argument 'thing'. In C++ you can also have a global variable called 'thing'. You might argue that it's a bad style, but I've seen codes that do that and play tricks with undescores to sort out the mess. In short, in C++/Java you're allowed to be incosistent: 'thing' and 'this.thing' mean the same, sometimes. Python doesn't have to save keystrokes because it's relatively succinct. I like the 'self' idea because it defines the context for me without looking it up in other places. You don't like it and that's fine with me - that's life.

      But how should a class of PYthon 3.0 load a class from Python 1.0 over installatino boundaries?
      You just start Python 1.0 as a subbrocess of Python 3.0 process and have a proxy class in Python 3.0 to look like Python 1.0 class that communicates with the subprocess. A page or two of coding.
      And why does Python evolve that uncoordinated?
      I don't think it can be called uncoordinated - at best you may call the changes too big. The changes go through a well defined process - PEPs. And there is a vote. So in a sense you should blame the majority. Guido only breaks the ties. With Ruby it's Matz's opinion that matters read his opinions in an interview. He hinder Ruby's support for international encondings (see this post).

      IMHO it would make sense to define now a Python 7.0, or something. And put everything into it you want, and then let the implementations evolve from the current point towards 7.0. So everyone knows what the final language will look like and kows that the current state is only an interims state.
      You've just described what's called Python 3k. The idea has been entertained for a while on Python lists. The problem I have is that I cannot code for something that doesn't exist so I prefer to code for what's out there today. I guess it works for me and it doesn't for you - that's life.

  4. Someone told me by Anonymous Coward · · Score: 0

    Someone told me Lisp is faster and more powerful than Python, Perl and Ruby. Is he right?

    1. Re:Someone told me by Anonymous Coward · · Score: 1, Funny

      Maybe, but getting anywhere near Lisp means dealing with the Smug Lisp Weenies.

      Too bad, as Lisp is something worth learning (even if you never use it).

    2. Re:Someone told me by Anonymous Coward · · Score: 1, Informative

      There are multiple lisp implementations of varying quality. Common Lisp is a language standard like C++, not an implementation. Modern Lisp supports static type declarations as well as dynamic typing, so a good lisp compiler plays in the C++ space, not the scripting language space - only it's as easy to write in as a scripting language....

  5. Why would I want to convert from Ruby to Python? by Colonel+Panic · · Score: 3, Interesting

    Sure there are a lot of similarities, but I prefer Ruby's purer OO model and I don't prefer Python's whitespace as syntax requirements and the need to type self everywhere (not to mention all those underscores). And where's the fun in there's only one way to write it?

    Python definately has some advantages over Perl, but as a Rubyist, it doesn't offer me any advantages that would convince me to switch.

    'Different strokes for different folks' as they say down at the retirement center

  6. You're right by Anonymous Coward · · Score: 1, Informative

    This is from the Python page!

    Scheme has the following advantages to Python:

    * Supports proper closures, with lexical scoping.
    * Any function can be defined anonymously, via the lambda keyword.
    * Is supported by a standard (R5RS, IEEE)
    * Makes it easy to program in a functional style, i.e., without side effects.
    * Supports macros.
    * Mathematically oriented, rather then processor oriented, numeric model.
    * Supports fairly optimized compilation to native code.

    1. Re:You're right by axxackall · · Score: 1
      Makes it easy to program in a functional style, i.e., without side effects.

      For that I prefer Haskell, or at least ML.

      Supports fairly optimized compilation to native code.

      Even more reason to prefer OCAML.

      --

      Less is more !
    2. Re:You're right by Anonymous Coward · · Score: 0

      But unlike Haskell you don't HAVE to program in functional style with Common Lisp. You can if you want to.

      Similarly, a type-inferencing Common Lisp compiler like CMUCL or SBCL allows you to write in an ML-like statically typed style. But you don't HAVE to if you don't want to (though the basic type system of CL is strictly weaker than ML. it is however possible to do fuller static typing on top, too - see the (unfortunately nonfree) Qi.)

    3. Re:You're right by Anonymous Coward · · Score: 0

      Those are good languages too. And people are realizing it! They're moving from {Perl, Python, Ruby} to {Lisp, Haskell, ML}.

  7. D. Frickin' C. by Chromodromic · · Score: 2, Funny
    It's a great place to meet lots of smart people ...

    Gosh, this isn't biased. Well, I'm sure it is, in fact, one place to meet smart people, but I wish whomever was organizing this thing wasn't basing it in D.C., which is also a great place to get shot, spend money on mediocre food, either freeze to death or fry in ridiculous humidity, and generally hang out with interns working for lawyers, students wanting to become lawyers, or lawyers.

    Yeah, granted, the PyCon people will probably not be lawyers, but it is D.C. so you never know. And who decided D.C. was a likely meeting place for programmers? George Washington University? Yawn.

    At least Perl people go on cruises. Nah. Sign me up for the PyCon when they hold it in Vegas, like normal technology conventioneers, and we do Twisted seminars by day and other twisted things by night.

    --
    Chr0m0Dr0m!C
  8. Re:Why would I want to convert from Ruby to Python by GCP · · Score: 4, Interesting

    I like a *lot* of what I see in Ruby, and I strongly agree with your criticisms of Python (though I'm still undecided about the whitepace issue.)

    Even so, I think Matz's attitude about Unicode and internationalization rules Ruby out as a serious candidate for me.

    All Windows and Macs machines being sold today already use Unicode. The Unix world is in last place but the conversion is happening almost everywhere. The very last holdout against Unicode will probably be the Unix-style OSes in Japan. While all other platforms are Unicode and most of the Unix world is converted, they will be the last of the legacy holdouts.

    Japanese *nix is also the center of Matz's focus, and it shows. He has made it clear that the principal driving force behind Ruby's design is to help him do his own Japanese work in an encoding (EUC-JP) that he says is "good enough for me [him]". Since EUC-JP doesn't support anything well except for Japanese, he clearly doesn't internationalize his own work, and his comments make it pretty clear that anyone who does want to follow modern internationalization practices had better look elsewhere for a language.

    Also, the libraries in Ruby are far less developed than in Python, and I don't see them getting "good enough" anytime soon. Matz's Japanese Unix-centric community just hasn't produced the libraries that the rest of us are beginning to demand from our production languages.

    If I were just tinkering around with personal utilities and if legacy subset charsets were good enough for my text needs, then it might be all right. But I need lots of big, solid, production quality libraries for Unicode-based commercial systems, and Ruby isn't close. (Even Python is a stretch.)

    --
    "Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."
  9. Re:Call me... by Slash.ter · · Score: 1

    I've heard about ports of Python to the Perl's new bytecode called Parrot. Ruby to Parrot is called Cardinal .

    I don't know if it's a reason to wake up, though.

  10. DC is a pretty high-tech place by gtrubetskoy · · Score: 2, Interesting
    And who decided D.C. was a likely meeting place for programmers?

    All of the Python core team (including Guido until recently) live in DC. Granted, it's better if the conference was held in Vegas, on a cruise ship or in Monaco parhaps, but you're forgetting that the organizers of it are volunteers and do not get paid. The days when you could get a sponsor to shell out a few hundred grand to fly everyone to Vegas are gone.

    DC is home to places like NASA, NIST, NIH... Quite a few well known open source folk live out this way.

    I don't get out much these days, but before the .com craze, there were quite a few interesting places for programmers to meet. The DCLUG (past meetings) was one of them. I don't know what the status of the DCLUG is these days, but I remember Linus's talk in 95, this is way before most people even heard of Linux.

    1. Re:DC is a pretty high-tech place by DAldredge · · Score: 0, Offtopic

      NASA is mostly based out of Texas and Florida. Not all a lot of rockets in DC (save for the antiair one that protect our duly bought reps).

      NIH - Bah. Go to the CDC in Atlanta. That is where they keep all the really nasty stuff.

    2. Re:DC is a pretty high-tech place by be-fan · · Score: 1

      Don't come to Atlanta! Well, not unless you like bleak, concrete-encased, desolate, sparsely populated cities where getting run over by Escalades is a constant threat...

      --
      A deep unwavering belief is a sure sign you're missing something...
  11. Re:Call me... by Anonymous Coward · · Score: 0

    The Parrot folks are under some gross misunderstanding about the complexity of Python. Anyway, as long as they are having fun - let them revel in their collective dillusion. If you want a real speedup today (not 10 years from now) - check out the Psyco Python optimizer.

  12. Re:Why would I want to convert from Ruby to Python by Daleks · · Score: 2, Interesting

    Ruby2 will have Unicode support. Read this.

  13. Thanks. It seems to confirm my point. by GCP · · Score: 1

    If I could give you a mod point for the interesting pointer I would.

    One slide indicating that Unicode encodings may, at some vague point in the future, be treated on a par with the obsolete national legacy encodings Matz prefers is hardly a bold step toward internationalization. It's more of Matz's "well, if you want to use Unicode, I won't stop you" level of commitment to internationalization.

    --
    "Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."
    1. Re:Thanks. It seems to confirm my point. by Daleks · · Score: 2, Informative

      I think you misinterpreted the slide talking about Ruby 1.9.x. The odd numbered Ruby versions are the development track, while the even numbered versions are release caliber. Ruby2 will have Unicode support and Ruby1.9.x is where it will show up first. The lack of multilignual support is actually listed as a reason as to why Ruby currently stucks. This isn't half-assed support of Unicode.

  14. Re:Why would I want to convert from Ruby to Python by Shadowlore · · Score: 2, Insightful

    Why do you take the posting of a Python Conference as an attempt to get you to switch? Some of us happen to feel quite secure in our choices and don't take the success of other languages as a threat or conversion attempt. You should try it sometime, where "it" is being confident and secure in your own choices.

    --
    My Suburban burns less gasoline than your Prius.
  15. Re:Why would I want to convert from Ruby to Python by Colonel+Panic · · Score: 2, Insightful

    Why do you take the posting of a Python Conference as an attempt to get you to switch?

    Well, as you might recall, the original post of the story contained the following at the end:

    I want to talk to some Perl and Ruby zealots^Wconverts^Wprogrammers.

    So I was just obiging ;-)

    I suppose that sentence was a bit ambiguous as it could mean that he/she wants to talk to people who had converted* to Perl or Ruby from Python (or any other language), but I read it as he/she wanted to talk to people who had converted* from Perl or Ruby to Python. Given that it's a Python conference being held in DC, I highly doubt that anyone who had converted to Ruby would bother to show up for her/him to talk to as they would likely be attending Ruby conferences, therefore I suspect that the latter interpretation was the intended meaning. Given this, it was not too much of a stretch to think that the poster was looking for converts* from Ruby to Python, so I merely expressed my doubts about wanting (or needing) to make such a conversion*.

    *NOTE: the useage of the words 'convert' or it's derivitives ('conversion', 'converts', etc) should be construed to mean that that the language in question (as in 'I am a Ruby convert') is the favorite programming language known and used by the person uttering (or typing) the phrase, however it should not be contrued to mean that the language in question is the only programming language known/used by the person uttering (or typing) the phrase.

    If it's still not clear, I'll try it again with some indentation ;-)

    'Different strokes for different folks' as they say down at the retirement home

  16. whitespace delimitation by texwtf · · Score: 0

    There are those of us who think whitespace delimitation stinks, and for very valid reasons. Rather than be such zealots about how super whitespace delimiting is and how clueless the rest of the world is for not agreeing about it, why don't the python folks just code an option to make it available by e.g. a pragma at the top of a file? In my opinion, and that of many, many people, it's a show stopper. I really wish there wasn't so much zealotry in programming language design. That goes for all programming languages unfortunately.

    1. Re:whitespace delimitation by texwtf · · Score: 0

      Arrgh! HTML formatting by default bites! Here it is properly formatted.

      There are those of us who think whitespace
      delimitation stinks, and for very valid reasons.

      Rather than be such zealots about how super whitespace delimiting is and how clueless the rest of the world is for not agreeing about it, why don't the python folks just code an option to make it available by e.g. a pragma at the top of a file? In my opinion, and that of many, many people, it's a show stopper.

      I really wish there wasn't so much zealotry in programming language design. That goes for all programming languages unfortunately.

    2. Re:whitespace delimitation by hyperstation · · Score: 1

      why don't the python folks just code an option to make it available by e.g. a pragma at the top of a file?

      no way, cuz that would (very bluntly) really "fuck shit up". forcing style and good code formatting is for once forced into the language. why should good style be a "showstopper"?

      python gets a better rep than complete messes such as perl becuz of this. if you're gonna be hacking on someone's python code, you can be 90% certain that it's gonna be readable and understandable.

      it's not zealotry, it's the Right Thing, and it's a desire to put a dent in one of the fundamental problems regarding code portability and reuse: bad style.

  17. Parrot developers are very close by Anonymous Coward · · Score: 0

    to realizing that they are screwed in the Pie-thon challenge.

    Right now the Parrot folks are working on this opcode:

    PYTHON [python script]

    where it shells out to Guido's Python interpreter.

  18. Re:Why would I want to convert from Ruby to Python by alice_in_cipherland · · Score: 1
    I don't prefer Python's whitespace as syntax requirements

    I don't mean to offend you, but just curious: How do you feel when you use here documents, which include whitespace as syntax requirements?

  19. Re:GEDDY LEE IS ON TEH SPOKE by Anonymous Coward · · Score: 0

    What about the voice of Geddy Lee?
    How did it get so high?
    I wonder if he speaks like an ordinary guy?

    (I know him, and he does)

  20. Re:Why would I want to convert from Ruby to Python by wfolta · · Score: 1

    I think it's more than unicode...

    A while back I (a long-time perl guy) decided to look into ruby and python. I liked some of python's rethinking of certain ideas, but I liked ruby's total-OO and was really taken with it. BUT it was nearly impossible to find any English resources. It was definitely still a Japanese cult with some US initiates. So I stuck with perl.

    Maybe there are an abundance of resources for ruby now. (By "resources" I mean code examples, web sites, bundled packages, etc.) I'm not sure, but that is the BIG holdup in my opinion, not just an insular view on unicode.

    In terms of python... Two months ago I had a co-worker who was getting emails that confused their POP server, ending up in jammed messages. I wrote a perl script that would detect such messages and delete them.

    BUT I hadn't accounted for a certain buffering/length issue and the script broke a week ago. Since MacOS X comes with perl, python, and ruby installed, I decided to revisit python.

    Good online docs, a useful POP package (that allowed me to customize/override it in a very easy way), etc, and I wrote a python version that could not have the buffering issue, had better error checking, and took about 1/3 the number of lines.

    Python seems to me to be fairly clean in syntax and OO and it seems to truly deliver on its Batteries Included philosophy. Has ruby grown enough that it provides a similar support structure (accessible to me)?

  21. My take on Ruby and Python by wfolta · · Score: 1

    I've been a long-time Perl programmer, though I've not used a boatload of packages nor much of the horrid OO.

    A couple of years ago, I decided to look into Python and Ruby. Python looked OK, but not that different. I did like the indent-as-group idea, which was different. Ruby looked very cool. But it was impossible to get good documentation. It seemed like a Japanese cult with a few western initiates.

    Well, MacOS X ships with Perl, Python, and Ruby (and PHP, and ...) so I figured I'd try them again.

    I still find Ruby more intriguing, but I've settled on Python. Why?

    Well, Perl is an expedient measure that (for me) doesn't scale up and has that horrible OO syntax. (So I never used it much.) If you're going to read someone else's Perl, you had better be "in the zone".

    A couple of months ago, I'd written a quick Perl script that would "unstick" a co-worker's POP email. The problem is the Windows-based POP server is too stupid to realize a message doed not end in CRLF, so it just appends a period then CRLF thinking it's doing well. But the period ends up not being alone on a line, so it's not a valid termination to the message. Which messes up their email program. Sigh.

    A week ago, the script broke because I hadn't properly accounted for the fact that the user might have hundreds of messages queued up. (I hadn't used a Perl POP package, which might've handled it, but just threw it together myself. Yes, that would've made the Perl code more competitive with the other two solutions.)

    So I decided this might be a nice exercise to try Python. And it went together very quickly using Python's POP3 package. Then I decided to try it in Ruby. I think one little portion of the code shows the difference between the two cultures.

    The problem is that the message is not properly terminated, so you need to time out and catch that timeout to realize, "hmmm, malformed". In Python I had:

    M = poplib.POP3 ('172.16.30.1') ;
    M.user ('foo') ;
    M.pass_ ('bar')

    num_mesgs = len (M.list ()[1])
    bad_mesgs = 0

    for msg in range (num_mesgs):
    try:
    M.retr (msg + 1)
    ... blah blah...

    Hmmm, how do I get it to time out after 5 seconds and how do I catch that? The online docs are pretty good, but I had to guess that POP3 was built on the socket package. Looking at socket's docs I found the proper command and exception. I had to include:

    socket.setdefaulttimeout (5.0)
    before the POP3 commands to set the default socket timeout to 5 seconds. And
    except socket.timeout:
    is the proper way to catch the timeout. Both of these things are in the socket documentation.

    Contrast this with Ruby. The Ruby docs are less complete, but they did mention that POP was subclassed from protocol and you'd have to look at protocol's source to see how it works. Looking through protocol, I figured out what to do and it was more elegant.

    The protocol class had a read_timeout, but since Ruby's mantra might be said to be "Real OO", the POP code had been written such that you could say

    pop.read_timeout = 5
    after the POP open and it set the timeout for that pop connection to 5 seconds. Almost as if POP passed the read_timeout upstream to socket automatically. (I don't think Ruby does, but it's coded to look that way.)

    My experience is limited, but it feels like this example gives a good feel for the two languages. Python was better documented and things came together quickly. Ruby ultimately had a more elegant solution, but was more poorly documented. This echoes the mantras: Python's is "Batteries Included", while Ruby's might be "Real OO".

    On a personal note, I usually prefer an elegant solution, but when the language goes so far as to consider

    0.step(360, 45)
    to be reasonable, I check out. I know there's syntactic sugar so I don't have to code like that. I know everything's an object. But, dammit, a constant integer is an integer with constant value and causing it to iterate is too weird for my poor head to accept.