Python development time is faster.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Brat

    Python development time is faster.

    I've seen a few posts, columns and articles which state that one of the
    advantages of Python is that code can be developed x times faster than
    languages such as <<Insert popular language name here>>.

    Does anyone have any comments on that statement from personal
    experience?
    How is this comparison measured?


    Thanks
    Chris

  • Fredrik Lundh

    #2
    Re: Python development time is faster.

    Chris Brat wrote:
    I've seen a few posts, columns and articles which state that one of the
    advantages of Python is that code can be developed x times faster than
    languages such as <<Insert popular language name here>>.
    >
    Does anyone have any comments on that statement from personal
    experience?
    have you tried writing something in Python, or are you just asking around to
    see if it's worth the effort to download it and play with it a little?

    </F>



    Comment

    • Paddy

      #3
      Re: Python development time is faster.


      Chris Brat wrote:
      I've seen a few posts, columns and articles which state that one of the
      advantages of Python is that code can be developed x times faster than
      languages such as <<Insert popular language name here>>.
      >
      Does anyone have any comments on that statement from personal
      experience?
      How is this comparison measured?
      >
      >
      Thanks
      Chris
      Here's a start:


      Go Googling. There's a paper out their that compares error rates and
      time to program, lines of code, for several languages and is often
      cited in defence of scripting languages. (Scripting languages have
      however moved on and now like to be called dynamic languages).

      - Pad.

      Comment

      • Chris Brat

        #4
        Re: Python development time is faster.

        I work full time with Java, but downloaded python about a year ago and
        started playing.

        I've used it quite a few times in my working environment.

        Comment

        • Harry George

          #5
          Re: Python development time is faster.

          "Chris Brat" <chrisBrat@gmai l.comwrites:
          I've seen a few posts, columns and articles which state that one of the
          advantages of Python is that code can be developed x times faster than
          languages such as <<Insert popular language name here>>.
          >
          Does anyone have any comments on that statement from personal
          experience?
          How is this comparison measured?
          >
          >
          Thanks
          Chris
          >
          Personal experience takes two forms.

          1. Broad experience with languages, such that doing a single project
          in a new language gives a sense of the relative power and
          ease-of-use. Everyone I know who is a strong Python supporter took
          that route. There was an Ahh-Ha experience part way into the first
          project. This includes folks who could charitably be called
          curmudgeons, and people who are truely fluent in, say, C++ or Lisp.

          For these people the main success factor is that "it just works".
          You spend time on new functionality, or experimenting with
          alternative algorithms, not on debugging. Of course, we work in a
          regression-test-driven world, so we don't pile up a lot of untested
          code and then hope for the best. Python facilitates that
          test-early-test-often approach with its modularity and fast
          edit-run cycle.

          2. Write the same thing in 2 or more languages. Due to machine
          migrations and project redirections I have done that with
          perl-and-python, java-and-python, modula3-and-python,
          lisp-and-python. In all cases, python was the second language, so
          there is some learning curve to be adjusted for (i.e., I understood
          the semantics better). However, since I've done some
          perl-and-perl, and lisp-and-lisp, I can maybe make that adjustment.

          The result was that python was relatively faster-to-develop. I
          can't give a specific speedup factor, but I sure can say Python is
          now my default language. The success factors were:

          a) Once you get the hang of the language (a weekend?), you can
          write without reference to the manuals. Or if you do reference, it
          is a quick lookup. No struggling to figure out how to code
          something. Or to decypher what a line of code actually does.

          b) The project doesn't bog down as you add features. The language
          can accomodate new paradigms, patterns, or major functionality. If
          you do need to refactor, that is easy too.

          c) Peer code reviews are easy -- both you and the reviewers can
          understand the code's intent at a glance.


          --
          Harry George
          PLM Engineering Architecture

          Comment

          • Steven Bethard

            #6
            Re: Python development time is faster.

            Chris Brat wrote:
            I've seen a few posts, columns and articles which state that one of the
            advantages of Python is that code can be developed x times faster than
            languages such as <<Insert popular language name here>>.
            >
            Does anyone have any comments on that statement from personal
            experience?
            I had to work at a laboratory a few years ago which used Java
            exclusively. I was coming from several years as a graduate student
            using Python almost exclusively for my own work. (But I used to teach
            introductory Java classes at my previous university, so I had plenty of
            Java experience.)

            My own work and the work that I did for the lab were quite similar,
            mainly focused on training machine learning models on natural language
            processing tasks. I estimated that the Java code took me about 5x as
            long. Part of this is the verbosity of Java, e.g. where you have to
            write an anonymous inner class instead of using a function or a class
            object directly. But probably a larger part of this was using the Java
            libraries, which tend to be way over-engineered, and more complicated to
            use than they need to be.

            A simple example from document indexing. Using Java Lucene to index
            some documents, you'd write code something like::

            Analyzer analyzer = new StandardAnalyze r()
            IndexWriter writer = new IndexWriter(sto re_dir, analyzer, true)
            for (Value value: values) {
            Document document = Document()
            Field title = new Field("title", value.title,
            Field.Store.YES ,
            Field.Index.TOK ENIZED)
            Field text = new Field("text", value.text,
            Field.Store.YES ,
            Field.Index.TOK ENIZED)
            document.add(ti tle)
            document.add(te xt)
            }

            Why is this code so verbose? Because the Lucene Java APIs don't like
            useful defaults. So for example, even though StandardAnalyze r is
            supposedly *Standard*, there's no IndexWriter constructor that includes
            it automatically. Similarly, if you create a Field with a string name
            and value (as above), you must specify both a Field.Store and a
            Field.Index - there's no way to let them default to something reasonable.

            Compare this to Python code. Unfortunately, PyLucene wraps the Lucene
            APIs pretty directly, but I've wrapped PyLucene with my own wrapper that
            adds useful defaults (and takes advantages of things like Python's
            **kwargs). Here's what the same code looks like with my Python wrapper
            to Lucene::

            writer = IndexWriter(sto re_dir)
            for value in values:
            document = Document(title= value.title, text=value.text )
            writer.addDocum ent(document)
            writer.close()

            Gee, and I wonder why it took me so much longer to write things in Java. ;-)


            STeVe

            Comment

            • George Sakkis

              #7
              Re: Python development time is faster.

              Steven Bethard wrote:
              A simple example from document indexing. Using Java Lucene to index
              some documents, you'd write code something like::
              >
              Analyzer analyzer = new StandardAnalyze r()
              IndexWriter writer = new IndexWriter(sto re_dir, analyzer, true)
              for (Value value: values) {
              Document document = Document()
              Field title = new Field("title", value.title,
              Field.Store.YES ,
              Field.Index.TOK ENIZED)
              Field text = new Field("text", value.text,
              Field.Store.YES ,
              Field.Index.TOK ENIZED)
              document.add(ti tle)
              document.add(te xt)
              }
              >
              Why is this code so verbose? Because the Lucene Java APIs don't like
              useful defaults. So for example, even though StandardAnalyze r is
              supposedly *Standard*, there's no IndexWriter constructor that includes
              it automatically. Similarly, if you create a Field with a string name
              and value (as above), you must specify both a Field.Store and a
              Field.Index - there's no way to let them default to something reasonable.
              >
              Compare this to Python code. Unfortunately, PyLucene wraps the Lucene
              APIs pretty directly, but I've wrapped PyLucene with my own wrapper that
              adds useful defaults (and takes advantages of things like Python's
              **kwargs). Here's what the same code looks like with my Python wrapper
              to Lucene::
              >
              writer = IndexWriter(sto re_dir)
              for value in values:
              document = Document(title= value.title, text=value.text )out two
              writer.addDocum ent(document)
              writer.close()
              >
              Gee, and I wonder why it took me so much longer to write things in Java. ;-)
              Oh, the memories... I went down the same road about two years ago,
              though I didn't know about PyLucene at the time and wrapped in jython
              the parts of Lucene I used... never bothered to deal with java's
              verbosity after that. It's a pity that jython resembles abandon-ware
              these days, when jRuby showed up pretty recently and is gaining in
              penetration with the java crowd. It will be a non-trivial loss for
              python if it is left behind in the JVM world (at least if the latter is
              not swallowed by the .NET dark forces, which doesn't seem to happen any
              time soon ;-).

              George

              Comment

              • Diez B. Roggisch

                #8
                Re: Python development time is faster.

                Oh, the memories... I went down the same road about two years ago,
                though I didn't know about PyLucene at the time and wrapped in jython
                the parts of Lucene I used... never bothered to deal with java's
                verbosity after that. It's a pity that jython resembles abandon-ware
                these days, when jRuby showed up pretty recently and is gaining in
                penetration with the java crowd. It will be a non-trivial loss for
                python if it is left behind in the JVM world (at least if the latter is
                not swallowed by the .NET dark forces, which doesn't seem to happen any
                time soon ;-).
                I wouldn't consider jython abandonware. It is under active development, and
                I'm using a 2.2 alpha successful for quite a while now - which usually
                serves my needs.

                The problem is/was that new-style classes were a major hurdle to take, and
                this now seems to be conquered. So lets hope (or contribute code....:P)
                that jython will see a 2.4 version ASAP.

                diez

                Comment

                • Egon Frerich

                  #9
                  Re: Python development time is faster.

                  Chris Brat schrieb:
                  I've seen a few posts, columns and articles which state that one of the
                  advantages of Python is that code can be developed x times faster than
                  languages such as <<Insert popular language name here>>.
                  >
                  Does anyone have any comments on that statement from personal
                  experience?
                  How is this comparison measured?
                  >
                  >
                  Thanks
                  Chris
                  >
                  >
                  Have a lookl at

                  Comment

                  • flit

                    #10
                    Re: Python development time is faster.

                    One thing I really like, is making "prototypes " on python.
                    Just to test some algorithm or procedure.
                    It is very fast and easy to debug.
                    So after, I make it in c++ (but not too much often, I leave it in
                    python today.)

                    Chris Brat wrote:
                    I've seen a few posts, columns and articles which state that one of the
                    advantages of Python is that code can be developed x times faster than
                    languages such as <<Insert popular language name here>>.
                    >
                    Does anyone have any comments on that statement from personal
                    experience?
                    How is this comparison measured?
                    >
                    >
                    Thanks
                    Chris

                    Comment

                    • Stefan Behnel

                      #11
                      jython's future (was: Python development time is faster.)

                      Diez B. Roggisch wrote
                      I wouldn't consider jython abandonware. It is under active development, and
                      I'm using a 2.2 alpha successful for quite a while now - which usually
                      serves my needs.
                      >
                      The problem is/was that new-style classes were a major hurdle to take, and
                      this now seems to be conquered. So lets hope (or contribute code....:P)
                      that jython will see a 2.4 version ASAP.
                      The jython project currently deploys a pretty cathedral-ish development style,
                      pretty much hidden from broader audiences. FWIW, it seems to be stuck in
                      trying to get out a 2.2 compliant release first, then to provide a 2.3
                      compliant version (at least, there's a branch for it). Guess it's a question
                      of human resources, but personally, I wouldn't care too much about
                      compatibility and just let people go and implement whatever feature they want
                      to be in on the way towards something as close to 2.5 (or maybe 2.4, why not)
                      as possible. Honestly, how many important Python modules do still run on 2.2?
                      Most switched to at least 2.3 quite a while ago.

                      After all, it's the compatible *software* that makes the difference, not the
                      platform. It's easier to say: "hey, this feature is lacking to make my program
                      run" than: "let's see, what else is there in that outdated specification to
                      implement?". And it's a lot more encouraging, too.

                      Just my little rant on this one ...

                      Stefan

                      Comment

                      • Carsten Haese

                        #12
                        Re: jython's future (was: Python development time is faster.)

                        On Mon, 2006-11-13 at 18:34 +0100, Stefan Behnel wrote:
                        Honestly, how many important Python modules do still run on 2.2?
                        InformixDB still compiles on 2.2 except when I accidentally temporarily
                        break backwards compatibility.

                        Of course it's a matter of opinion whether it qualifies as an important
                        module. ;-)

                        -Carsten


                        Comment

                        • Steve Holden

                          #13
                          Re: jython's future

                          Carsten Haese wrote:
                          On Mon, 2006-11-13 at 18:34 +0100, Stefan Behnel wrote:
                          >Honestly, how many important Python modules do still run on 2.2?
                          >
                          InformixDB still compiles on 2.2 except when I accidentally temporarily
                          break backwards compatibility.
                          >
                          Of course it's a matter of opinion whether it qualifies as an important
                          module. ;-)
                          >
                          I think you will find that most of Fredrik Lundh's stuff will work on
                          1.5.2. He sets a fine example to us all.

                          regards
                          Steve
                          --
                          Steve Holden +44 150 684 7255 +1 800 494 3119
                          Holden Web LLC/Ltd http://www.holdenweb.com
                          Skype: holdenweb http://holdenweb.blogspot.com
                          Recent Ramblings http://del.icio.us/steve.holden

                          Comment

                          • Łukasz Langa

                            #14
                            Re: jython's future

                            Steve Holden:
                            I think you will find that most of Fredrik Lundh's stuff will work on
                            1.5.2. He sets a fine example to us all.
                            >
                            1.5.2? Come on, it's 7 years old. Back then PHP was still at 3.0, Java
                            was at 1.2 (and compiling Hello World took over 5 minutes), Google was
                            nothing more than a search engine (still Beta at the time!).

                            What do we have all these cool new language features for if it's
                            considered bad behaviour to actually use them?

                            OK, I see the point in being compatible with Python 2.1 (well, maybe 2.2
                            with new-style classes and __descriptors__ ), just like it's still useful
                            to be Java 1.4 compatible and PHP 4 compatible.

                            But Python 1.5.2? From the official site: "*Do yourself a favor* and get
                            a more recent version!" ;-) It doesn't even have string methods. Today
                            Python 1.5.2 is being implemented on one-chip GSM modules (
                            http://www.telit.co.it/product.asp?productId=96 ). And yes, it actually
                            works quite well there :-)

                            Regards,
                            Łukasz Langa

                            Comment

                            • Steve Holden

                              #15
                              Re: jython's future

                              Łukasz Langa wrote:
                              Steve Holden:
                              >I think you will find that most of Fredrik Lundh's stuff will work on
                              >1.5.2. He sets a fine example to us all.
                              >>
                              >
                              1.5.2? Come on, it's 7 years old. Back then PHP was still at 3.0, Java
                              was at 1.2 (and compiling Hello World took over 5 minutes), Google was
                              nothing more than a search engine (still Beta at the time!).
                              >
                              What do we have all these cool new language features for if it's
                              considered bad behaviour to actually use them?
                              >
                              OK, I see the point in being compatible with Python 2.1 (well, maybe 2.2
                              with new-style classes and __descriptors__ ), just like it's still useful
                              to be Java 1.4 compatible and PHP 4 compatible.
                              >
                              But Python 1.5.2? From the official site: "*Do yourself a favor* and get
                              a more recent version!" ;-) It doesn't even have string methods. Today
                              Python 1.5.2 is being implemented on one-chip GSM modules (
                              http://www.telit.co.it/product.asp?productId=96 ). And yes, it actually
                              works quite well there :-)
                              >
                              And thanks to Fredrik there's a chance you'll be able to use PIL there.

                              regards
                              Steve
                              --
                              Steve Holden +44 150 684 7255 +1 800 494 3119
                              Holden Web LLC/Ltd http://www.holdenweb.com
                              Skype: holdenweb http://holdenweb.blogspot.com
                              Recent Ramblings http://del.icio.us/steve.holden

                              Comment

                              Working...