Monday, May 26, 2014

Python 2 versus Python 3 a beginners perspective.

I wanted to comment from a beginners perspective on the constant attacks on Python 3 by some people who believe Python 3 was a step backwards and that Python 2 is much better. For example Hacker News recently had a post "Python 3 is killing Python". I respectfully beg to differ.

I'm a new programmer to Python and started about 1.5 years ago. I chose Python 3 because it seemed pointless to learn the old version. Given that I was starting with no prior knowledge of Python, there was nothing to be gained from starting with Python 2, only to have to learn Python 3 at some point in the future.

I'm not a great programmer like Zed Shaw or Mitsuhiko, developers who I very much admire and who are fairly vocal advocates of Python 2. I'm not even a particularly good programmer to be honest.  I'm an adequate beginning programmer and can get the things built that I want and I love doing it.

I love programming with Python 3. I don't experience it as a chore, or complex, or difficult, or broken. When I first started with Python 3, availability of libraries was a problem. The vast majority of libraries were Python 2 only. Today in mid 2014 I would say that apart from Amazon and Google, third party library support for Python is now effectively solved for many common requirements. Amazon and Google do need to have an explicit position on Python 3 and communicate it. Apart from that, there is almost never a problem finding a Python 3 third party library to do what I want. Have a look at this list to see what supports Python 3 http://python3wos.appspot.com If I want to do something in Python 3 then chances are there's a third party library to do it.

I applaud the courage of Python 3 to be backwards incompatible. Whether or not they got it right is open to question but it's not always a good thing for technology to remain completely committed to being backwards compatible.  Infinite commitment to backwards compatibility results in an accumulation of complexity, cruft, strange edge cases, massive testing load, inconsistency and bloat.  Windows is the prime example. Sometimes it makes sense to have a spring clean and leave the old concepts behind.

One of the key complaints about Python 3 is that it is so hard to build code that works on both 2 and 3. Whilst I recognise that vast quantities of legacy code must remain backwards compatible, perhaps try building some new projects purely in Python 3. Maybe that won't hurt so much.

The vocal critics of Python 3 keep saying things like "no-one uses Python 3". I don't believe this. Unless compelling evidence can be put forward to say that no-one uses Python 3. Where is the tangible evidence to support such a claim? Download stats that show lots of Python 2 downloads says nothing about how many program with Python 3.

I don't care if people want to stick with Python 2 - they can do what they want. I do have to say however that yelling about how good Python 2 is sounds very similar to the people who used to yell about what a great operating system OS/2 was, or how fabulous the Amiga was. These are old and dead technologies. It's really irrelevant whether or not some old technology is better than the new stuff. The old is gone. Sure you can fork Python 2 and try to keep it alive, just like Team OS/2 keep using OS/2 and all over the world hobbyists remain committed to the Amiga dream.

Python 3 works for me and I love it. As a beginner it was a great learning experience. I see increasing support for Python 3 everywhere.  I rarely run into roadblocks. Python 3 support seems to be becoming the standard rather than the exception. Looks to me like a bright future as evidenced by the Python Wall of Superpowers http://python3wos.appspot.com.

No comments:

Post a Comment