开发者

Python 2 or Python 3 as the student's first language [closed]

开发者 https://www.devze.com 2023-01-12 11:04 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported b开发者_运维问答y facts, references,or expertise, but this question will likely so
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported b开发者_运维问答y facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

Which is more suited as the platform for a first course in computing: Python 2 or Python 3? Reason for asking your opinion: Python 2 is used in the vast majority of installations worlwide, but Python 3 is the coming thing.


Teach them both (imho).

Teach the Python 2 (in the most pythonic way) and than present your students the 2to3 changes, and their meaning (print "string" => print("string") why?)

By the way, if you use 2.7 http://docs.python.org/dev/library/stdtypes.html#memoryview is an interesting new feature!


I would say that it depends on your curriculum. If you are going to be using/showing some open source libraries, you may have issues with some of them working on 3, so in that case go with 2. If you're just showing the language itself and having your students write everything from scratch without the use of any external libraries, I would say go with 3.


Frankly, I think you have a great opportunity to teach your students a valuable lesson: keeping their skills up-to-date while daily dealing with "older" code. This is a simple reality in life they'll have to grasp if they want to be successful programmers (heck, it's likely true for most jobs).

Here's how I would approach this: teach them 2.x as the primary language of the course. The majority of Python libraries will not be compatible with 3.x and the programming concepts aren't terribly different between the two major versions. During the course, however, give them assignments which require them to investigate Python 3, learning what's different and why. Take a little time to teach them about migration tools and some of the basic concepts for updating an older code base. For an entry-level class, you might also consider giving them a basic, 2.5 program, and have them manually update it to 3.1.


Python 2. Unfortunately library support for python 3 is dismal.


For a student, my recomendation is python 2.x, because older it is, easier you find code exapmles and usage of pythonic functions. If you choose to study python 3, you may have problem finding code examples and help.

Also there is much more python 2.x expert than 3.0.


I would say to teach Python 2.*, as while Python 3 is the new hotness, there are very few supported libraries yet, and the vast majority of resources on the web are for older Python versions.


id say python 2, python 2 has been around for a while and is very mature, with a lot of libraries and modules and major frameworks available for it. Python 3 is very new, and doesnt have many libraries yet. I guess this will be the scenario for a couple of years.

0

精彩评论

暂无评论...
验证码 换一张
取 消