Thanks from the Java Developer
Ant
antroy at gmail.com
Thu Apr 20 17:30:13 EDT 2006
Python ruined my life.
I am a Java programmer by profession, and ever since learning Python, I
find it a real chore to open Eclipse and write Java code (or worse -
the XML config files that seem to glue J2EE together). And while I
spend some of my spare time liberated by Python, I spend 10 times as
much time coding in Java at work.
While this is just a little tongue in cheek, I do very frequently find
myself thinking "Why is this so hard?" when doing something that would
be trivial in Python. One of my favorites:
f = open("file.txt")
s = f.read()
f.close()
StringBuffer b = new StringBuffer();
try {
BufferedReader br = new BufferedReader(new FileReader("file.txt"));
String line = br.readLine();
while (line != null){
b.append(line);
line = br.readLine();
}
} catch (IOException ex){}
String s = b.toString();
WTF!!
More information about the Python-list
mailing list