r/Python • u/AlirezaSavand • Dec 01 '16
It’s Python, Not Python 2, Not Python 3!
https://medium.com/@Alir3z4/its-python-not-python-2-not-python-3-7caeef5adb29#.f4e9cl32n10
Dec 01 '16
You should definitely learn python 3 though, even if they are apparently the same thing
4
u/Boredstudnt Dec 01 '16
I agree, would be stupid to miss out on new features that are in 3. And reading 2 code is mostly easy.
-4
u/AlirezaSavand Dec 01 '16 edited Dec 01 '16
Exactly, there should be no debate over this. Why we should encourage newcomers to older version of Python, what's there for them that's not in the current one ?
Why anyone should be missing all new features. While they're learning "Python 2", they would see those features in other language and move on to the another language.
1
u/ovoid709 Dec 01 '16
The software I use daily only accepts Python 2.7, so I use that. Sometimes it's the fault of old vendors for not updating their core infrastructure. I'd gladly learn the current version, but other than my own projects there'd be no real reason.
0
Dec 01 '16
[deleted]
4
u/ovoid709 Dec 01 '16
I was a new user to Python and that was the language being used. I imagine anybody going into the geospatial field that wants to learn Python would be in the same boat. Python 2.7 dominates that whole industry. I've had friends hit walls after doing intro classes in Python 3 and then trying to use it with some of the big geo packages. The syntax is fairly quick to convert, but that first hiccup scares a lot of new people away. I think the answer is start with what version will serve you best.
2
u/sentdex pythonprogramming.net Dec 01 '16
The real issue with this article is it's attempting to fight two battles.
One battle, the question of what version a newcomer asking which version to learn should choose, is easily win-able.
If you only pursued that one, you'd have plenty of upvotes agreeing that Python 3 is the version someone should choose if they have the choice.
...but you couldn't help yourself and you attacked anyone who still uses Python 2 to this day. Whoops!
You claim "all you have to do is port your code!"
HAH. Come on man. That's like saying "cancer is easy, all you have to do is one or two rounds of chemo."
Have you ever ported code? How much code? Even a small business that uses Python heavily can have 100,000 lines of Python code, easy.
You want to port that? Let's say you're the CTO, tasked with making decisions like whether or not to port code. Is that actually a good idea? It'll take probably weeks to do it safely, and still possibly bring new bugs to surface.
Let's say you have a manager, and you want to port that code. They're going to ask specifically what gains the company will get by porting the Python 2 code to Python 3. What will you tell them?
Chances are, you've got nothing, and there's no really good reason to fix what isn't broken. To be honest, porting just to port is a pretty bad idea. If things are working smoothly in Python 2, then you really should just keep it in 2.
Where possible, when a choice really is easy, choose Python 3. But where there's a real cost to using Python 3, there's really nothing wrong with 2.
1
u/AlirezaSavand Dec 02 '16
So far this is the best comment and criticize on my article. Thank you <3
10
8
u/federicocerchiari Dec 01 '16
This whole debate makes newcomers to run away, it’s confusing
The very first sentence is damn right!
my two cents: a month ago I made a simple script for a friend of mine, he don't know nothing about programming and for him Python is "A program that does things". Well, I sent him the script, told him to install Py3 and run the script; he replied "they say in the Internet that Py2 is better...".
The main effect of this whole debate is "python 2 or 3" as one of the first search suggestions on google, that leads to non-programmers and newcomers to read tons of accusations and just have the feeling that "Python is divided in two and they both suck".
edit:format
4
u/vph Dec 01 '16
I don't think the question is really about learning Python 2 or 3. It's really about maintaining two different versions. There are many packages that depend on Python 2, or even specific versions of Python 2. It's a headache to have to deal with multiple versions. People think virtualenv is a strength, I think it's a sign of weakness of the ecosystem.
3
u/naught-me Dec 01 '16
Everybody hates on PHP, but old code still works in new versions of PHP. In practice, that's a much bigger deal than PHP's warts.
4
u/leonardnimoyNC1701 Dec 01 '16
Sometimes when I'm sure no one is looking, ill lock my door, turn out all the lights in my house, and will whisper ever so faintly modern PHP isn't that bad.
3
2
u/brtt3000 Dec 01 '16
It would really help if we could filter searches on Pypi for Python 3 support.
1
u/CarpeTuna Dec 01 '16
Is downvote broken? It was at 4 but would not go to 3. I really want it to go negative.
0
Dec 01 '16
[deleted]
10
2
u/mipadi Dec 01 '16
Yeah, I don't get why every pro-Python 3 article has to be so aggressive.
I work at a company with hundreds of thousands, maybe even millions, of lines of Python code. Some of that code has been running without problem for over 15 years now. It's code that the entire company depends on to get its work done everyday. We don't really have the option of just rewriting all that code (or at least confirming that it will work in Python 3) right now. Sure, new stuff is written in Python 3, where possible, but we have a lot of important legacy code written for Python 2, and confirming that it will work in 3 is going to be a big undertaking.
Articles like these seem to mostly be written by a bunch of startup founders who have never worked at a company that is more than 6 months old.
1
u/billsil Dec 01 '16
What an idiot. The first usable version of Python 3 was Python 3.3 released on September 29th, 2012. The developers even said that. Sorry guys, we messed up and decided to add back
u'my favorite string'back. I think that's also when they decided to unscrew upstructrequiring unicode, which made using Python 2.7 (which required bytes) a pain. It took them to Python 2.7.7 to fix that issue.0
u/drdeadringer Dec 01 '16
You appear very angry. Is this a normal state for you or is this a particular third rail for you that's been building up for a long time?
-1
Dec 02 '16
while in theory that seems like an innocent question, the situation nevertheless contains a sufficient volume of ambiguity, so that when presented in a less than generous manner -- to an uncharitable mind -- there is some difficulty in justifiably assigning to it the epithets you applied to the statement, inasmuch as the precise correlation between the information communicated and the facts, insofar as they can be determined and demonstrated, is such as to cause epistemological problems, of sufficient magnitude as to lay upon the logical and semantic resources of the English language a heavier burden than they can reasonably be expected to bear.
3
4
Dec 01 '16
[removed] — view removed comment
3
u/takluyver IPython, Py3, etc Dec 01 '16
The way most Linux distributions have managed it, it's hard to change what the name
pythonpoints to without breaking things. But you can change it for your own terminals by adding to your~/.bashrc:alias python='python3'1
u/kyuubi42 Dec 01 '16
The only sane way to deal the python3's backwards incompatibility is to admit it's a different language. Pretending it isn't is just asking for confusion and things to break.
49
u/ticketywho Dec 01 '16
Not really sure what this adds to the current conversation taking place in the community.
It completely misses the point that when you set out to learn Python, the first choice you have to make is whether to pick 2 or 3. We're not helping beginners by pretending that choice doesn't exist, because it does.