[Tutor] Python 3 for Beginners was: (Re: intro book for python)

Alan Gauld alan.gauld at yahoo.co.uk
Sun Sep 3 09:39:43 EDT 2017


On 03/09/17 11:02, Leam Hall wrote:

> Anyone that uses python on Linux has to use Python 2. 

Errr, nope. I use python 3 on Linux all the time. My
last significant Python 2 program was about 4 years ago.
It may be true that the distro maintainers are still using
python 2 for historical reasons but that's got no relevance
to whether a Linux user would want to use Python 3 for
their own programs - even ones accessing the OS.

> I'm not seeing the benefits. How long has Python 3 been out? How many 
> others are seeing the benefits of total change? 

It's not a huge advantage, many of the changes in Python 3 are
theoretically based, cleaning up of how Python does things to
make them fit with what Computer Science teaches. That often
means that it becomes harder to use, but the long term payoff
is a better foundation for building new things in the future.
We may only see the real benefit of Python 3 when Python
4 comes out - which based on history should be in 2020!

> "you should upgrade" realize it's weeks or months of work with no real 
> reason to do so?

I would not advocate converting all the existing code to v3
just for the sake of it, but there is a good case for converting
programs as you upgrade them. Doing a single application
isn't a big hit if you are already doing work on it.

> Yesterday I was coding and had to work around Python 3 dict.keys() 
> returning a "dict_keys" type vs a list. Why did we need another type for 
> this? 

Because it makes the whole ecosystem more consistent and
ultimately more extendible. But I agree in purely pragmatic
terms, and especially for new programmers without a CS
background, Python 3 is much, much, harder to come to
terms with. And things like dict views and iterators
instead of simple lists are a big part of that. If I was
writing my original "Learn to Program" book now, I'm not
sure I'd still pick Python. On the other hand, I can't
think of any other language that is a lot better for
teaching raw beginners, while still being useful in the
real world.

> these sorts of problems easily. Returning a new type, without 
> significant benefit, makes it harder for people to progress in the 
> language.

The difference is that python has entered the world of computing
professionals. Its now being used for industrial scale projects
by programming professionals who have a CS background. They
expect the language to behave in certain ways. They expect it
to be able to handle large data volumes without crashing
(huge lists getting loaded into memory for example) Many
of the changes accommodate that audience rather than the
total newbie.

> language was that clean and easy to learn.

It was easy to learn but it had lots of not so nice
things inside. Python 3 has tried to tidy itself up, and
industrialize itself but does so at the expense of adding
complexity for beginners.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list