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."
Interestingly enough, knowing Python did get me a job... My company works a lot with Java too, but my job specifically deals with about 90% Python, and 10% Java... I never thought there was a use for it when I learned it in University...
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.
I think something along those lines is already possible in Java :)
The revolution will not be televised.
Who says Python is not good for getting jobs? I know at least 2 places in New York City where you should send your resume, if you are a good Python hacker: http://www.wirelessgeneration.com/ and http://www.divmod.org/ (also .com).
Simpy
> for( SomeType s : collection )
:-)
> 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
The Army reading list
Ummm.... something tells me Paul Graham would agree with that. Read his Lisp books some time.
All's true that is mistrusted
Sure, with these toy examples...
... }
... }
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?
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?
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.)
________
Entranced by anime since late summer 2001 and loving it ^_^
foreach ( @collection ) {
$_->DoSomething();
}
Paying taxes to buy civilization is like paying a hooker to buy love.
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...
You only use 2% of your DNA
Google turned this up, which cites a source: http://www.mindview.net/WebLog/log-0037
From Googling:
This study is mentioned in this book excerpt and here.
The first reviewer here mentions a reference that would seek to discredit the cited study's author however.
I don't have to install anything in my classpath to use standard java classes.
PHP is the solution of choice for relaying mysql errors to web users.
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.
I certainly turn to Python first, rather than coding up new ideas in c++.
"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. "
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.
I agree with most everything you say, but I don't think Design Patterns is a good example.
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.
Lord Pixel - The cat who walks through walls
A little bigger on the inside than out
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.Damn Perl trolls ;-)
cLive ;-)
-- Trinity in high heels carrying a whip: The donimatrix - there is no spoonerism
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.
Consider that Graham's premiere hack was Yahoo! Stores. It wasn't a huge project in LOC count (PG says this is because it was in Lisp). However, it was big enough that Yahoo! had trouble reimplementing it in more conventional languages (and in the end, actually wrote a simple lisp interpreter to handle part of it).
Yahoo! Stores wasn't a "small" project by any sense of the word. Maybe the upper boundries of "medium."
Slashdot. It's Not For Common Sense
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
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.)
With IDE's like eclipse, that compile any file on the fly as you save it, there is no more lengthly build process and even with a fast compiled language such as Java you don't have to suffer.
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.
I have objects of type A and B. Both handling strings, A as a single string and B as an array of strings.
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.
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.
was to learn python. I used it in my previous job for rapid development (easy interfacing with C, clean code, etc etc) and it did the job. But in the end (looking for a new job) this python experience is pretty much useless... everybody wants .net / .com /.c++ experience and nobody's even heard of python... they thought I was taking the piss... probably would've had a better chance mentioning perl or php.
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...
I agree that tool availability is an important reason for selecting Java. Most "XXX vs Java" comparisons tend to assume that one is using some form of simple text editor (e.g. Vi, Notepad) to write code, yet few Java programmers work this way due to the plethora of IDEs (open source and commercial) and specialist editors (e.g. JEdit) that exist. These take a lot of the drudge-work out of Java programming by having:
m l
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.