Hacker News new | ask | show | jobs
by symbiotic 5004 days ago
As a PHP developer I've been waiting for the web-dev group to jump on board with Python 3 before I make the switch. I'm hoping it will be sooner rather than later.
2 comments

I'm setting aside the question of whether or why to switch. I'm also setting aside the possibility of starting to learn now on Python 2.7, which is what I think you should really do assuming you don't intend to procrastinate it ;)

Assuming you do want to wait on Python 3 adoption, your timing should depend on the framework you want to use, because effectively each one has its own community and ecosystem, and their adoption is at completely different rates.

If Pyramid looks good to you, for example, it already is on board with Python 3. Bottle is on board with Python 3. If you want to use Django, which is what most people will want to do, you should just wait on Django to release a Python 3 version, and Django should be usable on Python 3 within the year. If you want to use Flask (considered the closest analogue of Ruby's Sinatra) then it could take a while.

I see a couple mentions in this thread of Flask taking a while to adopt Python 3. I am relatively new to Flask, could you explain why they are seemingly behind things in regards to Python 3?
The Flask author's post about issues he has faced with Python 3 might give some insight to that: http://lucumr.pocoo.org/2011/12/7/thoughts-on-python3/
There is some work currently going on to make Flask run on Python 3.2.

https://github.com/puzzlet/flask/commits/py3-dev

Few core developers (mainly, one, Armin) that couldn't be bothered enough. It's a volunteer project after all.

He did write about the unicode problems with the Python 3 changes and the need for an improved WSGI spec (heck, he even co-wrote the unicode literal change PEP).

But after the new WSGI spec was out, and the u thing was already implemented in 3.3 pre-release, there was no much motion in Flask, whereas Pyramid, Django and others have already started work.

Even the "When will Flask support Python 3" document has not updated and is 2 years out of date in it's contents.

Is the difference between 2 and 3 so huge that it is not possible to make a jump?
Here is my thought process...

Regardless of how you feel about PHP, I've spent enough time with it that I can make it work and write good code, quickly.

I do want to switch to another language at some point (I'll leave the reasoning for that out of this discussion).

Why switch to Python 2.7 if it's going to be old in a year or two? Even if there isn't a huge difference between 2.7 and 3.x it sounds like it would be a nightmare trying to upgrade any of the old work that I would have done in 2.7. So either I've got some projects that will be on 2.7 forever, or I go through the hassle of trying to upgrade. I'd rather just wait and avoid the whole debacle.

There are ways to write Python2 code that will work when you make the switch to Python3. It _is_ a hassle, but it's quite doable.

This may not convince you (and I perfectly understand why), but I think it's worth giving Python a shot even if you're fluent in another language.

Interesting, I'll look into it!
It's definitely possible (and not really hard), but I understand the mindset: if you're coming from an other platform, why bother with switching when you can wait a bit and just start with Python 3?
Because Python 2.7 is completely mature and production ready and also allows you to write code which runs pretty easily on Python 3. Then you are marking Python 2.7 as deprecated version at the time where before you would have been just getting started.

Really this is down to whether you want to do something in Python now, or you want an excuse not to do it in Python for some time. It's not a bad excuse but it's also not a strong reason to wait.