4 ms·
Why do you think the flavor of Python taught matters? I would say that compared to learning how to write and understand a small program, the difference between
by maxerickson 12y ago
Why do you think the flavor of Python taught matters?
I would say that compared to learning how to write and understand a small program, the difference between Python 2.x and Python 3.x is trivial.
(I'm talking about learning the language; for a large Python 2.x code base, the transition to 3.x is likely to have unclear payoff.)
- Igglyboo 12y agoI think it's important teach what's relevant in the current day, every likes to parrot the "Python 3 has no support" line but it's simply not true[1]. The developers have said multiple times there will be no 2.8 and the 2.7 line will only receive security fixes. Python 3 is the future of Python and not teaching it to students would be a disservice to them. [1]: https://python3wos.appspot.com/ https://python3wos.appspot.com/
- maxerickson 12y agoSure. My point is that nearly everything you learn about writing a program in 2.x is relevant to writing a program in 3.x. You do have to keep track of whether print is a statement or a function or how literals map onto types, and some libraries are imported using different names and some APIs have changed a bit, but if you understand all that jargon, it's not that big a deal (I'll repeat my disclaimer here about transitioning a significant code base being a different thing than managing the differences).
- Alupis 12y agoWell, yes, sure... core programming concepts are the same regardless of language used and/or version. However, from my experience, most students don't venture off on their own until after becoming very familiar with a language. Not all students are experimental enough to hack on personal projects for fun or what-have-you. I've actually had a fellow student tell me the Java class file he emailed me for a project would only run on Java 6 since that's what the lab had installed -- obviously wrong. The point being -- students will intern what they are taught. They should be taught on modern versions/concepts so they intern modern ways of doing things. By teaching Python 2.x to students, you do them a disservice by teaching them the way Python "used to" do it... not how it "does it" now. As an aside -- with all of the major Python libraries now ported to 3.x -- I see little to no reason anyone should ever learn Python 2.x, or use it (with the exception of the obvious legacy codebase support issue).
- crdoconnor 12y agoEvery so often I check to see which of my 3rd party libraries has acquired python 3 support. It's edging up over the years, but it's still between 60-80% (depending upon the project). Not all of them small, either - some are ones you really wouldn't relish rewriting. It has some neat features, but nowhere near enough for me to be prepared to dump 1/3-1/5 of the python ecosystem. I'm sure python 3 is coming eventually, but I think it's still a looooong way off.
- Alupis 12y agoWell, from my perspective, students should learn on current gen tech, be it Python 3.x or Java 8, C++11, etc. I agree that simply learning some programming has no bearing on the language version, etc... however, as students get familiar and start to experiment on their own, they may learn "the old way" of doing things. There is no downside to teaching Python 3.x, there might be a downside to teaching 2.7.x.
- BuckRogers 12y agoYeah there is a downside to 3.x. The transition has failed from what we can see. It was released in 2008. It's 2014 and it's still the used by the (vast) minority of people in the Python community. Programming isn't one of those fields, like most things in life- where 'the latest version' is always the right choice. The best way to explain it... it's like saying everyone should adopt Windows 8, that there's no downsides. It's hard to explain that to someone who isn't in the trenches using it because it goes against peoples natural urge to be 'updated'. Unfortunately, this transition hasn't worked out- no one is saying it but it has pretty much failed. Turned into a 20 year transition. Red Hat is supporting Python2.7 until 2027. Core dev team till 2020. Guido van Rossum works at Dropbox, who started working on a new JIT compiler (Pyston)- this year that is targeting Python 2.7. There are actual performance regressions in Python3. I'd wait this one out for a while longer. Python 2.7 is only 4 years old and the stability to the language has actually been a boon rather than churning out flawed release after flawed release like many Python3 versions have been. To be honest, if someone forks Python2.7 and continues that branch, that's where I'll be going. Not to 3. That will be the end of 3, I assure you. That will be a -huge- downside to teaching Python3. :) This transition is not in the bag yet.
- Alupis 12y agoWell, from the python.org website: > Short version: Python 2.x is legacy, Python 3.x is the present and future of the language[1] This should be enough of a reason for classes to move to 3.x. Regarding your "in the trenches comment", remember, most of the folk on HN are involved in software engineering in some capacity, myself included. No doubt it has taken a long time to move into 3.x, and it may take a while still. That doesn't make an argument to teach students a language dialect that, according to it's maintainers, is legacy. > In particular, instructors introducing Python to new programmers may want to consider teaching Python 3 first and then introducing the differences in Python 2 afterwards (if necessary), since Python 3 eliminates many quirks that can unnecessarily trip up beginning programmers trying to learn Python 2. [1] As I mentioned before, most (all?) of the major Python libraries have now been ported to support 3.x, so this leaves little reason to start out learning 2.x (unless you are setting out to maintain an old codebase, but we are talking about academics here and new beginners, so that point is moot). [1] https://wiki.python.org/moin/Python2orPython3 https://wiki.python.org/moin/Python2orPython3