[hblug] Python
Peter Harrison
peterha at nzoss.org.nz
Mon Sep 25 08:31:03 NZST 2006
On Sun, 2006-09-24 at 23:38 +1200, Fraser Burns wrote:
> How many others of you are also using Python?
>
> I've only been using it a few months so am still at a new level, but
> already the amount of things that are possible to do is great. At the
> moment I'm working on using it with MySQL.
Python I feel is the new Java.
You don't yet see very many big applications written in it yet, but
there is no reason why they couldn't. Django is a project which uses
Python to deliver something similar to Ruby on Rails for Python, and has
its own template system.
Is Python as mature as Java? No - There is a bit of a "not invented
here" attitude with Python, where some concepts like MVC is not yet
implemented because the developers are doing it their way. Also the lack
of separation; ie with Java you have the servlet runner
(tomcat/resin/jetty etc), the framework (Struts etc), and the template
language (JSP/Velocity) - and you can choose the ones you like. For
server/web apps this level of abstraction has not yet been developed for
Python. There is also Zope; of which I have no experience.
In terms of UI I think that the graphic toolkits are good. PyGame is
very interesting, not just for writing games, but also for writing
powerful graphic displays of data, and for simulation work.
The one huge benefit of Python over Java is its suitability for
teaching. As a ex-Java teacher I found it exceptionally difficult to
teach Java to people new to coding. I spent a load of time telling
people what to ignore with Java - ie we didn't want to discuss classes
and members, but need to write them to actually do anything.
Python on the other hand is like BASIC in that respect - you can even
type commands into a shell - and see how things work. Its a great
language for learning, but unlike BASIC is a great language for writing
real world applications, and has a fully Object Orientated capability.
There are a few niggles - making the indent a flow control aspect was in
my opinion a silly move; but once you start using it, its not so bad.
The only real problem occurs when you paste in some code and you get a
mix of tabs and spaces.
Before python I would have considered any weakly typed language to be
'unprofessional' - but the bottom line is that Python lets you get stuff
done, and on some recent projects that has meant 'utility' applications
have been done in a much shorter time with only 10% of the code compared
to Java.
Oh, one final gripe; name spaces. I wish you could have period separated
package paths like Java in the imports. In large applications you often
get class naming collisions. Java has a way of resolving those naming
issues. While I'm no fan of Java class paths, I think that Python could
have easily introduced a mechanism for nested packages. Its not a "deal
breaker" issue for me, but one I would have liked to see,
Other than that, its a great language, and the only one I see that could
challenge Java in terms of a broad cross platform language.
Ok, I lie - the other is - god forbid - C# - which with the introduction
of Mono is quite credible as a cross platform language. Thats NOT to say
I endorse C# - because its controlled by Microsoft the Mono team will
always be playing catch up. Python is open to all; warts and all.
More information about the HBLUG
mailing list