The Python Paradox, by Paul Graham
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."
Boxing Equipment Reviews
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.
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.
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.
...but it's being eaten...by some...Linux or something...
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.
The Army reading list
"[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
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?
Your pizza just the way you ought to have it.
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?
Ruby on Rails Screencast
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.
09F911029D74E35BD84156C5635688C0
Jesus loves you, I think you suck
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)
free ipod and free gmail!
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.
A goal is a dream with a deadline
Ehm... he is a LISP hacker! he is writing a new version of LISP called Arc, if I remember rightly.
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.
*sigh* back to work...
[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
09F911029D74E35BD84156C5635688C0
Jesus loves you, I think you suck
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).
"There is more worth loving than we have strength to love." - Brian Jay Stanley
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.
--Erik
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.
I recently ran by a paper by Alex Martelli called Five Easy Pieces: Simple Python Non-Patterns" 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.
the growth in cynicism and rebellion has not been without cause
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.
Actually I advocate Python because I consider it a gateway drug.