6 ms·
That "learn python the hard way" guy says don't use python 3. As someone who is at the "Hello World" stage, should I use 2 or 3?
by nvr219 8y ago
That "learn python the hard way" guy says don't use python 3. As someone who is at the "Hello World" stage, should I use 2 or 3?
- qgsrw3fd 8y agoWhoever says to use 2 today is a retard.
- klardotsh 8y agoI can't downvote, so instead I'll call you out publicly. This is neither a productive nor appropriate response. We can discuss the merits of Python 3 over 2 (almost all of which I full-heartedly would agree with!) without resorting to name-calling of "the other camp".
- qgsrw3fd 8y agoYou are right. My apologies. Whoever tells someone who is learning Python to use 2, which will be EOL in less than one year is not a retard, but a fucking retard.
- sametmax 8y agoAfter 12 years since v3 came out and the annual python survey showing 84% v3, i think it's really disrespectful from anyone to advice v2. But retard is not a convincing argument, even if i'm tempted to use it too.
- carbocation 8y agoI don't write a lot of Python (use it mostly when deep learning calls for it), but my understanding is that it's time to start with Python 3. I try to write Python 3 whenever I have to write Python. https://pythonclock.org/ https://pythonclock.org/
- phowat 8y agoPython 2 will be EOL'd on the 1st of January 2020. So you should definitely go with python 3.
- 0xADEADBEE 8y agoIt's worth noting that only the reference implementation (cPython) is slated for deprecation. To my knowledge, Pypy and others have no such plan.
- outworlder 8y ago> That "learn python the hard way" guy says don't use python 3 They are wrong. There is no good reason to start with Python 2 for new projects. The reasons people stay on 2.x are institutional inertia and legacy code. A hello world program has none of these problems.
- eesmith 8y agoThe previous poster should have written "said" not "says". If you look at https://www.learnpythonthehardway.org/ https://www.learnpythonthehardway.org/ you'll see the first paragraph starts "Newly updated for Python 3". The work started around 2 years ago - https://zedshaw.com/2017/04/22/learn-more-python-rough-draft-up/ https://zedshaw.com/2017/04/22/learn-more-python-rough-draft... . Shaw doesn't "agree with the direction of Python 3", and regards it as "being a complete waste of human energy" - https://zedshaw.com/2017/08/26/what-if-it-worked/ https://zedshaw.com/2017/08/26/what-if-it-worked/ . But that's different than saying that new projects, in 2019, should not start in Python 3.
- kalimoxto 8y agoShaw also declared that Python 3 is not Turing complete so I would take his Python 2/3 opinions with a heft grain of sea salt
- eesmith 8y agoCovered in https://learnpythonthehardway.org/book/nopython3.html https://learnpythonthehardway.org/book/nopython3.html . If I understand the trolling logic, "if it's impossible for Python 3 to support Python 2 then Python 3 cannot be Turing complete." This hinges on 'impossible' being used as a technical objection. The argument should be that it's economically infeasible for Python 3 to support Python 2, not that it's technically impossible.
- joshuamorton 8y agoEven then he's wrong. It's perfectly economically feasible to write a python2 interpreter in python3-the-language. Take an rpython based py2 interpreter and make sure the rpython code is py3 compatible. What he suggests is that since the python3 interpreter cannot run python2 code, that somehow this implies that python3 the language is not turing complete. This makes about as much sense as saying that since gcc won't compile my Java code, C++ isn't turing complete. In fact it's the same statement. And there are, in fact, valid reasons why the python3 interpreter cannot run both 2 and 3 code intertwined (mostly because things are ambiguous in such a situation. Does `{}.keys()` return a list or an iterator? How do you decide? Well you need to know if the code you're running is py2 or py3 in advance and you don't. I include his original statement here: [1]. [1]: https://www.reddit.com/r/shittyprogramming/comments/5ejbr9/proof_that_python_3_is_not_turing_complete/ https://www.reddit.com/r/shittyprogramming/comments/5ejbr9/p...
- ldiracdelta 8y agoPython 2 support is sunsetting in 2020 after over a decade of python 2 and python 3 support. I'd recommend starting with Python 3. Many external libraries you may need will only be issued for python 3 and many external libraries will choose to not even issue bug fixes for python 2.
- doctoboggan 8y agoIt is a good question, and I am glad you asked as many new python developers hear this advice from Zed. I think in 2019 there is no question that you should be using python 3. Zed seems to be personally offended by both how the transition was handled and some of the design choices in python 3, but I think he is doing his readers a disservice if he is still recommending python 2 today.
- minimaxir 8y agoThe bottlenecks to Python 3 acceptance were popular package and cloud environment support. Both have been resolved.
- 0xADEADBEE 8y agoOne oft-overlooked externality is the time taken to migrate. If I maintained a Python 2 codebase and can use Pypy as a drop in replacement after 2020, I'd certainly be tempted to do so.
- minimaxir 8y agoCorrect, but the original comment was asking about new code.
- bunderbunder 8y agoFWIW, the latest version of LPTHW is focused on learning Python 3. Beyond that, I personally don't find the arguments presented in versions of the book that recommend beginners learn Python 2 to be all that compelling. They read to me as one complaint about string handling that's wildly at odds with my own experience, nestled in a great big bowl of sour grapes about the fact that the breaking changes are happening in the first place. The library support issue is a consideration, but depends heavily on what you want to do. My own sense has been that it's tools that are primarily used by devops and sysadmins that have the poorest Python 3 support, whereas the rest of the ecosystem is more-or-less 100% migrated at this point. Many have already started to discontinue Python 2 support. So, if you're saying that you're at the "Hello World" stage, I'm guessing that you'll hit a lot fewer speed bumps if you just start with Python 3 and don't look back.
- happy-go-lucky 8y agoIf this is your genuine question, I'm afraid you are ill-advised and your Google-fu is rusty.
- mserdarsanli 8y agoThey are quite different languages with similar names, like java and javascript
- cpburns2009 8y agoPython 2 and 3 are nearly identical. Yes, there's some backward incompatible changes. It's nothing like the gulf between Java and JavaScript which are only related in that they use C-like syntax. Java and C# have more in common than JavaScript.
- ben509 8y agoI saw an interesting article about how a million line production codebase was able to run simultaneously in both python 2 and 3, so I don't see how you could call them "different languages with similar names."
- ageitgey 8y agoThat is not correct at all. Python 2 and Python 3 have relatively few syntax differences. You could teach someone the key differences in like 10 minutes. In fact, I would even say that the difference between Python 2 and Python 3 syntax is far less than the syntax difference between traditional javascript and the latest revisions to javascript (ES6+).
- raverbashing 8y agoToday, that advice is uncalled for Use Python 3
- ageitgey 8y agoHe's 100% wrong. Use Python 3. Don't spend a second thinking about Python 2. His complaints are bizarre. He mostly claims that Python 3 sucks because he can't figure out how to convert his old Python 2 code to work on Python 3 easily so therefore a beginner couldn't possibly learn the language from scratch. But all of his examples are edge cases of him intentionally fighting against the changes in Python 3 by doing things that don't make any sense like trying to concatenate unicode strings with raw binary data. It's just the weirdest argument ever. Python 3 makes almost everything slightly simpler and more logical - especially if you ever have to deal with unicode text. And since emojis are unicode and people love emojis, that means literally everyone. Overall, he comes off to me like people who spend a lot of time ranting about USB-C ports when in reality USB-C is mostly great and honestly just isn't that big of a deal anyway. It's a strange hill to die on. The only good historic argument for using Python 2 was that it used to be that some popular libraries weren't updated for Python 3 yet. But that hasn't been true for years. Nowadays you are more likely to run into libraries dropping Python 2 support than you are to find them not supporting Python 3. I can't think of a single remotely popular library that still doesn't support Python 3.
- N3cr0ph4g1st 8y agopython 3 all day