PyOpinion: Does Python Programming Marginalize You?

Martijn Faassen m.faassen at vet.uu.nl
Tue Jun 6 14:21:01 EDT 2000


Richard P. Muller <rpm at wag.caltech.edu> wrote:
> Does Programming in Python Marginalize You?

[snip]

> And yet, I worry that using Python marginalizes one. Python is hard to
> beat for writing applications that run on a single computer. But
> that's yesterday's computing model. The future of computing, heck, the
> present of computing, is in writing programs that run through a web
> browser.

It is? I mean, given what you say next, you seem to think as if the
future/present of computing is writing programs that run *inside*
browsers. That was the hype of 3 years ago, when Java was new. It turned
out not to be the case. At least not yet, and not wholly.

What is actually happening is that people write server applications,
with HTML interfaces (which may have a bit of JavaScript or Java glue;
the second much rarer than the former). Web applications, yes, they're
important. Web browser applets are not very important as of the moment, 
though their support role in supporting web server applications may
grow (but only in beefing up the user interface).
 
> And the fact of the matter is that 99% of web browsers
> surfing the internet run Java and JavaScript, which gives these
> languages a huge advantage over Python,

Which doesn't matter a lot for most web applications, as they run on
the server, where you can run anything.

> an advantage that Python's
> superior design may not be able to overcome.

Fortunately, Python already overcame this hurdle at least in part, 
as there is JPython, which runs on top of Java and can be used to
produce web browser applets (http://www.jpython.org -- ah, I see
later on you know about this).  The second hurdle is currently being taken;
Mozilla is gaining Python support (though initially this will be used more 
to extend Mozilla than for web interfaces). I also think Internet Explorer
can have some Python support with the Windows Scripting Host; I'm not sure
about this though.

But all this is beside the main point, which is that web applications
tend to happen more on the server than on the client.

> I have Ada-programming
> friends who mumble about Ada's superiority over C++; that may be the
> case, but does it really matter anymore?

Fortunately, Python's been rapidly gaining in popularity for quite
a while now, at an accelerating pace.

> I'm aware of CGI scripting with Python. It's great. But JavaScript
> pages load faster than CGI pages, and are easier to program, to
> boot.

That's, excuse me, a grave misunderstanding of the way the web works,
and comparing apples with oranges. CGI pages (or other server generated
pages, for instance those generated by Zope) are not inherently slower
than JavaScript pages, and in fact, a JavaScript page can be generated
on the server-side. It's just not a valid comparison at all, as you
can't do the same things with a JavaScript page as you can do with a
server system.

> Plus, JavaScript can directly call Java Applet methods, enabling
> it to do functions that are simply impossible with CGI scripts.

Can it? I wasn't aware of this. Then again, I seldom encounter Java
Applets. You may be navigating a different web? I generally encounter
lots of HTML pages with forms on them, lots of server-generated pages,
with a little bit of JavaScript glue here and there.

> I'm also aware of the JPython module, which promises to enable
> us to write applets in Python instead of Java. But who among us has
> actually *used* JPython? Or, for that matter, who has come across a
> random web page on the net that uses JPython applets? 

How often do you come across a web page that uses Java applets? And now,
how often do you come across a web page that uses Java applets to do
something *useful* (instead of display gimmickery)?

But you know about JPython. All right.

> Do I recommend that students today learn Python? Certainly, because
> it's easy, fun, it teaches one good OO habits, and it's incredibly
> powerful. But I also recommend that students learn C/C++ for speed (I
> no longer recommend Fortran), and Java and/or JavaScript for web
> programming. Heck, I also recommend that they learn Perl, since so
> many other people know Perl. That leaves a significant niche for
> Python, but only a niche, and Python is too good a language to be a
> mere niche player.

Is there any priority in such recommendations? I mean, there's a law of
diminishing return here. C is useful to know because it's everywhere,
fast and low level. C++ is useful to know because of speed and fairly
high level abstractions, but I don't think it's for everyone. Python
I *do* think is for everyone. :) But if you know Python, it doesn't make
that much sense to learn Perl afterwards, unless you have to or are 
dissatisfied with Python. This because Perl and Python fill approximately
the same niche.

Java may also be useful because it's everywhere, though I haven't found
a use for it yet. JavaScript is not really very learnable on the present
web; it's mostly a bunch of hacks that aren't cross-browser compatible.
There's hope that this will improve with newer browsers. But it's
not really an application programming language.

But there should be a list of priorities here. Python may be a good
first language, for instance. Will probably bring you up to speed
with C++ or Java faster than starting with C++ or Java itself will.

> If we don't want to see Python wind up like Ada, what should we do?

Just wait. Really, look at the amount of postings on this newsgroup
over time for one datapoint. Look at the explosion of Zope use for
another. Look at the amounts of books on Python in your local bookstore
(hint: a year and a half ago there were 2 if you were lucky). You don't
have to do a thing, just use Python, and tell others.

> I've been teaching a 6-lecture short-course on Python here at Caltech,
> in an effort to introduce more people to the language.

Ah, so you're doing that already. Great!

> I'm thinking
> about learning enough JPython to give an additional lecture on that
> language. Hopefully, if enough people use JPython for writing Applets
> we can help establish it as a reasonable alternative to Java.

But as far as I'm aware, Java's main use these days is for
application programming, and server programming. We already have
reasonable alternatives to lots of Java technology; often enough they're
even *more* reasonable alternatives. :)

> As for JavaScript, I don't know of a solution. It would have been nice if
> Netscape had implemented Python's syntax for LiveConnect rather than
> Java, but it didn't happen that way. Think how wonderful it would have
> been to write PythonScript functions in web pages rather than
> JavaScript.

Lots is happening on the Mozilla front. Have you seen the latest
ActiveState announcements? Python will definitely be usable to extend
Mozilla with new components. PythonScript will take a while longer,
though. But perhaps one day it'll get there. I still think you're
overestimating the importance of JavaScript and Java Applets on the
web, though. Could you list a typical application? I do web programming
for a living and I can't really think of any common ones.

Regards,

Martijn
-- 
History of the 20th Century: WW1, WW2, WW3?
No, WWW -- Could we be going in the right direction?



More information about the Python-list mailing list