Ask HN: Python 3 or Python 2.7?
I've been meaning to learn Python for a long time now. I have no experience in programming (except for a few lessons of LPTHW). But in a month, I'm going to have a lot of free time on my hand and I've decided it's time to get off my bum and finally learn it.
But my question is, should I learn Python 3 and be future-proof or learn Python 2.7 and figure out the differences later on?
I'm on Debian Sid (Crunchbang to be specific) right now, but it isn't much of a problem to install Python 3.
12 comments
[ 2.7 ms ] story [ 35.3 ms ] threadI've got active projects in both code bases right now - although I prefer Python 2.7 because it has taken a while for the libraries and frameworks to move over to 3.0.
However, once you understand the core concepts behind Python, about 90% of the differences between the two become obvious and trivial to work around for most projects.
You should get some exposure to 3.x since Guido has indicated any significant new language features will be implemented in that branch and not back-ported to 2.7. They have also done a number of optimizations in the 3.x branch which may be of interest for certain projects.
Python 3 is a fork with broken compatibility and poor adoption.
I've been using v3.n for over a year, will probably go to 3.3 (currently in alpha) when it is finalized. Once I did the v2 to v3 migration (less than a week's effort) I never had to look back.
If you are learning and not locked into any old framework, then go with v3.2. All the "batteries included" stuff is available in v3.n and most gnarly stuff has been cleaned up. Whilst some excellent independent frameworks haven't been ported, I would prefer to use stuff that is in active development and thus ready for the future.
If you're not using any dependencies or frameworks relying on older versions, start with 3.
Either way, as long as you work at it continuously, moving backwards or forwards won't throw you off too much.
With 2.7, I can take advantage of LPTHW and some courses at Udacity. And like you guys said, if I learn 2.7 well, moving to 3 isn't that hard.
So thank you all for the comments and suggestions, they helped a LOT. :)