views:

153

answers:

7

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.

+5  A: 

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!

Enrico Carlesso
IMHO - teaching 2 and 3 and about 2to3 is a bit much for a student's very first programming language. Sticking with a single version would be better to teach the basics.
Matthew J Morrison
In my humble opinion, teaching programming to students is not meant to get them to be developers, but to understand the development, and many changes for a programming language are due to optimizations/improvement which can be useful to understand.
Enrico Carlesso
+4  A: 

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.

Matthew J Morrison
A: 

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

Justin
A: 

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.

FallenAngel
A: 

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.

Fara
A: 

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.

Ishihara
+3  A: 

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.

bedwyr