in reply to Perl fan being tempted with Python

Python is more OOPy, but its warts(*) make it too much of a putoff for me (IMHO). If you want a more "pure" OO language, I'd look at Ruby. I'm playing with it now (specifically Ruby on Rails) and I'm liking it much more than when I toyed with Python.

Either way you should try and pick up at least one of the two; it never hurts to be at least conversant in another language (more resumé fodder :) and it'll help you improve as a programmer to be familiar with another way of looking at problems.

(*) Things that specifically bugged me were:

I know that some of these have been addressed, but on the whole Python's still . . . *shudder*. Ruby's much more yummy.

--
We're looking for people in ATL

Replies are listed 'Best First'.
Re^2: Perl fan being tempted with Python
by chb (Deacon) on Jun 17, 2005 at 06:57 UTC
    Is that really true, closures will be removed from python (can you provide a link to Guido's statement?) If so, I would strongly advise against learning such a crippled language. To me it sounds stupid to remove such a important and basic high-level feature (that I use a lot (in lisp and perl), I might add).

      No, they're actually being added in a form inspired by Ruby's block mechanism (but with a wonky (IMHO) syntax, go figure). And I can't find an actual quote, but I'm in good company recalling that's how he felt (see this interview with MJD where he recounts something similar; last paragraph of his first response). My point was that I'm not hopeful for whatever implementation gets shoehorned on given the past view he's expressed towards the concept.

      --
      We're looking for people in ATL

      Is that really true, closures will be removed from python (can you provide a link to Guido's statement?)

      Last I heard Guido had proposed to remove lambda from Python earlier this year. Python does now have generators (aka coroutines) which makes its potential absence less of a pain.

Re^2: Perl fan being tempted with Python
by MonkOfAnotherSect (Sexton) on Jun 22, 2005 at 08:26 UTC
    Python only has semantic initial whitespace - most people find that it stops being painful after an hour or so. Unlike Ruby (at least it did the last time I looked) it doesn't have semantic whitespace in the middle of lines... If you don't want to pass spaces in on the command line, use "\t" instead.

    2.1 (with nested scopes) has been out since 2001.

    Your complaint about trailing commas being context dependent is just... silly. If you've a one element tuple, most people will wrap it in brackets for clarity.

    Except in a few specific cases, named functions are preferred to lambdas. You can have perfectly good named closures, just not perfectly good anonymous ones (you can do anything using lambdas, but the end result is pretty disgustingly unreadable).

    Blocks won't exactly be rubyish - they're to simplify resource allocation and release, and won't be used everywhere the way that ruby's blocks are.

    That said, I think it's fair to say that more Perl programmers will prefer Ruby to Python.

      Python only has semantic initial whitespace - most people find that it stops being painful after an hour or so.

      Indeed.

      Unlike Ruby (at least it did the last time I looked) it doesn't have semantic whitespace in the middle of lines...

      Where does Ruby have this? Never noticed it myself (which may be more of a comment on my observational skills ;-)

      Your complaint about trailing commas being context dependent is just... silly. If you've a one element tuple, most people will wrap it in brackets for clarity.

      Well, not silly exactly. While much Python is laudably clear, I also find the trailing comma convention for print/tuples vexing. Most languages train you to treat trailing commas as semantically insignificant. It took a long time to persuade my eyes to notice them in Python.

      No more annoying than many things in Perl though.

      It also illustrates one of the major differences between Python and Perl. In Python "tuple-ness" comes from the comma operator. In Perl "list-ness" comes from the list context of the expression. If you come to one language from the other it can be confusing either way. Python folk stare at the right hand side of the expression when they should be looking at the left in Perl. Perl folk stare at the left side and wonder where their @ symbols have gone :-)

      Except in a few specific cases, named functions are preferred to lambdas.

      True. But is that because named functions are better, or because the implementation of lambda sucks? The expression/statement distinction that applies to lambda and not named functions seems complicated and evil to me.

      Even if true removing anonymous functions just because they're not often appropriate doesn't seem like a good decision to me, and can lead to some pointless redundant naming of functions.

      That said, I think it's fair to say that more Perl programmers will prefer Ruby to Python.

      Yeah, that seems to be true in my experience.

        Where does Ruby have this? Never noticed it myself (which may be more of a comment on my observational skills ;-)
        It's minor (if you format your code properly... blah blah blah), but see here and here

        But is that because named functions are better, or because the implementation of lambda sucks?
        Oh, both ;-)