Performance java vs. python

namekuseijin namekuseijin at gmail.com
Wed May 20 22:04:40 CEST 2009


Ant escreveu:
> # Python
> fh = open("myfile.txt")
> 
> for line in fh:
>     print line
> 
> // Java
> 
> ...
> 
> BufferedReader reader = new BufferedReader(new FileReader
> ("myfile.txt"));
> String line = reader.readLine();
> while (line != null) {
>     System.out.println(line);
> }
> 
> ...
> 
> And that's without all of the class/main method boilerplate or try
> catch block required due to checked exceptions.

Indeed, and it's so complex and such a manual burden that you even 
forgot a further
line = reader.readLine();

inside your while block.

I find it completely unimaginable that people would even think 
suggesting the idea that Java is simpler.  It's one of the most stupidly 
verbose and cranky languages out there, to the point you can't really do 
anything of relevance without an IDE automatically pumping out lots of 
scaffold code for you.

-- 
a game sig: http://tinyurl.com/d3rxz9



More information about the Python-list mailing list