Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Programming IT Technology

Guido van Rossum on Programming at Python Speed 27

Bill Venners writes "In this interview, Python creator Guido van Rossum states: 'I'm not particularly worried by the fact that people say you can prototype more easily in Python, but eventually the Java version makes it easier to build a robust large system. You can prototype in Python. Once you've explored the space more, you can do the planning and design that the Java version requires. If you start writing in Java knowing as little as you did when you started writing the Python version, you'll waste way more time exploring than actually building the system you'll eventually build.'"
This discussion has been archived. No new comments can be posted.

Guido van Rossum on Programming at Python Speed

Comments Filter:
  • So? (Score:4, Interesting)

    by sporty ( 27564 ) on Monday January 27, 2003 @09:06AM (#5167001) Homepage
    If you start writing in Java knowing as little as you did when you started writing the Python version, you'll waste way more time exploring than actually building the system you'll eventually build.


    Whoa there. There's a neat thing with prototyping and keeping your prototype away from your final system, from start to finish. The purpose of prototyping is to get a somewhat usable, testable application without developing it in it's entirety. It may not give you all the real data, and hell, all the functionality may not be accessable from the multiple points you put it, but you get a good feel of what you want.

    Now your end product should be clean, well thought out. It should have no design artifacts from your prototype, because after all, your prototype is meant to bring out the good of a project and leave behind the bad. Code and design artifacts from the bad are just bugs to learn from and not to repeat.

    If you still disagree, think of your prototype as a rough draft. You read it, you poke at it, you get a feel for it. Then you write the real thing.

    As for what languages you use, you'd use a faster to develop in language first, which is robust, and your intended one later. Prototyping in java and moving to python won't be bad since you can develop in either relatively quickly. It's the planning of what you wanna do is a bitch.
    • Re:So? (Score:4, Insightful)

      by Phouk ( 118940 ) on Monday January 27, 2003 @11:10AM (#5167645)
      Prototyping in java and moving to python won't be bad since you can develop in either relatively quickly.

      I disagree there. Python is much better suited to prototyping than Java, for two reasons:
      • As GvR correctly says, there's simply more text to type in Java, to a large part because of the overhead of Java's static typing (aka "keeping the compiler happy"), but also because Python is slightly more high-level than Java.
      • The Python code will be much more malleable and easy to change around and refactor, for the same reason that you won't have to adapt all your type declarations to keep the compiler happy. On the other hand, all those declarations that make the Java solution harder to change, are the exact same thing that makes it more robust for large programs / team development. You can't have it both ways.
      • As GvR correctly says, there's simply more text to type in Java, to a large part because of the overhead of Java's static typing (aka "keeping the compiler happy"), but also because Python is slightly more high-level than Java.


        To each, their own language. I'm not saying python isn't a good language for prototyping, nor am I saying developing in java is either. Whatever language you can bring up a prototype faster, the better.

        Flash anyone? :)

        The Python code will be much more malleable and easy to change around and refactor, for the same reason that you won't have to adapt all your type declarations to keep the compiler happy. On the other hand, all those declarations that make the Java solution harder to change, are the exact same thing that makes it more robust for large programs / team development. You can't have it both ways.


        I dunno about that. There are lots of tools to speed you up in java just as there are lots of tools in other languages (I can't speak for python) that make it more.. enterprise level.

        As I say, to each their own. I do a lot of stuff pretty quickly in java. But mind, you, it's right tool for the right nail, so no, I don't do EVERYTHING in java.. just lots.
      • Re:So? (Score:4, Informative)

        by scrytch ( 9198 ) <chuck@myrealbox.com> on Monday January 27, 2003 @03:43PM (#5169235)
        As GvR correctly says, there's simply more text to type in Java, to a large part because of the overhead of Java's static typing (aka "keeping the compiler happy"), but also because Python is slightly more high-level than Java.

        Once I discovered Ocaml, I found out that you can have both strong typing at compile time, without having to actually use types (but I can if I want to). I can have polymorphism without inheritance trees (again I can if I want to), and I can have interfaces without interface keywords (and I have pattern matching if I want it). Actually I found this in Haskell, but I just can't wrap my brain around monads ... different story.

        Type inference really is the best of both worlds. I just can't go back to the 1960's compiler technology of explicit typing anymore. Sometimes I have to, but I complain all the way.
    • Not necessarily true.

      If you start building your prototype with solid testing [junit.org] and you apply effective refactoring [refactoring.com] your little prototype can grow into a solid and clean system.

      Java has great tools for these jobs (junit and eclipse), but you can find similar tools for almost every other language. Give them a try.

      Fh
      • True, you can get the code that is used to be non-buggy, but there's a big problem... when you have unused code, "fixme"'s and irrelevant "stuff" in your finished product.

        unit is a tool for making sure your code works from the ground up, and easy regression testing of your base, and to some extent, non-base code. Refactoring is only good once you have enough code, where you wish to change design. Both are invaluable regardless if you prototype or not.

        There is one key thing, one key advantage to prototyping in the destination language of your product. You can literally steal code from your prototype and inject into your finished product. Nothing is wrong with maintaining your two codebases, as your prototype eventually can be thrown away with little cost. After all, you did develop your prototype seperately. While evolutionary design may work well for the diliegent of keeping their code clean, it can lead to irresponsible artifacts being left behind.

        Granted, each has their place. For small projects, nothing is wrong with evolutionary design. For some big projects too. You just have to be very careful.
        • Our philosophy at Elcod goes like 'if that piece of code is not doing anything useful, just wipe it out'. A versioning system (CVS for us) should take care of cases where you don't want to delete something because there is a remote probability that you may use it later.

          Anyway, I'm surprised every time I see a supposedly mature software development shop that doesn't use something similar to CVS. And I've seen more than a few, in fact, most of them around here.

          Fh
    • by ChadN ( 21033 )
      One can prototype in Python, then have that code running in Java (using Jython), if you choose to migrate over to Java after the prototyping stage. So code reuse is doable.
      • There's a problem with that if you keep your prototype and production code the same if you are not using evolutionary design.

        • by ChadN ( 21033 )
          I'm saying you can rewrite parts, or slowly rewrite all of the code, in Java, while still using the non-rewritten Python parts.

          You can even continue to extend the design in Python, while rewriting parts in Java (perhaps for speed, perhaps to make use of Java libraries, etc.)
          • Yeah.. I'm not a fan of evolutionary design. It bites you back in the end if you are either too lazy to rewrite, too busy, or things work (don't fix it).
  • by ubiquitin ( 28396 ) on Monday January 27, 2003 @09:08AM (#5167008) Homepage Journal
    Step 1: Call it a prototyping language so you get everyone using it but not having great expectations or concerns about liability if it doesn't perform perfectly.

    Step 2: Release early. Release often. Fix bugs like it is going out of style and respond to solid feature requests from users. Grow your userbase beyond early adopters. Promote developer adoption by making what they create available in repositories.

    Step 3: A few years go by, and you have enough features that you can claim that it is no longer just for prototyping.

    See a pattern: Perl did the same thing. PHP is doing it too.

    I don't think java ever went through this cycle, though, which makes me suspicious of it. The claim seems to be that ten bearded guys at Sun replaced step 2. Yes, there is more to good technology than grass-roots popularity, but when the grass-roots tools will get the job done, get it done securely, and get it done with high availability, what's the point?
  • C and Assembly (Score:3, Interesting)

    by Koos Baster ( 625091 ) <ghostbusters@NOspam.xs4all.nl> on Monday January 27, 2003 @09:23AM (#5167069)
    True. The same holds for C and assembly: Development in a "higher level language" is faster but may lead to less efficient code compared to a "lower level language" on an elementary level. Allegedly, holding on to assembly is what (almost) caused WordPerfect's death, while Microsoft's usage of C definitely gave them a head start with the development of new features in Word.

    (Concerning C/ass I'm not sure about robustness. With Python/Java this issue is more evident, since robustness was one of Java's design goals.)
  • by lal ( 29527 ) on Monday January 27, 2003 @09:54AM (#5167214)
    Read the whole article. A few paragraphs later, Guido details two real-world examples where python was used to create working prototypes for eShop and Yahoo Mail. After a few months of production deployment of those apps, the python code was replaced with C++.

    IMO, this is a much better approach: Write a decently architected python (perl/php) app that meets the customer requirements. Then, and only if performance is an issue, replace pieces of the app with C/C++. I don't see where Java enters into the picture.
    • by Phouk ( 118940 ) on Monday January 27, 2003 @10:59AM (#5167583)
      There's two kinds of prototyping: Evolutionary and exploratory.

      In evolutionary prototyping you develop a quick but not so dirty small version of the program (release early and all that), and then keep refactoring it to improve design, and keep tuning it to improve performance, while adding features. Python + Swig + C for performance-critical parts is, as you say, a good combination for that.

      In exploratory prototyping, you first quickly hack out one version of your program to learn about the user's real requirements, demo it to investors, find out about the consequences of architectural choices and so on. When you know what you want, and that it's worth the effort/money, you throw away your prototype and start work on an industrial-strength solution. Prototype in Python, final implementation in Java would be a "modern" combination for that.

      That's why the Java comment is not out of context.
      • There's no such thing as "evolutionary prototyping", that's an oxymoron. Yes, you can (and should) do evolutionary, incremental development, but if you think you can take a prototype and turn it into a final implementation with a few iterations, then you will get burned. Netscape fka Mosiac is an excellent example of what happens you attempt to slipstream your prototype code into the final version.

        The only activity that is can be called prototyping is exploration, where you knock out something to explore a particular problem space, and use what you learned to go by and build your production version.

        But don't take my word for it, examine the pre-Gecko Netscape source.
    • by Anonymous Coward
      Me, I'd just write a decently architected Common Lisp app, and then add some type declarations to make it a decently architected and high-speed Common Lisp app...
    • Better yet. Replace pieces of the app with C/C++ modules that can be accessed from within python. Use C/C++ only as a faster-implementation of a module.
  • by MonTemplar ( 174120 ) on Monday January 27, 2003 @10:00AM (#5167237) Homepage Journal
    Bad choice of words, surely, given that pythons are large constrictor snakes, not noted for their swiftness... :)
  • Shades of Lisp.. (Score:3, Interesting)

    by Vector7 ( 2410 ) on Monday January 27, 2003 @08:29PM (#5171077) Journal
    Funny, this is the exact argument LISP programmers have been making for the last fifteen years.. Python has long been accused of progressively stealing more and more of LISP, but given LISP's current commercial success (or lack thereof) I might argue against also immitating its advocates.. ;)

    [disclaimer: I am not disparaging either LISP or Python, in fact Common Lisp is my favorite language, I'm simply pointing out that I've heard this argument before]
  • by Anonymous Coward
    While working on a C++ project for BeOS, I prototyped it in Python using the Bethon BeAPI bindings. Took me about 2 hours to get the GUI done, tested and ready for C++.

    Python is a great prototyping language. Fast, stable, good debugging abilities, etc. But it's also good for other things. Dont market it as a prototyping language! It's not just for that.

He has not acquired a fortune; the fortune has acquired him. -- Bion

Working...