Most of my programming background is in Java, and I still run most of my Java programs. However, I am starting to learn Python for some side projects at work, and I would like to learn it as independent of my Java background as possible - that is, I don't want to just program Java in Python. What things should I look for?
A quick example - when I looked at a Python tutorial, I came across the fact that changed function parameters (such as a list) are saved (remembered when called on a call). This contradicted me as a Java programmer, and it was hard for me to plunge. (See here and here if you do not understand the example.)
Someone also provided me with this list, which I found useful, but short. Does anyone have other examples of how a Java programmer can misuse Python ...? Or are things that a Java programmer mistakenly suspected or had trouble understanding?
Edit : Well, a brief overview of the reasons raised in Article I related to preventing duplicate responses (as suggested by Bill Lizard). (Please let me know if I am mistaken in the wording, I just started with Python, so I can’t fully understand all the concepts. And the disclaimer will be very brief, so if you don’t understand what it gets to check link.)
- Static method in Java does not translate to Python class class
- The switch statement in Java translates into a hash table in Python
- Do not use XML
- Getters and setters are evil (hey, I'm just quoting :))
- Copying duplication is often a necessary evil in Java (e.g. method overloading), but not in Python
(And if you find this question generally interesting, check out the link anyway. :) That's pretty good.)
java python
froadie Feb 26 '10 at 3:48 on 2010-02-26 03:48
source share