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."
Re:FP (Score:2, Informative)
Python in the workplace (Score:3, Informative)
Too bad I'm maintaining code with two letter variable names all the time though, and now it's soured the language for me as well... heh.
Re:The way source code looks (Score:5, Informative)
I think something along those lines is already possible [sun.com] in Java :)
Python jobs - got resumes? (Score:4, Informative)
Re:The way source code looks (Score:3, Informative)
> doSomething( s );
Yup, JDK 1.5 (or 5.0?) will introduce generics, enumerations, and a for-each construct - as soon as it gets out of beta.
But it'll be about four years you'll be able to actually use them because it'll take that long for folks to move off of JDK 1.4
Re:That's all well and good... (Score:3, Informative)
Ummm.... something tells me Paul Graham would agree with that. Read his Lisp books some time.
Re:The way source code looks (Score:3, Informative)
But the thing to keep in mind is, the Ruby version is just a method on the collection, it is NOT a language construct. You can write your own like this:
# do it in a random order
collection.each_random { |x| x.do_something }
# do it to every other item
collection.each_even { |x|
# show a busy cursor during the operation
collection.each_with_busy_cursor { |x|
You really don't realize the power of Ruby until you start coding BEYOND what you can already do in other languages.
And if you play with Lisp, the *whole language* is fluid like this. For instance in a lisp program I needed to slow down a sequence of operations by sleeping in between. I wrote a macro that took a block of code and inserted (sleep 1) between every operation:
(sleep-between 1
(foo)
(bar)
(baz))
How do you even begin to do this kind of stuff in, e.g., VB?
Re:Java programmer's viewpoint (Score:2, Informative)
Actually, you can use Eclipse as an IDE for Python: http://www.python.org/cgi-bin/moinmoin/EclipsePyt
And why choose between Java and Python when you can have both [jython.org]?
Re:Yea (Score:3, Informative)
Brainf**k is a relatively simple stack based language. The only thing about it that makes it hard to understand is its very terse syntax. Unlambda and Whitespace has this as well, and in addition to this they are completely unreadable. The reasons are quite different though: Unlambda because there is absolutely nothing like it (wrapping your mind around a myriad of s's, k's, i's and `'s == pain. I've tried) and Whitespace is just impossible to read (and program for that matter) without the aid of a program that can convert it to something where you can actually tell the instructions apart.)
Re:The way source code looks (Score:3, Informative)
foreach ( @collection ) {
$_->DoSomething();
}
Re:Python is great for guys like me.... (Score:2, Informative)
We have a bioinformatics group where I work and Python is the language of choice when they need to crunch alot of numbers. I understand there is a nice interface to the R statistical engine and many other useful facilities. I've never gotten any of them interested in Java which we use for our systems in IT...
Re:Source? (Score:5, Informative)
Re:Source? (Score:1, Informative)
From Googling:
This study is mentioned in this book excerpt [typepad.com] and here [makingalife.com].
The first reviewer here [amazon.com] mentions a reference that would seek to discredit the cited study's author however.
Re:Python vs Java (Score:2, Informative)
Consistency is another great thing about Ruby (Score:3, Informative)
That example seems a bit selective to me. Code blocks are nice given the rest of the way that Ruby is designed to make them useful and handy, but I don't think it's necessarily superior. Personally I'm a great fan of Ruby for it's consistency, which I suppose it inherited from Smalltalk. I really like being able to deal with anything in the same way, without having to worry that there might be exceptions.
I've been using Python as my favourite scripting language for several years -- it's a neat language to code in. Recently though, I had a situation where I wanted to make adjustments to the String metaclass, and I hit a brick wall. Python's consistent in most places, and getting even moreso over time, but there are some bits of it that completely conflict with everything else. If you hit one of them it can be quite frustrating.
Switching to try the same thing in Ruby, I found that the consistency between standard library classes and everything else made it so much easier. In my Python version, I had to design a wrapper around a string, which is very yucky because I really want all strings to act a certain way - not just those that I remember to put a wrapper around. With Ruby it was just a matter of re-declaring the String and adding the methods I wanted.
Re:Python is great for guys like me.... (Score:2, Informative)
I certainly turn to Python first, rather than coding up new ideas in c++.
Re:Java programmer's viewpoint (Score:2, Informative)
Ironically enough, AspectJ is heavily based on the Lisp/CLOS Metaobject protocol that dates back to the late 80's and early 90's. Not that this should suprise anyone, the same folks developed both tools. I'd characterize AspectJ as more an "industrial response" to CLOS/MOP than new research.
Don't pick on Design Patterns by GoF! (Score:3, Informative)
It weighs in at 395 pages, which isn't the thinnest but way short of the 1000 page plus behemoths you're talking about.
Most of that page count is actually showing you example implementations (in C++ and SmallTalk). Sure, you could leave those out, but examples are useful when your book is about abstract concepts.
This book is worth its (light) weight in gold.
Re:Why I like Python (Score:2, Informative)
When you see:
You will be tempted to assume that addition is occurring. Do not! Treat the above code exactly as if it had been written:
Or better yet:
Once you've realized that it's all function calls your frustrations will vanish.Re:The way source code looks (Score:4, Informative)
Damn Perl trolls ;-)
cLive ;-)
Eric Sink's reply (Score:2, Informative)
From my own work experience, I think he is right (in some situations). There certainly are many great hackers I've worked with whose technical skills I respect but I would never want to work with again. Of course, I've also worked with a lot of great hackers who were also great employees, so it can go either way. But any hiring manager (or any employee for that matter) would be wise to remember that the person's technical skills are only part of a bigger picture.
Maybe, but I'm not sure... (Score:3, Informative)
Yahoo! Stores wasn't a "small" project by any sense of the word. Maybe the upper boundries of "medium."
Re:Apples and oranges (Score:3, Informative)
One approach to "compile-time" problems with python is to treat pychecker as your compiler. Basically, it looks for all those typos that C etc catch due to requiring variable declarations, and a whole lot more. Unused local variables included.
Python doesn't really have private members like C++ does, so a lack of accessor functions doesn't have the same meaning.
(I can't address the reflection thing; never really learned Java. My thinking went from C to Python... from what I saw, C++ was an incremental improvement (long story there...), Java was another, but Python was a leap from C, much the same way C was a leap from ASM.)
HTH,
Eli
Re:He likes Small Is Better, which isn't Java (Score:4, Informative)
Actually, the language that Graham is most associated with is Common Lisp, which is neither a small nor an interpreted language. It is relatively large for a Lisp dialect (much larger than Scheme), and a compiler is part of the specification.
(I'm not counting Arc, since it doesn't exist yet.)
Re:He likes Small Is Better, which isn't Java (Score:3, Informative)
You save and run the program right away, or in the case of an automatically reloading servlet such as tomcat you don't even run the program: your changed class file is detected and tomcat reloads the class in the running program. IBM websphere takes that concept even further.
It feels like smalltalk, where you are also changing the program aka image in place without restarting it.
Re:Why I like Python (Score:2, Informative)
You seem to think that
A3 = A1+A2
B3 = B1+B2
is just as easy for a human to parse as
A3 = A1.concat(A2)
B3 = B1.add_element(B2)
I disagree.
Re:what is PG's fascination with Python? (Score:3, Informative)
I think that he was griping about the distinction between what you can do with a function, and what you can do with a lambda. In Lisp, you can put whatever you want in a lambda. In Python, you can only have a single expression.
Example, with _s added to deal with ECODE's idiocy about leading spaces:
As far as I know, you can't write v2 in Python using a lambda.
Of course, somebody else pointed out that you can create a named function and use it, as in the following example. But that can sometimes be rather inconvenient.
The dumbest thing I've done... (Score:1, Informative)
Anyway, I hope it's not going to take me a year to learn c++ to the same level I can do python because there are better places I could think of statying in than my parent's basement...
Re:Java programmer's viewpoint (Score:1, Informative)
1) Systems that automate "boring-to-write" stuff such as RMI/CORBA/etc. classes/stubs, interface implementations, pure virtual method overrides in derived classes, etc.
2) Refactoring support. This is not merely in the "nice to have" category if you have large amounts of legacy code to maintain and expand.
3) Integrated debugging facilities which assume that one will be writing distributed, multi-threaded code.
4) Javadoc integration that makes documenting one's classes a doddle.
5) Ant and other build script integration.
6) Automated use of CVS and other version control systems.
7) Extensible architectures that allow easy integration of third party add-ons.
8) Context-sensitive on-line help, javadoc searching for information on user-written classes, automatic method parameter prompting, and other stuff that can be a big help when writing code.
Thus, while a Java listing may seem wordier and more complex than (for example) a Python equivalent, one must consider the fact that (a) most Java programmers won't have to write it all by hand, and (b) they will likely spend a lot less time managing, debugging, and refactoring when working on large projects.
Note also that those who want to use Python, Lisp, Rexx, Smalltalk or whatever can do so from within Java - alternatively, they can avail themselves of those languages' facilities while maintaining Java-like syntax semantics. Have a look at:
http://flp.cs.tu-berlin.de/~tolk/vmlanguages.ht
for some of the language options available to Java programmers.