Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Programming Technology

The Python Paradox, by Paul Graham 726

GnuVince writes "Paul Graham has posted a new article to his website that he called "The Python Paradox" which refines the statements he made in "Great Hackers" about Python programmers being better hackers than Java programmers. He basically says that since Python is not the kind of language that lands you a job like Java, those who learn it seek more than simply financial benefits, they seek better tools. Very interesting read."
This discussion has been archived. No new comments can be posted.

The Python Paradox, by Paul Graham

Comments Filter:
  • Learning (Score:4, Interesting)

    by Klar ( 522420 ) * <curchin@g[ ]l.com ['mai' in gap]> on Thursday August 12, 2004 @03:44PM (#9951693) Homepage Journal
    And people don't learn Python because it will get them a job; they learn it because they genuinely like to program and aren't satisfied with the languages they already know.
    Well, not 100% true in all cases. For our major programming assignment in 2nd year, we were required to create a library in C, then impliment it and add some more functionality by using Python. This forced us to learn the language on our own. Which was a really good experience, and I really liked the language. I think more people who are java programmers should be trying Python for smaller programs, cause I was able to pump small programs out much faster than with Java..
  • by gtrubetskoy ( 734033 ) * on Thursday August 12, 2004 @03:45PM (#9951708)
    I like Python because I can figure out what's going on. If you know C, then it is not hard to trace what happens at the lowest levels since the C-Python is written in a remarkably clean C and very well documented. So it's a simple, powerful, easy to read language where you have some assurance of being able to track down most problems. My experience with Java was quite the opposite - every Java book I read always had mysterious claims about threads, JVM, synchronization, garbage collection that seemed like some sort of "insider knowledge" and I was expected to just believe it. So I think it's not just about the language itself as much as it is about the implementation; for me at least.
  • by wallclimber21 ( 563789 ) * on Thursday August 12, 2004 @03:47PM (#9951724)
    We used to script most of our processes (digital chip design) with Perl. In reality, only a few people really bothered automating boring tasks. At one point I started writing everything in Python because of all the good reasons (readability, easy to learn and MUCH easier to maintain later on) and gradually spread the gospel. As very nice side effect is that my collegues are much more likely to get their hands dirty themselves and write scripts with it's useful. Anyway, as for the article: I think a language shouldn't only be beautiful in the way it allows one to express intent, but also or even much more so in the way it looks esthetically. This is one of the biggest problems I have with Lisp (after reading Paul Graham's other articles, I bought this ANSI Common Lisp Book and printed out out 'On Lisp'). It's a fascinating language, but it looks to incredibly dense. Sigh.
  • Python vs Java (Score:4, Interesting)

    by Dimwit ( 36756 ) * on Thursday August 12, 2004 @03:47PM (#9951730)
    I think the main reason I write so much stuff in Python and pretty much nothing in Java is simple: Open source and comprehensive standard library.

    When I did have to write something in Java - well, better hope you have the right API. Oh, and what's the difference between the 3587324 different XML parsing packages? Oh and download Java Super Micro PDA Library! Only available for Solaris and Windows!

    The promise of "write-once-run-anywhere" was pretty much dead. Not that I was even going for portability - I just wanted it to run on Linux. And I wanted to do it without having to download Beans, Java DynamicManagement, Java Metadata, ad nauseum.

    Python, on the other hand, simply works. Sure, it doesn't have a standard GUI toolkit (although wxPython is pretty much the de facto standard now...), but it does everything I need it to do. With a clean, nice syntax, no less.

    Oh, and I still don't get how Java doesn't let you write a freakin routine to get the permissions on a file without resorting to writing a C function. Sure, it's not "portable", but just do what Perl and Python have done - on platforms with no permissions, return a sane default value. Don't just NOT include the function at all...

    Anyway, forgive my rant. Python - good standard library. Java - tons of confusing frameworks and platforms, etc, etc.
  • cover all the bases! (Score:2, Interesting)

    by MarkEst1973 ( 769601 ) on Thursday August 12, 2004 @03:48PM (#9951737)
    and learn to use Jython [jython.org]!

    You can put Java on your resume to get the job, and then use Python to glue components together!

    All kidding aside, I am currently working on a pretty complex java project. I've written various small programs as utilities, and these programs would have been better off as scripts accessing some of the java classes I had already written.

    The downside of java -- in this circumstance --- was having to deal with classpath and compiling cycles and whatnot. What I really wanted was to write the program/script easily, have it leverage what I had already done, and not bloat the resulting .jar files with little utility programs that would be better off as scripts.

    I learned Python a little too late for this project, but you can bet your ass Jython will be embedded in my next.

  • by tcopeland ( 32225 ) * <tom AT thomasleecopeland DOT com> on Thursday August 12, 2004 @03:49PM (#9951744) Homepage
    Nicely put. Ruby:
    collection.each {|x| do_something(x) }
    or Java?
    for (Iterator i = collection.iterator(); i.hasNext();) {
    do_something((SomeType)i.next());
    }
    Given the choice, I'll go with Ruby [ruby-lang.org]...
  • Google agrees. (Score:1, Interesting)

    by Anonymous Coward on Thursday August 12, 2004 @03:50PM (#9951766)
    Paul's page http://www.paulgraham.com/gh.html Used to say

    "[2] When Google advertises Java programming jobs, they cleverly require Python experience."

    Even though Paul deleted it, you can still see lots of revfference to it, thanks to Google [google.com]

  • by MSBob ( 307239 ) on Thursday August 12, 2004 @03:54PM (#9951818)
    Well, all I can say to Paul is "you're wrong". Java developers tend to stick with Java not because they are in mad love with Java the language but because they recognize that Java is bigger than the sum of its parts.

    The immense number of system and third party libraries is what keeps most Java developers coding Java. The close second is Java developer's tools. Until there is an IDE for Python that's as extensive, capable and sophisticated as Eclipse I'm going to stay with Java. Most Java development is in the enterprise server side space and the sheer amount of tools that Java offers is just mind boggling.

    Also us, enterprise developers tend to work in environments that are much more conservative from the technology standpoint (banking, insurance, brokerage). As far as I'm concerned it's a big win for us that we got Cobol elbowed out with Java. Trying to push the language of the month at those executives will cause us more harm than good.

    I know that Python has some very nice features (I read the tutorial) but it's hardly the sort of paradigm shift that merits ditching Java and rewriting everything because of some neat syntax flavoring. Besides Java is hardly a frozen language and we have some exciting stuff coming down the pipe here. JDK 1.5 will introduce shared VM model which may make java compeling on the desktop, more elaborate iterators, annotations (my favourie in 1.5), and generics (although without primitive types support they are kinda lame).

    Java is now frequently used in CS research as well. It looks almost certain that the next milestone in CS evolution will come in the form of Aspect Oriented Programming and AspectJ has been the leading implementation.

    Sometimes it feels that Paul G. just has an ax to grind into the collective Java community but I wonder how closely did he actually look at Java before dismissing it?

  • The Java Problem (Score:3, Interesting)

    by Ridgelift ( 228977 ) on Thursday August 12, 2004 @03:56PM (#9951837)
    I'm a Python programmer. I never learned Java because I heard so many people complain about how many books and reference materials they need just to get things done.

    What I don't understand is why I even need Java? Jython let's me do pretty much everything Java can do, in a language that is a lot simpler that "fits in my head", not fits in a huge bookshelf. Sure I still need to know a bit about Java classes and such, but it's a lot less work than my friends who program in Java have to do. I feel sometimes like I'm watching people hike up to the top of a mountain every day, while I just take a 4x4 and get to the same place, but get there faster and with a lot less sweat and effort.

    Can anyone who codes both in Python and Java educate me?
  • Why I like Python (Score:3, Interesting)

    by brunson ( 91995 ) * on Thursday August 12, 2004 @03:59PM (#9951875) Homepage

    I like python because it allows you to modify the behavior of the language constructs. It gives you hooks into what happens when you say 'print myvariable' or what goes on when you retrieve 'mydict[ "something" ]'.

    Much like operator overloading in C++, this allows you to write in the language of the problem, rather than the language of the language. So, if you're dealing with dates you can overload the minus operator to calculate the time between two dates when they are subtracted. Or if you are dealing with complex numbers your operators do the right thing when you add a complex and a real.

    Similarly, in Python you can create a database search object that behaves like an associative array. So, customer_id_search[ 10 ] goes to the database, retrieves the record for customer_id 10 and returns a DAO to be manipulated.

    Iterators and many other constructs help you in writing clear, concise, MAINTAINABLE, extensible and reusable code by allowing you to code clearly in the language of the problem you are trying to solve.

    Python Rules, Perl Sucks. ;-)
  • Excellent article (Score:3, Interesting)

    by Chuck Bucket ( 142633 ) on Thursday August 12, 2004 @04:02PM (#9951924) Homepage Journal
    Paul's Python summation is brilliant. As a Perl programmer who is embracing Python programming (for interest in *learning a better tool*...), I found his article to be the single most useful document on the internet about getting started with Python. Comparing structures to other languages helped greatly.

    By looking at the article I was able to quickly gauge the amount that I need to learn to learn basic Python... needless to say, it will not be a very far stretch. I am sure that I have a lot to learn, but this easily cut weeks of trial and error off of my learning curve. I can't thank him enough. I am excited.

    CVB(Neil P. Davis)
  • by StressGuy ( 472374 ) on Thursday August 12, 2004 @04:03PM (#9951926)
    I'm not a programmer, I'm just an engineer who can do impressions when he has to. This language is relatively simple and organized and, with the growing number of math and scientific libraries available, it's becoming more and more a regular tool in my arsenal.

    I guess the point I'm making is that this language has a strong appeal to people like myself who are just looking to use it to solve problems and/or make problem solving tools. I don't know anything about Java, but maybe the reason that the author feels that Python has the better hackers is because Python, by virtue of it's simplicity and no-nonsense syntax, tends to attract your more "problem solver" type person.

    Just a thought.

  • by Anonymous Coward on Thursday August 12, 2004 @04:05PM (#9951954)
    Ehm... he is a LISP hacker! he is writing a new version of LISP called Arc, if I remember rightly.
  • Apples and apples (Score:5, Interesting)

    by Dan Ost ( 415913 ) on Thursday August 12, 2004 @04:08PM (#9951990)
    Hmm...let's see.
    Both languages have a virtual machine.
    Both languages can use JIT compilers for improved efficiency.
    Both languages support OO development.
    Both languages have large standard libraries.
    Both are turing complete.

    Even their performance is similar.

    Please explain how this is an inappropriate comparison.
  • Why I like Python (Score:3, Interesting)

    by brunson ( 91995 ) * on Thursday August 12, 2004 @04:15PM (#9952077) Homepage
    [reposted because my original parent got modded into oblivion]

    I like python because it allows you to modify the behavior of the language constructs. It gives you hooks into what happens when you say 'print myvariable' or what goes on when you retrieve 'mydict[ "something" ]'.

    Much like operator overloading in C++, this allows you to write in the language of the problem, rather than the language of the language. So, if you're dealing with dates you can overload the minus operator to calculate the time between two dates when they are subtracted. Or if you are dealing with complex numbers your operators do the right thing when you add a complex and a real.

    Similarly, in Python you can create a database search object that behaves like an associative array. So, customer_id_search[ 10 ] goes to the database, retrieves the record for customer_id 10 and returns a DAO to be manipulated.

    Iterators and many other constructs help you in writing clear, concise, MAINTAINABLE, extensible and reusable code by allowing you to code clearly in the language of the problem you are trying to solve.

    Python Rules, Perl Sucks. ;-)

    tcA thgirypoC muinnelliM latigiD eht detaloiv tsuj evah uoY
  • by Anonymous Coward on Thursday August 12, 2004 @04:17PM (#9952094)
    My experience with Java was quite the opposite - every Java book I read always had mysterious claims about threads, JVM, synchronization, garbage collection that seemed like some sort of "insider knowledge" and I was expected to just believe it.

    What is this nonsense? "Mysterious" claims about the JVM? Huh? First of all, you're comparing the source code of a language implementation to books. Second of all, The documentation for Java is way better than Python's, Perl's (yes, even considering perldoc), and Ruby's combined. If they gloss over a few things in Java books, it's most likely because they don't want to get into irrelevant, potentially confusing details or cover details that are a part of the implementation and not a part of the language specification.
  • by SuperKendall ( 25149 ) * on Thursday August 12, 2004 @04:20PM (#9952127)
    I personally find the main claim, that Python programmers are just naturally the smartest people on earth, to be rather offensive.

    I consider myself a pretty good programmer. I otherwise fit the criteria he lists in that I do a lot of programming for fun, and like to explore new languages...

    but not Python. And you know why? It sounds petty and stupid, but I just hate the whitespace indenting. I have always thought that perfect code readability relied on the felxibility to format certain sections of code differently than others, and the need to have indenting control grouping of statements has always been way too rigid for my tastes.

    So there you go, that's why one Java programmer is not into Python at all (not even Jython).
  • by YetAnotherAnonymousC ( 594097 ) on Thursday August 12, 2004 @04:21PM (#9952142)
    Re Java being "mysterious" (?!). You're reading the wrong books. Not that you need a book at all. All you need is:
    The Java Language specification [sun.com]
    and if you are interested in more depth, The VM spec [sun.com]
    The specified behavior for synchronization, the memory model & threading are all there in fairly simple terms.
  • Re:The Java Problem (Score:4, Interesting)

    by brunson ( 91995 ) * on Thursday August 12, 2004 @04:22PM (#9952164) Homepage
    I'm a Python programmer, and I do know Java and I have developed in a J2EE environment and I have written EJBs and I have also been writing Perl for the last 15 years. And I have been a professional C developer and I know C++, Objective C, Fortran, Cobol, Ruby, Haskell, sed, awk, Korn shell, Bourne shell, DTKsh, C shell. I've written in just about every language you can name.

    And you know what? I think Python is the best.

    I'm more productive, it's more intuitive, it took three months of writing Python for me to dump Perl completely after using it for 12 years.
  • by LnxAddct ( 679316 ) <sgk25@drexel.edu> on Thursday August 12, 2004 @04:25PM (#9952208)
    There are much cleaner ways to do such a a thing in java then what you noted, even prior to the 1.5 jvm, but regardless, that Ruby code does not look cleaner to me. Smaller yes, but if we are going for small then use perl or something. For instance, what the hell is the x for in the ruby statement? Is it some magical variable that popped out of nowhere and was never declared (I know you don't need to declare variables but its good to do so)? I have not a clue. I only briefly used Ruby a while back, i found it nice that it told you that a number was near infinity rather then keep going like python, although both have their uses. I use python for arbitrary integer calculations and for scripting little things, and java for everything else. Java fixed everything bad about C++ and it is still superior to C#. It is also extremely fast, if you need something faster then java then you should be using assembly. Python on the other hand is slow as hell, it has its place, but I am much more proficient in java. Also, as far as deployment goes, you can't beat Java WebStart, it is essential to me now a days. In conclusion, I find that Java is my first choice for any real programming that is done on a large scale or is "critical" in one sense or another. Python for little things that can be scripted. I don't see a need for Ruby, it is neat as an educational device but nothing more.
    Regards,
    Steve
  • by MSBob ( 307239 ) on Thursday August 12, 2004 @04:31PM (#9952301)
    The Python integration within eclipse is nowhere near the level of java integration. I also don't get the sense that it is a project with the same amount of focus and dedication as say, AspectJ which is beginning to look just awesome!
  • by ErikInterlude ( 784049 ) on Thursday August 12, 2004 @04:42PM (#9952445) Journal
    I think more people who are java programmers should be trying Python for smaller programs, cause I was able to pump small programs out much faster than with Java.

    I think this point is interesting. Paul Graham makes a big deal about why he doesn't think much of Java, and it all seems to go back to the big/small issue. For example, in his essay on how he put together the Yahoo stores using Lisp, he mentioned that interpreted languages (or at least languages that can be both interpreted and compiled like Lisp) are better because they let you do things incrementally, as opposed to languages such as C/Java/etc, which force you to do the whole project all at once(I'm generalizing his statements here, but that seemed to be the gist of it).

    My point is this: Graham seems to really like the "small is better" approach, for which interpreted languages really shine. For larger projects, Java/C++/etc. would (might?) be more appropriate, but for Graham's projects and ideas, not really relevant.

    Every once in a while, Graham comes out with something that seems to get Java users up in arms, but it's entirely possible he's operating from point-of-view that involves projects that Java wasn't really designed for to begin with.

    Just a curiousity I thought I'd note.
  • Re:Python vs Java (Score:5, Interesting)

    by abigor ( 540274 ) on Thursday August 12, 2004 @04:44PM (#9952458)
    Also, take a look at PyQt for very nice Python bindings to the Qt library, and PyKDE for bindings to KDE. The latter is amazing: the excellence of Qt and the KDE libraries together with Python is quite a combination.

    In defence of Java, much of its library support is for use with big systems, like enterprise apps that run under J2EE servers. Python is nowhere near this level.

    Put simply, Java scales up; Python scales down. I think, however, that in the future, Python could pose a serious challenge to Java if an enterprise-level app framework is ever created for it. But Java has such huge momentum I doubt it will be toppled from the enterprise server throne anytime soon.
  • by MSBob ( 307239 ) on Thursday August 12, 2004 @05:01PM (#9952662)
    You're exactly the enterprise developer he's talking about. Enterprise developers don't do it because they love enterprise programming. You have to be really sick to love enterprise programming.

    Nothing like starting your reply with a good ad-hominem attack, eh?

    lot of people choose Java, but only a very small number for open source projects

    Tell that to the Apache consortium. Most of their new projects are all java. The whole Jakarta, Geronimo all very prominent java efforts. Besides Freshmeat returns 2381 java projects and 956 python projects... hardly the ultimate in testing languages' popularity but it dispells your stupid assertion that only a small fraction of OSS projects are written in Java.

    Changing topics: aspects. Aspects are stupid. They make sense in a language like Java that has no metaprogramming capabilities. They are absurd in other languages like Python or Lisp.

    Aspects are not macros and macros cannot do everythin that aspects can. Go back and read more on aspects.

    Finally, stop acting like an arrogrant asshole. It makes you look very infantile.

  • by haystor ( 102186 ) on Thursday August 12, 2004 @05:01PM (#9952663)
    The ratio is vastly different for different languages. Python programmers are a self-selected group of people who opt to use Python often for the joy of programming. Java is the default corporate language now that people learn to get a job or make money.

    Saying the two groups are equally intelligent is somewhere on the order of saying business majors and math majors are equally intelligent. Both attending college, but typically one group is after just a degree and the other is pursuing knowledge. The numbers are 100% either way, but there is a much higher percentage of geniuses in math than in business classes. Nobody flunks out of business into math.

    Argument, short form:
    Java is the choice of consultants, not the choice of scientists.

    Ok, for pure brainpower here is the competition I propose: Take a Python programmer and a Java programmer. They tackle the same problem in both Python and Java. I'm betting on the Python guy to present better solutions in both languages.

    Most of the complaints about Graham are likely from people who are just barely programmers. Their real skills aren't as programmers but that they happen to know enough of the libraries to get things done. This makes them useful when combined with a certain industry experience, but it doesn't make them good programmers. One of the most common arguments for Java replacing other languages I've seen is that it's easier to find Java programmers and that they are pretty much replaceable. Personally, I no longer aspire to being easily replaceable. I'm now accepting positions that expect me to perform well enough that I would be difficult to replace.

    -- Former consultant
  • Bigotry (Score:3, Interesting)

    by Anonymous Coward on Thursday August 12, 2004 @07:06PM (#9953810)
    The reasons I moved to Java are the very same reasons that Paul Graham describes as reasons that people use HIS favorite languages. I had had an early foray in Smalltalk, was heavily influenced by it and embraced Java as a chance to get away awful C++ (which I had studied heavily and worked with)..

    I embraced Java because I could finally program the OO way in it. C++ was supposedly OO, but didn't work quite right, and Java was an ok (not perfect) mainstream Smalltalk based language. The original team was fairly strict in the sense that it would not allow brain damaged C++ programmers to ruin the language (there was definitely a "purist" language design philosophy involved). Of course, in recent years they seem to have dropped that (see Java 1.5 generics, etc..)

    Now Python comes along... and Ruby too... they are nice, because among other things they bring us the Smalltalk philosophy of simplicity with Java lacked for marketing and acceptability reasons.

    I say.. what about Smalltalk itself??

    The reason I still stick with Java is:
    - Huge huge number of libraries
    - Good acceptability
    - Easier to convince my boss
    - etc..

    Pragmatic reasons.. not purist ones.

    I think a lot of Java programmers are the same.. Python is nice.. hope it catches on, but look we have this very mature platform in the meantime.

    Now P. Graham arguing about Perl as a good design vs. Java is just laughable. Sure, Perl is fast, Perl has regular expressions. But Perl has NO orthogonality, Perl is a write only language... it is not a language for people who like to read code.

    To me it just seems like Paul Graham is used to using Lisp, to running his code on Unix. Paul Graham probably runs emacs and has the Unix culture in him. He shouldn't confuse his Unix culture preference for scripting and languages similar to scripting, his preference for dynamic typing, his preference for the command line, his preference of being with a rebel as a real reason to bash the mainstream. It's just an illusive preference of his own.

    It's laughable for a Perl or C++ programmer to diss a designed language and say theirs is superior.. the only reason we listen to Graham is because of his Lisp background.

  • Re:Why I like Python (Score:2, Interesting)

    by chenwah ( 161707 ) on Thursday August 12, 2004 @07:36PM (#9954032)
    While in the real world I have used this in python a great deal, in my little hobbyist/pretend-academic world this is one of the things about python that really leaves a bad taste in my mouth. I'm all for meta-programming, I think it is a great tool to let you modify the language to create something more suited to your problem, but I just can't stand the way that python does it.

    Instead of a well defined meta-protocol python just exposes a few pieces of its intenals, a few hooks that let you override the default behaviour. It all seems a bit ad-hoc to me. It seems to make optimisation difficult too. Ref. the creation of the += operator to bypass the (possibly mutating) hooks involved in a = a + b.

    Languages like Smalltalk and Common Lisp (with CLOS) properly formalise this and make things more predictable and flexible. Of course, I have written a heap of useful python code but noone has ever paid me to write something useful in CLOS. It's fun to think about stuff like this but python get jobs done :-)
  • Re:Python vs Java (Score:3, Interesting)

    by mad.frog ( 525085 ) <steven@cr[ ]link.com ['ink' in gap]> on Thursday August 12, 2004 @07:48PM (#9954119)
    I think the main reason I write so much stuff in Python and pretty much nothing in Java is simple: Open source and comprehensive standard library.

    Interestingly, I just started trying to learn Python recently, for just these reasons... but soon gave up in frustration.

    My issue is that I live for static typing. Yes, yes, yes, I know it's (apparently) very unfashionable to want the compiler to check for trivial mistakes, but I'm funny that way.

    Don't get me wrong: dynamic typing is great. It's a wonderful tool to have available. But more often than not, I know the type that I need, and can make my app more reliable by enforcing those constraints at compile time rather than at runtime.

    But the final straw has to be the deliberate omission of variable-declaration statements -- this is like some nightmare out of circa-1982-BASIC. What, it's too hard to declare variables? C'mon, that's not flexibility -- that's laziness.

    The idea of an interpreted, dynamically-typed language with a huge standard library is verrry appealing to me, but I refuse to switch unless I can have static type checking built in to the language.

    (For that reason, ECMAScript 4, aka JavaScript 2.0, aka ActionScript 2.0, is looking more and more interesting to me: I get all of the dynamically-typed goodness I want, along with flexible compile-time type checking that is "on" by default, but trivially easy to work around. If only there was a way for me to use all the existing Python libraries from there...)

  • by Dwonis ( 52652 ) * on Thursday August 12, 2004 @08:07PM (#9954245)
    The fact that you exist does not disprove the statistical proposition (i.e. that the average Python programmer is smarter than the average Java programmer).
  • by Rob Riggs ( 6418 ) on Thursday August 12, 2004 @09:55PM (#9954971) Homepage Journal
    I attended a talk on Design Patterns by John Vlissides at OOPSLA a few years back and many of the problems he presented in his examples just don't occur in Python (or are trivial to solve). His talk reminded me more why I don't like to program in C++ and Java. I couldn't fathom running into the issues he was using in his examples with a dynamic language like Python. I asked him about this after the talk, but it did not go very far due to his lack of experience with dynamic languages in general (surprising) and Python in particular. And I was new to patterns and was likely not communicating my questions as clearly as one could.

    I recently ran by a paper by Alex Martelli called Five Easy Pieces: Simple Python Non-Patterns" [aleax.it] that goes into more detail on this topic. In it he says, "Python has a knack for making many issues simpler. This, in turn, enables use of simpler conceptual tools, such as an idiom in lieu of a Design Pattern."

    I'm sure the same likely holds true for Lisp.

  • by ajs ( 35943 ) <{ajs} {at} {ajs.com}> on Thursday August 12, 2004 @10:59PM (#9955287) Homepage Journal
    First off, let me be clear: I like Python. I think the throw-back to the yesteryear of line-oriented programming with enforced indentation style is quaint, bordering on painful and that the ultra-dynamic typing without dynamic conversion is kind of a strange choice, but I like Python, and I intend to use it quite a bit.

    However, back in the "old days" (late 80s, early 90s), Perl too was a bastion of those who wanted to throw off the shackles of scripting (I hate when that word is mis-used to refer to interpreted languages). Perl was the way to start giving some real structure to all of those tasks like report printing and systems toolsmithing that had traditionally involved totally unmaintainable "scripts" which eventually had to be re-written in a low-level language.

    So what happened? Nothing really. Perl developed some nice features, but ultimately LOTS of bad programmers learned it and in a language that makes it easy for people to write programs, you quickly develop a robust collection of REALLY bad code (along with the really good). Just look at C for confirmation of that.

    Python is where Perl was in the early 90s now. Lots of folks who know bad code from good are using it, and it looks like the next great island to swim to. It's easy to look back at Perl and say "it was the dollar-signs that FORCED people to be bad coders," or to look at Java and say, "the low-level types are what SEDUCED people into writing crappy code."

    In reality it was the popularity and subsequent influx of bad programmers. Python is becoming popular and I guarantee that in about 5 years Python programmers will be listening to, "[Span, Ruby, something else] is so much better than Python... just look at how much cleaner the code is."

    I wonder if we'll ever figure out that joe blow who barely understands what programming is will always produce unmaintainable shlock, no matter what language he writes in and no matter what book on abstract modeling he's just read.
  • by bugbear ( 448726 ) on Thursday August 12, 2004 @11:58PM (#9955609) Homepage
    Actually I advocate Python because I consider it a gateway drug.
  • Re:Why I like Python (Score:3, Interesting)

    by brunson ( 91995 ) * on Friday August 13, 2004 @12:58AM (#9955906) Homepage

    My last large project was a provisioning system for the 3rd largest internet carrier in the world. It provisioned and maintained managed modem service for over 23 million users in the US and overseas. It consisted of about 150,000 lines of python code and is now being quite happily supported by 2 of my friends that are still working there.

    Get over yourself.
  • by julesh ( 229690 ) on Friday August 13, 2004 @06:37AM (#9956958)
    I would be much happier with java if it had a few things--first off, a dynamic typing construct a la 'id' in objective C. 'object' just isn't powerful enough.

    I'm afraid I don't know objective C. Could you elucidate on what this provides that Java lacks?

    Secondly, callables a la python. This includes class methods and statics (not merely function pointers like C).

    This can be achieved using the java.lang.reflect.Method class. It's ugly, but workable, and a number of my software projects have used it.

    The fact that you have to jump through hoops to attach an event handler using a callback model (a la Swing) is inexcusable.

    This is an API issue, rather than a language issue. Swing and AWT aren't the only GUI toolkits that are usable with Java, and you are free to write your own, as I have done. I don't have to jump through any hoops to handle events.

    Are anonymous classes really a solution? How about in an application with hundreds of event handlers?

    Anonymous classes work for me. They're managable because you put them in the code where you want them. I've never written an application with hundreds of them, though.

    A programming language should enable the use of different techniques, not restrict them.

    Agreed, and I for one would like to see a nicer syntax provided for reflected methods -- at the moment to get one you have to write 'object.getClass().getMethod("methodName",new Class[]{ ParameterType.class })' and handle the exceptions that can be thrown, where the compiler can easily determine that there are no possible exceptions and provide a much simpler way of doing the same thing. This would make the use of this kind of technique much easier.

    Additionally, the overhead of object allocation in Java is awful. Simple objects whose only attributes are primitive types should be stack allocated under a certain size.

    Stack allocated objects are hard to manage -- the compiler would have to perform checks to ensure that no reference to the object can exist outside of the scope of the function call before allocating it on the stack. An interesting point is that there is nothing stopping VM implementors from doing this anyway, it wouldn't violate the specification. The difficulty of making it work correctly is the only issue.

If you have a procedure with 10 parameters, you probably missed some.

Working...