Does Python compete with Java?

Chris Herborth chrish at cryptocard.com
Tue Apr 6 08:36:53 EDT 2004


Roy Smith wrote:
[... JSP example ...]

> 13 lines of code instead of the original 26!  This 2:1 ratio seems to be 
> pretty typical in my experience.  It's not that I'm cramming more 
> application logic onto each line in the Python version, it's that I'm 
> getting rid of the fluff that takes up lines without adding anything 
> useful.

I've experienced the same thing with the XML applications I tend to write at 
work; the Python version is much smaller than the Java version, much easier 
to read, and it was much easier to write.  And tends to run about as quickly.

Strangely enough, I've had the same results with C# and .NET XML apps; 
smaller, with less extraneous text in the code.  And very fast.  If Mono 
and/or GNU Portable.NET were further along, I'd port my XML apps to C# (I 
need to run on OS X and, eventually, Linux as well as Windows)...

> The end result is that it's harder to write, and the effort that goes 
> into making the compiler happy is that much less effort that I can put 
> into making sure I really understand how my application should be 
> designed, and testing it.  It's a seeing the forest for the trees kind 
> of issue.

One of Python's most awesome features (IMHO at least) is that you can fire 
up an interactive interpreter while you're writing your code, and try things 
out as you go... using this technique, I've unit tested methods and 
algorithms interactively and ended up with useful, non-trivial applications 
that run and work properly the first time.

With compiled languages (Java, C#, C++), I find I'm writing a bit of code, 
taking a break to compile it, figuring out how to unit test the method... 
Python saves me a huge amount of time in the prototype and development cycles.

-- 
Chris Herborth                                     chrish at cryptocard.com
Documentation Overlord, CRYPTOCard Corp.      http://www.cryptocard.com/
Never send a monster to do the work of an evil scientist.
Postatem obscuri lateris nescitis.



More information about the Python-list mailing list