Guido Von Rossum on Python 260
deran9ed writes ""People can get quite emotional about Python, in a way they rarely get about software," says van Rossum, who is now director of Python Labs at Digital Creations. In this question and answer interview, he explains why Python deserves such loyalty, when it is better to use Python than Perl, and why increasing numbers of business applications developers will be using Python for years to come. THe full article is on SearchEnterpriseLinux"
Re:Python and Propoganda both start with the lette (Score:1)
> > Python is used pretty much across the board, much more across the board than Perl.
> Who is he kidding?
I think you've taken this up wrong. I think he
meant that Python is more suitable for a wider
variety of applications than Perl, which sometimes
shows its origins as a string processing language.
Re:Music Apps? (Score:1)
Python is excellent for expressing algorithm... (Score:1)
Re:ramblings (Score:1)
X attracts people to Y, because no other system can provide X.
In your example, professional color features (Pantone, CMYK, etc.) is the "killer app" features for Photoshop.
You're right, cool program can not be "killer app" for a language just becaus it's cool. Of course, we could imagine it's not possible to write some progam X in any language other than Y... That would make the program X "killer app" for Y. But that's just speculation, Zope is not such a program.
However, Zope is not just a program. It's rather a framework, allowing you to ad your own code to the system. So, theoretically it could be the "killer app" for Python.
Shaddup already! (Score:2)
Perl == Good
Pyhon == Good
If you Python and Perl people don't quit yer fighting, I'm gonna force you all to use nothing but Visual Basic!
If you don't stop it right now, I'm turning this bus around and we're all going back to Microsoft!
Killer Apps 'R' Us (Score:2)
Personally I think Python and Perl are the same toolkit with trivial differences in syntax, and wish language designers would take a leaf out of Mark-Jason Dominus's book [perl.com] and go easy on the theology.
But, FYI, Perl has a coupla thousand killer apps, most of which are available on CPAN [cpan.org].
Industry Standards include:
The Beatles never flamed the Stones. The Stones never dissed the Beatles. And at no time did either party rip on Bob Dylan or badmouth Marvin Gaye. Language designers should celebrate their brethren. Particularly when the similarities so overwhelmingly outnumber the differences.
Perl is worse than Python because people wanted it worse. Larry Wall, 14 Oct 1998 [www.amk.ca]
Frankly, I'd rather not try to compete with Perl in the areas where Perl is best -- it's a battle that's impossible to win, and I don't think it is a good idea to strive for the number of obscure options and shortcuts that Perl has acquired through the years. Guido van Rossum, 7 Jul 1992 [www.amk.ca]
When I originally designed Perl 5's OO, I thought about a lot of this stuff, and chose the explicit object model of Python as being the least confusing. So far I haven't seen a good reason to change my mind on that. Larry Wall, 27 Feb 1997 on perl5-porters [www.amk.ca]
If Perl weren't around, I'd probably be using Python right now. Tom Christiansen in comp.lang.perl, 2 Jun 1995 [www.amk.ca]
Python is an excellent language for learning object orientation. (It also happens to be my favorite OO scripting language.) Sriram Srinivasan, Advanced Perl Programming [www.amk.ca]
Why use Python when I can use Ruby? (Score:2)
Re:nitpick (Score:2)
That is, if we want to pick nits.
KFG
Re:No, why NOT! (Score:2)
Perl isn't dead (Score:2)
Re:Python should be everywhere... (Score:1)
Anyhow, I don't use python for two reasons:
1. Perl can do anything that python can with about as much ease (minus the facts that they each have a few minor strengths and weaknesses that the other is better or worse at)
2. The general arguments in favor of python come in the form of either
(a)I'm too stupid to understand perl so python is better
(b)I just like python better because it's so regular
Well, I like perl so much because it's irregular. As larry wall once said, "Since English is a mess, it maps well onto the problem space, which is also a mess, which we call reality. "Similarly, Perl was designed to be a mess (though in the nicest of possible ways)."
I always find it kind of funny when people talk about coding in natural language, since perl is in many ways quite like a natural language. For one thing, it's gone through a sort of huffman-coding: the stuff you use a lot is short and easy to use. Also, the same character or groups of characters can mean different things in different contexts. This is another piece of efficiency as in general it means that you can use the shorter stuff more often, and have to remember fewer symbols.
The great part about perl is that it is a language in a very real sense. It is quite irregular, but quite usefully irregular. And the best part is that it has no hangups about being irregular when it would be useful to do so. That's why, I think, so many people find perl to be so fun. It was designed to make the easy stuff easy and the hard stuff possible, not to make Guido Van Rossum happy if he looks at your code.
And that, I think, is the reason that I'll do my best to never use python - I don't like people telling me how to do things. One of the fundamentals of python is that it enforces Guido's coding style as much as possible. That's just not a friendly environment. Who wants to trust an interpreter which doesn't trust them?
Re:Python does kick ass (Score:1)
foreach (2,4,6,8) { print }
with perl. That doesn't seem weird to me.
Re:Why Python (Score:1)
Re:Don't use it. (Score:1)
Peace,
(jfb)
Re:Python does kick ass (Score:1)
for(0..10) {
print unless($_%2);
}
"""
Is this example supposed to *dispute* Perl's reputation for unreadability, or is this a joke?
-DA
Re:Python does kick ass (Score:1)
I've written a LOT of perl in the past but I switched to python because of the strange artefacts like $_.
Re:Python does kick ass (Score:1)
Re:Python does kick ass (Score:1)
Re:nitpick (Score:1)
Those who view the area as "theirs" tend to reserve its nominal use to themselves.
Didn't this arise as a minor issue with regard to Valery Giscard d'Estaing a few years back?
Re:nitpick (Score:1)
The german "von" does indicate some sort of Aristocracy. This is the same in English; the bad "Guy" in Robin Hood is "of Gisbourne", which would be taken to mean he rules the place rather than just lives there.
Re:No, why NOT! (Score:3)
I found it so funny in fact, that I went back to a couple of colleagues and started using Python as the punchline to an in-house joke: you see at the time we were looking for an embeddable scripting language. Python became a threat: "you'd better not do that, or I am gonna embed Python in the server".
Then, I started running into Python on the net, first because of Zope (of course) then on other cool little projects. I started to get curious, and downloaded the language and ActiveState's win32 extensions. I picked a small in-house project to test it on and I was pleasantly surprised: I went from making fun of it to piping serialized Python objects over HTTP (from NT to Unix and back no less) in --literally-- 3 days.
I dunno what your measure of a good language is, but that ease of use and versatility sold me. And, BTW, Python is now my company's embedded language of choice.
Re:Don't use it. (Score:2)
And which of these examples gives Python the advantage over Ruby? I think, your examples are exactly the description of Ruby virtues.
Well, of course, I still prefer Perl to those two; but at least Ruby has something that Perl doesn't (-123.abs or mixins, for example). Well, Python also has a unique feature - significant white spaces, but I'd rather live without it ;)
Failures of Python advocacy (Score:2)
1. "PERL SUCKS!!!"
I see this one often. Lots of people seem to hate perl for reasons of varying validity.
2. "Python is better than perl"
Like it or not, this is just a toned-down version of #1. Python is better than perl
3. "Python is elegant"
I heard Larry Wall speak at the Atlanta Linux Showcase last year, and he identified "Programmers care about elegance" as one of many myths about programmers. (This is where the anti-perl crowd screams, "It's fitting that that bastard Wall would say something so brain-dead lame!!!") I care about how useful and powerful a langauge is, not how elegant it is. We all know how far elegance took the ivory-tower language known as LISP. If python becomes popular, I believe it will be so because it is useful, not because it is elegant.
4. "Python is object-oriented"
My response to this is: so what? OO programming, while good for many things, is overhyped. OO languages are a dime a dozen.
5. "Python is truly object-oriented"
You'll often see this statement coupled with other statements like, "Perl's object-orientedness was a hack," "Perl's object-orientedness was added later, while python's was included from the beginning," etc. In other words, "perl sucks."
In the article, Guido was generally fair but couldn't help having his argument tainted by #1 and #2 (above). When it comes down to it, I don't want to use python partially because I don't want to be associated with the vitrol which pervades its proponents. It's just a programming language.
COM/COM+ testing (Score:2)
Besides the religious beliefs in better computing practice, Python is simply just faster, and easier to get going. (Now if only I can sell it to the rest of the crowd...)
Music Apps? (Score:2)
nitpick (Score:2)
Re:Failures of Python advocacy (Score:2)
Why Python (Score:2)
Learn Python and decide for yourself (Score:3)
Learning Python is not hard (remember how long it took you to learn Perl?) -- you can do it in an evening by reading any one of these free (and Free) online books:
Once you've read any or those, you'll want to dig into some real code, so head over to the Python Knowledge Base [faqts.com] for tons of real code examples, and Vaults of Parnassus [vex.net] for tons of free third-party modules and libraries.
-M
GPL? (Score:2)
I have no hard evidence of this, but a number of things point toward this.
Re:Learn Ruby (Score:2)
Re:GPL? (Score:2)
Zope is cool... but (Score:2)
The 'search' facility is brain dead, and it looks to me like nothing has actually been done to the Zope project in the year or so i have been following it, short of bugfixes for the security holes in the product.
Most of the 'Zope Products' indexed on the website are hopelessly out of date and don't work with the current version of Zope.
I have evaluated Zope in the past, and am building a site with it at the moment as an experiment, but I don't think it's a 'Killer App' by any means.
Maybe when it gets a WYSIWYG editor bolted on instead of the TEXTAREA-based editor, and a support site that isn't a total abortion - if theres anything that would put a potential Zope user off, its the Zope site, then they might have something.
Re:nitpick (Score:2)
'von' is the German version of the Dutch 'van' prefix (or vice-versa). I think in Germany a 'von' prefix indicates nobility (e.g. Werner von Braun).
The Anglicized version is just to leave out the spaces and say 'Vanderbilt' instead of 'van der Bilt'.
Regards,
Xenna
(Who should be recognized as an expert on this trivial subject, having 'van der' in front of his *real* name.)
Re:Guido on Dylan (Score:2)
Now that Python exists, it may be hard for even those with will -- Ruby and Rebol, for example -- to succede. There was a niche for Python to fill, something that Perl and Tcl didn't quite cover. Tcl is gone, is there enough of a gap in what Perl and Python achieve that there's room enough for another language? I'm not sure. No new language is going to supplant an old language -- at least, not until it has gained a significant following on its own.
Re:Music Apps? [Snack] (Score:2)
Here's a blurb:
"""
The Snack Sound Toolkit is designed to be used with a scripting language such as Tcl/Tk or Python. With Snack you can create create powerful multi-platform audio applications. Snack adds commands for basic sound handling, e.g. sound card and disk I/O. Snack also has primitives for sound visualization, e.g. waveforms and spectrograms. It was developed mainly to handle digital recordings of speech, but is just as useful for general audio. Snack has also successfully been applied to other one-dimensional signals.
The combination of Snack and a scripting language makes it possible to create sound tools and applications with a minimum of effort. This is due to the rapid development nature of scripting languages. As a bonus you get an application that is cross-platform from start. It is also easy to integrate Snack based applications with existing sound analysis software.
"""
Re:Python should be everywhere... (Score:2)
Is there something available for Python like the Inline:: modules for Perl? These are modules which make it possible to stick C, C++ or Python right in the middle of Perl code. What would be really cool is if there is a way to hook up Python with any of the thousands of Perl modules which exist out there. One of the nicest thing about Perl is CPAN [cpan.org], a huge online repository of Perl modules for doing just about everything. It would be cool if a Python script can access, say, Perl's Net::AIM module (which provides a nice class interface to AOL Instant Messenger protocol).
Python and Perl are both really nice languages. Anyone who's never used them should give them a try. For certain tasks, it's amazing how much faster you can do things in comparison to, say, C++ or Java or VB. (But every language has its place; I don't believe the "one language fits all" claims that people sometimes make).
Python vs Perl is largely down to personal preference, and what code/modules are currently available that you can build on top of.
Re:Article says very little about merits of langua (Score:2)
I agree its a pretty cr*p article, especially, when you consider how articulate Guido is on almost any subject.
It reads like he was interviewed over the phone while he was trying to shave.
Getting Stoned (Score:3)
When a reporter went up to Jagger and told him the Beatles had broken up and asked for his reaction he replied, " Great, that means that now WE'RE #1!"
Little did he suspect that 30 years later the Stones would still be touring, and that the Beatles would STILL be outselling them.
Kinda like loosing an election to a dead guy.
KFG
Zope (Score:3)
On the other hand, I have issues with Zope. The documentation is incomplete, and the help system has big smokin' holes in it. There's a Zope documentation project, but I have a problem with systems like this where the code is the spec, and the documentation is being written from that — my own particular anal retentiveness factor, I suppose. Zope doesn't behave quite the way I intuited in the getting-to-know you phase of our relationship, and I've had to readjust my think for a number of Zopisms as I go. Also, the naming conventions (plural) suggest to me a certain cobbled-together-ness — an impression which is carried further by the spotty documentation, etc.
If you want to know about my personal bias in languages, I think Perl is truly amazing in the sense that any language which is so butt-ugly in terms of its syntax and structure (inheriting from C, AWK, and shell scripts???) can be so mind-bogglingly useful and easy to use in practice. On the other hand, all the Perl hackers I've worked with produced utterly vile code. Mind you, they produced pretty damn awful C too. I'd prefer to be working in Python if I had to work with them.
And of course I do work with them, but the powers that be won't let us use Python on the basis that it's not a skill you see on resumes as standard yet. Thank God for The Corporate Mentality, no?
Re:Learn Ruby (Score:2)
I think SC is derived from/inspired by some other OO language. Which language did constructs like '5.times {do this}' come from: Smalltalk? Eiffel?
Re:This just in! [Here's what Larry Wall thinks] (Score:5)
wanted it worse." - Larry Wall, 14 Oct 1998
Re:No, why NOT! (Score:2)
These comments followed the string describing the grammar, which contained Perl code for the semantic actions, and which was fed to a method in a parser-generator module. (I tried including a few lines of the code in my post, but Slash gave me the error message: "Lameness filter encountered. Post aborted. Reason: Junk character post." Harrumph.)
--
Re:Python should be everywhere... (Score:2)
For compiled languages, anything that's hookable to C, it's easily hookable to Python. SWIG (swig.org) is of course most people's generator of choice (it does Perl as well, to be fair) but there is also a C++ API (CXX), several Fortran APIs and I dunno what else...
Re:Python does kick ass (Score:2)
Re:No, why NOT! (Score:2)
The trick is to use a decent editor which has good syntax highlighting. Then, at the point where your error is, everything will turn red (or green or ...). This also applies to C++ and Perl and other languages which don't rely on whitespace - it becomes much easier to spot the odd unescaped quote.
Actually, one thing that annoys me about perl is the fact that it's almost impossible for an editor to syntactically highlight it perfectly. Although this is hardly ever a problem unless you're intentionally being obfuscated (e.g. print qq]hello, world\n];, or s/([^ ])([abc])/local $_ = $2;y!abc!ABC!;$1.$_/ge;, or ${rand > 0.5 ? "b" : "a"}++;).
Re:Python does kick ass (Score:2)
Yeah, right (Score:2)
Whatever.
People (read: geeks like us) get quite emotional about software in general, and about languages and operating systems in particular. I work in an office where Perl is the dominant language, and the Perl-heads here are quite passionate about Perl. I'm mainly a C programmer myself, and I can get quite passionate about C. (This becomes especially amusing in my office, because I'm implementing a library for C that provides the functionality of Perl, so we have wonderful lunchtime arguments about that, too.) I've seen people get quite overheated about PHP, Python, C++, Eiffel, ML, Haskell, Prolog, Scheme, Forth, assembly language, and pretty much every other language I've encountered, including COBOL and RPG. (Hard to believe? Pick a fight with my mother.)
It's just the nature of the beast. To use and like a language, you have to get deeply into it, and once you see its full possibilities, it's irritating to have to debate them with someone who doesn't know the language as well. The assertion that people get more passionate about Python than other languages is just either pure BS, or else it's marketeering by Guido.
I've used Python, and while I agree it's cleaner than Perl, it also has some annoying features, too. Just like every other language. Frankly, I think Icon is a better text-handling language than either Python or Perl, but that's just my personal needs and prejudices speaking.
What I don't understand -- and this could be equally well aimed at C++ and Java as Perl and Python -- is why people find a language they like and insist that everyone else must use it. It's generally acknowledged that the peculiarly American habit of insisting that everyone speak English is asinine; I wonder why the same conclusion hasn't been reached about programming language advocacy. All non-trivial languages have strengths and weaknesses, and there really isn't much to recommend one over the other except personal preference and practical requirements, i.e., what you already know and the nature of the task at hand.
Diversity is good. This applies no less to tools than it does to people.
--
Re:Java vs. Python (Score:2)
Assuming you mean FreeBSD, just log in as root, and execute "cd /usr/ports/lang/python ; make ; make install".
If you don't mean FreeBSD, well: the CPython interpreter is fairly portable, IIRC, and should build under most unixes with little trouble.
Re:Zope (Score:2)
You know, sometime things that don't make sense to you actually do make sense. While it would be nice for us if management let us pick whatever tools and languages we want, the fact of the matter it that they are going to have to have people maintain this system long after we leave. It would be a very bad thing for them if a developer created a successful product in Python, and then left. Trying to find a replacement would be very hard, and even when they do, how would they even be able to test his actual skill in Python (with the resident Python expert gone). After hiring someone, and he says the project need a rewrite, how could they tell if he's snoballing or not? In this case, I agree with the powers that be. Sometime the best tool for the job doesn't include technological factors.
Re:Python and Propoganda both start with the lette (Score:2)
Here's three for you, and chances aren't bad that you've already come across any or all of them:
So. Now you've seen three major projects written in Python, and chances are this isn't the first time you've seen one or all of them. Like Linux, Apache, Sendmail, and yes Perl, if you use the internet at all then you probably interact with Python all the time without necessarily realizing it. It's a nice, clean, scalable lanaguage who's one main drawback -- it's slow -- is handled nicely by the fact that it's so easy to integrate it with C. As a result, it gets easy to maintain a large, complex project in Python while optimizing bottlenecks with pure C modules.
Perl can pull some of the same tricks of course, but it's much messier. I like Perl, I mainly use Perl, and I'm not knocking it. But I really can't see the point in arguing the matter: Python is a much cleaner language that is far better suited for large scale projects. If you haven't come across it yet, maybe you just haven't done anything big enough yet.
GUI Development Dynamite (Score:2)
+ Qt ( http://www.thekompany.com/projects/pykde/ [thekompany.com] )
+ Firebird ( http://firebird.sourceforge.net/ [sourceforge.net] )
+ gvib ( http://www.zope.org/Members/RETierney/gvibDA [zope.org] )
=
A delicious cross-platform substitute for my obese friend Swing.
---
Re:Python does kick ass (Score:2)
An alternative option is to put "use English;" at the top of your script. Then you can call the $! $? $_ $% $, $; variables by their more readable names: $OS_ERROR $CHILD_ERROR $ARG $FORMAT_PAGE_NUMBER $OUTPUT_FIELD_SEPARATOR $SUBSCRIPT_SEPARATOR etc.. You can tell they're "magic" variables, cos in Perl the convention is that upper-case variables are ones which mean something special to the interpreter.
open HANDLE, "hello.txt" or die "cannot open hello.txt: $OS_ERROR".
Re:Failures of Python advocacy (Score:2)
Perl's object-oriented mechanism does suck. It's too verbose (you have to write $self->{'fieldname'} = 1; where fieldname = 1; would be more appropriate), and it's slow, because there's a hash lookup for every local field reference. It wouldn't be hard to build a better syntax into the language and handle object fields at compile time, and I hope this gets done in Perl 6.
Perl is slowly moving down the path of C. C started out without function prototypes, without a serious type model, and without objects. Over time, it acquired all three. However, Perl doesn't have to become as static as C/C++ to get it right. Look at Smalltalk, which has about the minimal amount of declaration machinery required for an OOP language. That's where Perl ought to be headed, but with Perl-like syntax.
Re:Python does kick ass (Score:2)
Were you using perl v 4?? (released in about 1992) Modern perl has classes! man perltoot.
use Net::FTP;
my $ftp = Net::FTP->new('ftp.server.com', Debug => 0);
$ftp->login('anonymous', 'e@mail.address');
$ftp->get('file.txt');
etc.
I take it you never put "#!/usr/bin/perl -w" at the top of your perl scripts? Look at man perl, and search for "-w" to see quite how many times you're told to enable warnings like this. Also put "use strict" at the beginning of your scripts.
BTW, if you do "-w", the error you get is this: Name "main::varaible" used only once: possible typo at -e line 1.
Re:/python can't beat Perl now (Score:2)
That's because Perl's OO used Python's as a model, so of course they're similar.
cross-platform (Score:3)
The standard Python implementation is interpreted, it's as cross-platform as Perl or Java or whatever. There's also a pure Java implementation of Python, Jython [jython.org], which I've found very useful as a scripting tool in a Java environment, as you get full access to Java classes from Python.
Python is a scripting language, so I use it in preference to Java where a script is called for, eg - rapid development environments.
Re:Python should be everywhere... (Score:2)
The main difference (besides subjective likes/dislikes, of course) between the two, is that Python is a descendant of general-purpose languages (albeit, mostly academic ones), while Perl is a descendant of specialized languages (shell scripting, AWK).
As a result Python tends to be easier for begginers to understand. That's not a bad thing, and it's not trivial either...
Re:No, why NOT! (Score:2)
If you honestly think that Python's signficant whitespace is a serious problem, then my advice to you is to get a real text editor.
Honestly, Emacs's Python mode is so straightforward that it's almost comical. I missed the semi-colons and braces for approximately five seconds. Vim will also do all the "hard" work of indenting for you. I suppose if you are still editting in ed Python might be problematic, but that's not Python's fault.
Article says very little about merits of language (Score:3)
Python is a cleaner language, thus better for larger projects and teamwork.
Granted, if true, that's a worthwhile thing. But's that's precious little to say in the way of discussing a language, and it's quite vague. C'mon, how about some more discussion of features of the language. How about some real comparison, with say, strengths and weaknesses of Perl. My knowledge of Python (almost zero) has increased not one bit after this article.
Basically, the article amounts to: Hey, I wrote Python and I like it. It's better than things I didn't write.
Is this an interview or a press release?
No, why NOT! (Score:3)
Don't get get me wrong, attention to detail in programming is a good idea. Formatting your programs is very important. Spaces should not be. They are the void on the page. Various editors treat spaces, that is, it's harder to manage in some. It's just a shame that they put this 'feature' in a language.
Re:Zope (Score:2)
What does Zope offer to me? DTML looks overly verbose and too hard to read and besides one of the reasons I want to ditch PHP is so that I won't be mixing code and HTML in the same page. I like the built in user management and the hierchical system but is it worth learning a new language? how about performance?
Please tell me what makes zope so good that I'd want to take the plunge.
Re:Java vs. Python (Score:2)
Yes. It even has bytecode, that (IIRC) can be run on any platform that has the correct Python interpreter.
As for GUI-toolkits, there are several to choose from, and they are supported on several platforms, but probably not as many as Java AWT/JFC.
Is there a reason you'd use Python over Java if you wanted to run your application in a few different environments?
Yes, you would be using Python instead of Java. That's a plus..
Re:Python should be everywhere... (Score:2)
What I like best about perl is CPAN. Perl can find and load a CPAN module for you and CPAN is full of well documented well tested code which saves me days and days of work.
Does python have anything resembling CPAN?
Re:The (insignificant) whitespace thing (Score:2)
if:
else:
endif;
blocks PHP now supports a endoperator for every structure including foreach, switch, while etc..
super cool.
Re:Java vs. Python (Score:2)
On that note, it would be rather interesting to see Java and Python go head to head in a bunch of code benchmarks, no? :)
ObJectBridge [sourceforge.net] (GPL'd Java ODMG) needs volunteers.
Re:Python does kick ass (Score:2)
for($i = 0; $i < 10; $i += 2) {
print $i;
}
And the same in Python:
for i in range(0,10,2):
print i
How about this in perl:
print foreach 1..10;
or just this:
print 1..10;
(admittedly that doesn't generalize well)
I'll overlook the fact that you didn't know about the suffix statement notation (putting the foreach after the action), which few people use because it *is* confusing. But you didn't even use the range operator, choosing the most noisy syntax possible instead.
$variable = 1;
print $varaible;
use strict. that's what it's there for. You are simply not qualified enough in perl to make the comparisons you are making.
--
Re:Cross-platform Python (Score:2)
.. if your a masochist.
Re:No, why NOT! (Score:3)
And install it on every last machine you will ever find yourself editing code from, in every environment you could possibly use, making sure you got your bases covered for editors on Solaris, BSD, Linux, MacOS, Windows, and textboxes in browsers. Have you ever edited a script in ed? I have (termcap was way too messed)
Or you could just use ruby which is much less noisy than perl but not whitespace-dependent.
--
Don't use it. (Score:2)
This just in! (Score:5)
Larry Wall thinks Perl is pretty cool.
Re:No, why NOT! (Score:2)
Like most macs. Or any browser (hey hey, like Zope).
> If you want to criticize Python at least find a *real* problem with the language and don't just spread FUD about whitespace
In Python, whitespace is part of the language. By the way, FUD stands for Fear, Uncertaintity, and Doubt. I am merely flaming, I lack the marketing experience for FUD.
--
Re:Don't use it. (Score:2)
I have to differ with you brining Java into this comment. While there is no external standard body for Java, Java is not "defined by it's implementation". The Java Language spec has been found to differ from the behavious of javac many times, and it was javac, not the JLS that changed. Jikes uses the JLS, not javac as it's reference. Javac is only a reference implementation, in that it mostly conforms to the JLS.
more technical (Score:4)
Re:No, why NOT! (Score:2)
if (a>1)
{
System.out.println("x");
}
then
// if (a>1)
{
System.out.println("x");
}
Neither f the above break. Just because I am declaring a new block for no reason, doesn't imply to me that the compiler should break. In fact, I use this feature of C style languages all the time to block off the scope of local variables, thus making the code easier to read, like thus:
// switch a and b
{
int tmp=a;
b=a;
a=tmp;
}
I don't want the tmp varable scoped past this switch, so I limit it's scope. I also use the comment at the top of the block to make the whole thing look prettier.
Re:Don't use it. (Score:2)
Linus has the copyright on the Linux kernel code... he can relicense at will. The next version could be completely closed and proprietary. The only thing he can't do is relicense and take away all the old versions that he's already GPL'ed.
People coding under bsd licenses generally just want their code to be used, even if the people who use it want to keep their changes secret. They will still have their original code, after all.
I do not find in orthodox Christianity one redeeming feature.
I dig python (Score:2)
It turns out it's super easy to integrate into a C or C++ base and nearly instantly gives you a very solid scripting language. Restricted execution allows you to limit the power of the scripts, perhaps only allowing access to a few of your own custom objects and none of the system calls. This allows us to trust scripts from relatively untrusted users. All in all it's been a dream to use.
I was a little weary of having to learn a new language. Having to have C, C++, Java, VB, perl, javascript & shell under your belt seems excessive. I wish we could settle down and use a few LESS languages, but whaddya gonna do?
Once I jumped in though, i found it really easy to learn and nice to work with. Most modern languages seems to use so many of the same concepts, it's hardly like picking up a new one (I felt the same way about java). So it was really painless.
I would suggest anyone who's on the fence to give it a try because really it's only a couple of days before you've got a pretty good command of it
Sleeper
Zope (Score:2)
However, I still don't like Zope much, even though I really want to like Zope. It doesn't have the things I so love about Python -- simplicity, consistency, and a small set of orthogonal features which interact well together. DTML and Zope in general seem to have some sort of funny dynamic scoping to them, and the mapping from URL to object database to the python object model isn't intuitive to me. When you do something new in Zope, there's a very good chance it won't work the first time. That's not true of Python, in my experience.
For these reasons, I've been looking more closely at Webware [sourceforge.net], which seems to have a much less ambitious goal, and thus much more chance of success.
People have been talking about how Zope will be a killer application for a while now. Maybe it will happen, I very possibly may be converted myself, but I don't think it will necessarily happen. It would be very easy for Digital Creations to lose sight of the goal by incrementally adding features they need without rethinking what they've already done. Down that path leads Perl, and I know I sure don't want to go there.
ramblings (Score:4)
First off sorry for the typo on submission of the article... Tom Christiansen wrote a nifty little comparison [nasa.gov] between Perl vs. Python. I've used Python quite a few times and don't know Perl well enough to even consider myself a programmer. However many times I've had to modify plenty of Perl scripts in order to use certain things I found useful, and one reason I would use Python over Perl is its ease of scripting. Perl can sometimes be confusing as heck.
According to Jon Udell here are his findings on Perl vs. Python
Perl Is Bigger, But Python Is Growing Faster.
Python Is More Deeply Object-Oriented.
Perl Is more Powerful And More Mature In Some Ways.
Perl Lacks A Killer App, Zope Is Python's Killer App.
Python Is Designed To Be A Good First Language For A Beginning Programmer, Whereas Perl Is Most Useful To Programmers Familiar With C, Sed Or Awk, And UNIX Command Idioms.
His complete write up is here [byte.com]. (warning the article is a bit long... 4 pages)
And finally Python Humor [python.org]
Re:ramblings (Score:4)
Re:Article says very little about merits of langua (Score:2)
I also like the fact that you can look at a small bit of Python code out of context and figure a lot out about it. There are seldom hidden side effects (not necessarily by language design, but mostly by accepted convention and style). You can trace all the functions -- there are a handfull of top-level builtin functions, and everything else is modules or methods. Because Python encourages being explicit about modules (e.g., using string.join, where join comes from the string module), it's easy to figure out where everything is defined.
Those are a couple of the things that I think make Python easy to read and easy to maintain.
But most of all, I like Python because I can do what I want to consistently and efficiently. There aren't any surprises. I feel like Perl has an emphasis on being a language that can do eclectic things. But I don't want my language to do eclectic things, I want to do eclectic things with my language. A language should be a reliable and predictable way to express my intention. If I understand the language fairly completely (and it doesn't have horrible deficiencies, like Tcl for instance), I can do what I want. I could never understand Perl enough to work with it without surprises. Without ever hacking on Python internals, I feel like I understand the language pretty completely.
Python is decently standardized (Score:2)
As far as new versions breaking old programs, I haven't seen the problem. Python v2 adds a number of things, but hasn't really broken anything. There are plans to deprecate old features, but these are mostly in cases where old features were found to encourage or enable bad programming practices or the behavior is unintuitive, and where it's not hard to fix the program. Even so, there are plans to put in warning features and ways to run the interpreter in backwards-compatible modes. These should come to fruition before serious backwards-incompatible changes are made.
Re:The (insignificant) whitespace thing (Score:2)
Re:No, why NOT! (Score:2)
Seriously modern text editors take the pain out of it. The python IDE takes care of it. But fair enough it is a pain when you want to debug some of your code example
if a > 1 :
print "do something
print "do ome more stuff"
print rest of program
if you want to just skip the condition and the do somethign code is very long then you have to replace it when you would've wanted to just
#if a > 1 :
print "do something
print "do ome more stuff"
print rest of program
you have to
#if a > 1 :
if 2 > 1 :
print "do something
print "do ome more stuff"
print rest of program
which might just trip you up
Python and Propoganda both start with the letter P (Score:2)
Who is he kidding? In my years as a professional programmer of financial applications, data servers, ecommerce frameworks, embedded systems, and web sites, I have seen a plethora of projects successfully that used Perl, and exactly zero that used Python. Python ain't exactly the ubiquitous standard the Python community thinks it is.
There are a lot of application developers using Python in Web development. Even more using Perl, to be sure.
The other examples given--glue applications, database applications--have been successfully served by Perl for a long, long time. Honestly, who hasn't written a simple protocol server in Perl before? Who hasn't written basic databases in Perl?
I think Guido might be eating a little too much of his own dog food. Python may be a rising star (who remembers Objective C?), but Perl is still king.
Oh dear god... (Score:2)
I never thought I'd see the day when Java was mentioned in the same sentence as "lower level" and "efficient."
*shudder*
Re:Don't use it. (Score:4)
Python is transitioning from a bsd-like license to a bsd-like license. Those who wish to get their knickers in a twist over the in-between phase are grasping at straws.
Linus does not want to relinquish final control over Linux. What's your point? Guido is the BDFL (Benevolent Dictator for Life) but the license does not prevent one from making alternate versions, and in fact this has been done more than once.
As for Guido wanting to get paid for doing Python work, sure.. why not? As for getting paid for what other people contribute, please explain yourself in some level of detail?
While there may no standards body stamping an official document, this statement also applies to Perl, TCL, and many other popular scripting languages in its class, as well as Java. In practical reality, there are mulitple implementations of Python which are in fact compatible, and have been multiple independent implementations for some time. I wouldn't get too worried about this "one implementation problem".
The python 1.x -> 2.0 transition was painless for all those I have spoken with. I have not had any of my code hiccup or cough at all except perhaps to tell me that some packages have been deprecated over the years, though they still work.
If you compare this to the K&R -> ANSI C transition, or the TCL 7 -> 8 transition, or some of the severl perl transitions, it's a walk in the park.
While these languages are interesting, they do not have the same advantages as Python. Some examples would be a clean readable language, a cohesive standard library, a simple syntax, and a strong OO heritage pulling from background such as smalltalk. Ruby and Lisp do interesting things of their own, but are not languages I would consider in the same breath. Ruby, FWIW, suffers from the same above problems as Python.
Re:Music Apps? (Score:2)
Learn Ruby (Score:3)
For RAD Ruby is a clear-cut winner. You have many high level concepts available in the language or the accompanying library (which is almost the same, since it's true OO). The most important and visible: each. No more for (i=sz; --i >= 0; ). Its also got lamdas, closures and eval. If there are some concepts missing in the language, it's usually possible to extend the language and reuse that extension again and again. At no cost of readabilty as in Forth. Oh, and did I mention everything is an object?
Whatever you can do in Python, Perl or Smalltalk, you can do in Ruby (as a language at least). The accompanying libraries are pretty sweet too. Try it, you'll like it.
- Steeltoe
Python should be everywhere... (Score:4)
I have respect for Perl (hell, I have respect for any general-purpose language than can beat egrep in text searches), but Python is my weapon of choice.
What people are missing in this forum is that Python is probably the most extensible language out there: there are at least 4 different interpreter implementations for Python (and I don't mean OSes): there's C-Python, there's Jython (in Java), there is Stackless Python and there will be a Python.NET. That's versatile guys, much more so than any other 4GL language out there.
Also, Python is hacker-friendly: armed with a couple of tools and a C compiler anybody can embed the interpreter in their own app or extend Python with existing C, C++, Fortran, Java, or even Perl code. Trust me, it's much easier than you think.
Python is easier for begginers to pick up: if you have a diverse group of people with different skills, you can use Python as a lingua franca. No reason to explain the legacy behind $_ or other such awkiness
Most importantly though, a choice of language is a personal one: I liken Python code to a mathematical proof: it's clean, it's elegant, and if it's written by someone else a reader can easily pick up its deficiencies. Perl tends to be more like poetry: it can be beautiful (like that great DeCSS hack) but its beauty is subjective, and much like poetry a lot of people may never 'get it'.
At any rate, if you are a Perlista and you're here flaming away because of the whitespace thing, go to python.org and try the language out. My bet is that you will be happy to have done so.
Re:ramblings (Score:5)
Python vs. Perl according to Yoda
Subject: Python versus Perl: A humorous look
From: funkster@midwinter.com
To: guido@cnri.reston.va.us
Date: 10 Jul 1999 01:45:07 -0700
This has been percolating in the back of my mind for a while. It's
a scene from _The Empire Strikes Back_ reinterpreted to serve a
valuable moral lesson for aspiring programmers.
--
EXTERIOR: DAGOBAH -- DAY
With Yoda strapped to his back, Luke climbs up one of the
many thick vines that grow in the swamp until he reaches the
Dagobah statistics lab. Panting heavily, he continues his
exercises -- grepping, installing new packages, logging in as
root, and writing replacements for two-year-old shell scripts
in Python.
YODA: Code! Yes. A programmer's strength flows from code maintainability.
But beware of Perl. Terse syntax... more than one way to do it...
default variables. The dark side of code maintainability are they.
Easily they flow, quick to join you when code you write. If once
you start down the dark path, forever will it dominate your destiny,
consume you it will.
LUKE: Is Perl better than Python?
YODA: No... no... no. Quicker, easier, more seductive.
LUKE: But how will I know why Python is better than Perl?
YODA: You will know. When your code you try to read six months from
now.
--
larry
[me@localhost]$ prolog
| ?- god.
! Existence error in god/0
Re:Don't use it. (Score:2)
Ahem...lets look at this statement this way.
I advise people not to use Linux for the following reasons: 1) Linux has had license issues. Linus does not want to relinquish final control over Linux, and he wants to get paid for what other language implementors do for free. 2) Linux is defined by it's implementation. There's no standard for developers to rely on. That means ultimately you are at the mercy of the good or bad judgement of the Linux kernel team. 3) New versions break old programs. I do NOT want my customers to have to have 2 or 3 versions of Linux kernels installed. 4) There are better alternatives. MacOS or Windows.
Yeah, its not a *perfect* fit, but pretty damn close.
Guido on Dylan (Score:2)
Phil: It seems like Python is starting to be taken really seriously in web development and so on. Is Python being taken seriously in academia? I guess I mean relative to Perl, because Perl isn't, as far as I can see.
Guido: I would say Python is being taken a lot more seriously. There are language designers who don't approve of certain short cuts, or the fact that Python doesn't have static typing, or the fact that there are other languages out there that are as good as Python is, and again borrow all the good features from those languages.
Phil: What languages?
Guido: Some people think, for instance, that Dylan--which I think has a very academic flavor--is everything Python is plus so much more.
Phil: Dylan? I've never heard of it.
Guido: Well, that's exactly Dylan's problem. I don't know, but I think it started out as a LISP variant, with sort of an alternative syntax. The syntax was deliberately unLISPish in order not to scare off everyone who is not already brainwashed with LISP, because LISP has one of the biggest image problems of any programming
language in the world.
Python does kick ass (Score:3)
I'm learning Python now. It's a much cleaner language. Consider the following Perl:
for($i = 0; $i < 10; $i += 2) {
print $i;
}
And the same in Python:
for i in range(0,10,2):
print i
It's just easier to read. The main reason I don't feel like continuing on in Perl is because I once seriously shot myself in the foot due to Perl's lack of easy to use and easy to understand complex data structures. Python has classes, which are just like JavaScript (really just hashes), but the syntax makes them usable.
And error checking as well. The following is probably wrong Perl:
$variable = 1;
print $varaible;
But it isn't an error. The following causes an error in Python:
variable = 1
print varaible
If I wanted an undefined value, I can, of course, create one:
variable = None
print variable
Re:Python and Propoganda both start with the lette (Score:3)
I have seen a plethora of projects successfully that used Perl, and exactly zero that used Python.
Yahoo, Google, and eGroups all use Python extensively.
So in your future ignorant flames, you can now say: Besides the biggest portal, the best search engine, and the most popular e-list site, I know of zero sites that use Python.
Re:Don't use it. (Score:2)
Re:nitpick (Score:2)
Re:Python does kick ass (Score:2)
0.upto(10, 2) { |x| puts x }
I think this is the "native" way to do this in Ruby, although I haven't been toying with it for very long, so I could be wrong. What happens is (roughly) that the message upto is sent to the object 0, with a code block associated with the call. If you're familiar with Smalltalk, this should be natural. The object 0 receives the message (aka "executes the method"), does the requested iteration, and calls the associated code block for each visited number. Pretty neat, huh? The availability of these very Smalltalk-esque code blocks, but coupled with a more familiar (and sane!) syntax is what attracted me to Ruby. Recommended.
"More ways to do it" and damn honest about it (Score:2)
do it." If a beginning programmer reads Programming Perl, 3rd ed. (great book, by the way) all the different ways to do an operation will be listed. "You can do it this way, or this way, or this way. It doesn't matter which one. They all mean the same thing". Nearly all other programming languages also have "more than one way to do it" but are rarely if ever honest and upfront about it. If the programming book they read shows only one way to do it (which many non-perl programming books are notorious for doing), and there's actually two or three different ways to do it, they're going to think the other ways to do it are completely different procedures, and they'll expend a whole lot of unnecessary energy try to figure out that the two or more instructions are the same. Perl's honesty about different ways to do things actually makes it easier to learn than many other languages.
Re:Python does kick ass (Score:2)
for(0..10) {
print unless($_%2);
}
You clearly picked contrived examples, and totally failed to back up your argument.