Kent Johnson wrote: >Fabio Zadrozny wrote: > > >>I agree that python code is usually smaller... but what you did is too >>unfair (the code below would be more suitable for the comparrison). >> >>python: >>print "%10.2f" % 10 >> >>java: >>System.out.println(String.format("%10.2f", 10.0)); >> >> > >Though String.format() is new in Java 1.5 so in older code or for >backward compatibility the longer code may be found. OTOH Python has >supported % formatting since at least version 1.4 released in 1996. >http://www.python.org/doc/1.4/lib/node11.html#SECTION00315100000000000000 > >In my experience the original point is valid - Python is usually >(always?) more concise than equivalent Java code, and often dramatically >so. Python makes common operations easy; Java sometimes seems to go out >of its way to make them awkward. > >Kent > >
Yeap, I agree with the original point too (as I explained in the rest of my comment)... just didn't think it was a 'fair' comparisson. ;-) -- me? When I use java I write 1.5 code and 'retroweave' it to be compatible with java 1.4 (Pydev is done this way) -- and I use Python at work -- and I'm very happy with it... I just think that a language is as a tool, and each may be suited better for a different occasion. The 'usually smaller' I mentioned is because sometimes java code gets smaller because of the already-existing codebase... E.g.: for developing an IDE, Eclipse already has a huge codebase, so, if I wanted to do all that was already done in it in python just because Eclipse was in java, I think I would be doing the wrong decision, and besides, I could use jython for it if I wanted to... And from what I understood, the original poster had a large codebase in java already, so, I'm not sure that changing everything to python would be the way to go (altough that DOES depend a lot on the original codebase quality). Cheers, Fabio -- Fabio Zadrozny ------------------------------------------------------ Software Developer ESSS - Engineering Simulation and Scientific Software www.esss.com.br PyDev - Python Development Enviroment for Eclipse http://pydev.sf.net http://pydev.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list