37 ms·
Python 3: Ten years later
- speedplane 8y agoNo.
- cft 8y agoI wish they spent the effort on making Python 2 faster and removing GIL instead.
- karmakaze 8y agoThat and Unicode.
- monk_e_boy 8y agoWhy? I teach Python and c++ to A level students. They pick up the basics in a few weeks. C++ is pretty easy. We push our students through the c++ institute exam with few issues. Choose the right tool for the job. If you need speed, choose c
- walshemj 8y agoor Fortran
- Santosh83 8y agoC++ is pretty easy!? Wow, that's an opinion you often don't hear. :-)
- Joeboy 8y agoAs in "pretty easy to introduce catastrophic errors with".
- klipt 8y agoIf you use the right features of C++17 errors are easier to avoid than ever. The problem is that this elegant subset of C++ is hidden inside ... the rest of C++. I guess that's the counter example to Python's 2/3 breaking change. C++ just keeps adding new features while retaining all the old ones for backwards compatibility, even if they're awkward in context of the new language.
- pritambaral 8y agoI once read somewhere that C++ would be fine if one just used a sane subset of C++, but the challenge was agreeing on which subset.
- monk_e_boy 8y agoTo be fair, we're not coding huge projects in it, just little toy programs. No one seems to struggle too much though. And the things they struggle with, they would struggle regardless of the language chosen.
- guitarbill 8y agoagree with choose the right tool, and don't write it yourself. a beginner in c will struggle to beat python + numpy for speed, no matter how "fast" c is
- guitarbill 8y agoPython 3 is worth it just for Unicode handling. As someone using a language that is uses non-ASCII characters, thank you if you're using Python 3 and made your software more internationally compatible.
- saurik 8y ago...or you could just use the unicode type in Python 2; like: all of my Python 2 software handled languages in other character sets correctly (and yes: this was stress tested often as I have had many many users from China and the Middle East). There was absolutely nothing wrong with Python 2 and Unicode, and if anything Python 3 just made a bunch of stuff impossible to do correctly (in particular encodings for filenames) until years later (I think Python 3.4 or something is when they finally got their Unicode shit together; meanwhile, Python 2 worked great).
- guitarbill 8y agoGood for you, but that isn't how it usually worked. Python 3 has made my life easier, but if you really think "There was absolutey nothing wrong with Python 2 and Unicode", I doubt I'll be able to convince you. So I'll simply say again: thank you Python 3 maintainers and developers, it's a huge help to me.
- bayesian_horse 8y agoI was always able to work out my unicode trouble in Python 2 ... eventually. It's better now, less space to screw up.
- Latty 8y agoExcept doing the right thing by default is important, and the reality is that Python 3 code is way more likely to handle Unicode correctly, which is what we want. People constantly complain, but honestly changes like Python 3 have to happen - the alternative is just another completely new language taking over instead.
- pacifika 8y agoRandom scaremongers. Just look at pypi
- bayesian_horse 8y agoYes. And I guess it could have gone worth. On the other hand, I don't expect the community in a mood to embark on Python 4 any time soon, though it would make sense, in terms of version numbers and time passed.
- Michaelanjello 8y agoThere are still idiots on Github using Python 2 for new projects. These are usually academics who don't actually share any love for technology. Their code will never be used by anyone.
- upofadown 8y agoThere has been a pledge by the largest group of Python developers not to mess around with Python 2. So if you want your code to be able to just run forever without any concern for all the new and exciting language ideas being loaded into Python 3 then Python 2 is the logical choice.
- bakery2k 8y agoI've heard of this - people considering Python 2.7 as an "LTS" version of the language, receiving bug fixes but otherwise remaining unchanged for many years. I wonder, once 2.7 is EOL in a years time, whether the language developers will consider a "3.x LTS" release?
- pacifika 8y agoAs long as you don’t need to connect to sites using https
- Sir_Substance 8y ago>Their code will never be used by anyone. Critical FORTRAN libraries are still the center of certain types of analysis, and they're often used by _everyone_ in the field. The reason for that stems from two issues: 1. Making accurate simulation libraries for things like weather formation, magnetic field formation or hydraulic fracturing requires crazy in depth knowledge of the systems you are modelling, and takes years of implementing and hypothesis testing to ensure they are accurate enough for academic use. 2. Academics are not software developers, they don't get paid for the software they write, they get paid for papers. They get no reward for rewriting those crazy indepth libraries every decade in the new language de-jour. This is a perfect example of why the python2 to python3 hard-cutoff transition was a terrible idea. "Just update your software" is something you can say to professional software developers with a straight face. You can't say it to academics, or mechatronics engineers, or real estate agents, or photographers, or _anyone else_ who has a job that benefits from a little bit of software but is mostly about delivering something other than software. Well, you can, but they're going to ignore you.
- dethos 8y agoDefinitely yes, it took some time and had some costs but nowadays python (3) is a much better language. Perhaps it could have been done differently, however it is in the past now.
- olliej 8y agoIt's a good example of why JS hasn't had changes that break existing code, so that's good
- iagooar 8y agoAs an outsider who only uses Python when I need a specific tool that's only available through pip: it's still one of my biggest nightmares. Every single time I need to install something with pip on MacOS there is this hour-long struggle with figuring out how to get the correct version of Python (2.7 vs 3) working with the correct version of pip working with the correct version of the library itself. I don't know, I guess people who use Python regularly have figured it out, or maybe it's just a MacOS thing. For me, it's just a major PITA even 10 years after release.
- mehrdadn 8y agoI don't have a Mac and maybe you've already tried this, but just in case, you can always do python2 -m pip install ... or python3 -m pip install ... to make sure it's running within that particular Python installation. You can use the --user flag to install to your user directory as well, if the system level is annoying.
- singularity2001 8y agowhy is it that the pip command can't handle what it's supposed to do, instead you have to resort to `python3 -m pip install`? Hell, it even breaks itself: pip install --upgrade pip # => pip unusable https://github.com/pypa/pip/issues/5447 https://github.com/pypa/pip/issues/5447 https://github.com/pypa/pip/issues/5221 https://github.com/pypa/pip/issues/5221 etc
- mehrdadn 8y agoWell pip is only one command, so it can't simultaneously work for both Python 2 and Python 3. And if you happen to have another installation of Python or pip in your path (e.g. at the user-level) but not have the other one there, then they'd affect different installations entirely. When you run it via Python you know it's affecting exactly the same installation. Upgrading pip itself is kind of a special case I think. You don't want to upgrade stuff managed by a system package manager using pip; their work will conflict with each other. This includes pip itself. I think this is kind of a mess and I don't know of a great way to deal with it other than just remembering not to upgrading system packages using pip (yes this includes pip itself, and means you should avoid trying to upgrade via --user if it's installed on the system). On Windows where I am it's ironically less annoying since there's no system-level package manager to worry about... go figure.
- bakery2k 8y agoNo, IMO. Don't get me wrong, Python 3 is a better language than Python 2. I just don't think it's that much better that it was worth breaking backwards compatibility and stalling the language for several years. Python 3 did enough to break everyone's existing code, but nowhere near enough to make that worthwhile. It's common for other language communities to consider the Python 2/3 transition as an example of "what not to do".
- mixmastamyk 8y agoI skipped 3.0-3.3 and used the logging module in every nontrivial program, so py3 never broke anything of consequence to me.
- ravenstine 8y agoHow hard is it to simply keep one's code up to date? I'm pretty sure there weren't any radically different paradigms introduced in Python 3. Somehow the world of JavaScript has been able to quickly adapt to a rapidly changing language and the community is hardly fractured along the lines of language. Adopting new language features and browser APIs is just a matter of fact. What's different about Python?
- h1d 8y agoJavaScript has been stuck with an ancient version because of browser adoption like IE6. There's a good reason people wanted to migrate to newer JS and I never heard people say ES6 got something wrong over ES5.
- the_mitsuhiko 8y agoI think Python 3 primarily showed that breaking backwards incompatibility across an entire ecosystem is worse than one could have predicted. Even today Python 2 is far from dead. On the other hand the core development team "outsourced" many of the issues that people actually want to have solved to the community like packaging and distribution. Python's biggest downfall is a highly academic approach with slow release cycles which makes large feature development hard and detached from the real world. Python 3's unicode model is completely outdated but was supposed to be the big feature of the version. While that was happening however the rest of the world started moving over to UTF-8. There was no feedback loop that could have enabled Python to be UTF-8 based. It was released and then decisions were locked in. Similar things happened in asyncio. New versions of it only land with every major version of the language which meant that a lot of asyncio only became really useful with 3.6 and 3.7 which was years after it was initially created. I have very high hopes that the new leadership of the language will be able to tackle some of these problems. Python 3 is way less backwards incompatible to 2.7 now than it was 10 years ago. The two versions moved closer to each other and today it's pretty easy to support both from a single codebase. With faster iteration we might have been able to cut this time short by 5 years or more
- avian 8y ago> Python 3's unicode model is completely outdated but was supposed to be the big feature of the version. While that was happening however the rest of the world started moving over to UTF-8. I’m not sure what you mean. Are you suggesting that Python use UTF-8 encoded strings internally instead of decoded Unicode codepoints like it does currently? I’ve worked on Perl that uses that approach and it’s an absolute nightmare. All string operations suddenly must be aware of details of UTF encoding, which complicates even simple things immensely. You get hard-to-find bugs when some code somewhere introduces invalid UTF to a string. The only real benefit you get is slightly smaller memory footprint when dealing mostly with English text. I much prefer Python’s decode-process-encode approach.
- rurban 8y agoThe python nightmare is purely performance due to its use of the UCS-2 or 4 encoding (wchar_t without surrogate pairs). UTF-8 was ruled out for its inability for direct indexing, but this proved wrong. 4x longer string buffers trash the cache much more than the needed CPU cycles for utf-8 decoding. perl's problem is that they didn't make room for the original encoding, it's only latin-1 or utf-8 from everything else. so the context needs to store it, like IO, process. and for performance they silently loose the utf-8 flag for 128—255 codepoints. but all this is still better than the libc/POSIX design failure to use ENV vars, where the encoding is global, not localized. every single string API needs to do a getenv, and its interpretation is action at a distance.
- kmarc 8y agoJust one word: typing [1]. Makes life a lot easier. [1]: https://docs.python.org/3/library/typing.html https://docs.python.org/3/library/typing.html
- Rotareti 8y agoTwo words: typing, mypy [1] The editor support that I get from typing/mypy is fantastic! It feels like writing in a statically typed language. To me this is by far the most important feature of Python3. It's a godsend for larger/complicated code bases. [1]: https://github.com/python/mypy https://github.com/python/mypy
- kmarc 8y agoYes, you are right. I'm also using mypy along with pylint, yapf and isort. Helps keeping my python codes clean
- dis-sys 8y agoIt worth it, not for the language itself but for teaching everyone a good lesson - don't destroy the backwards compatibility when experimenting your incremental ideas.
- randomsearch 8y agoNope. But it survived, which is the important thing. I thought 3 would kill Python, but it has survived and that is a very good thing. Anecdotally, non-nerds fins python easier to read than other popular languages. It’s become the go-to language for a bunch of domains that reach outside core nerding (data analysis, education, DSL like stuff) and I predict Python will therefore be widely used in 2050, and probably be popular aged 100.
- bespoken 8y agoPython almost became my main language, but I moved to another language when I saw it was stuck at 2.7. Another reason was the lambda's only allowing 1 line instead of the flexible closures in so many other languages. And my expectations for future improvements were very low as the core maintainer looked quite stubborn to me.
- zmmmmm 8y agoPretty much how I ended up doing most of my coding in Groovy. I essentially wanted Python. But Python wasn't a good enough Python. (being honest, other things attracted me to Groovy as well - Java ecosystem etc, but it's interesting to me that in the larger picture, I'm sort of using Groovy as a proxy for a Python without Python's flaws).
- j1elo 8y agoI think the conversion would have been faster, especially for people who don't care, if the main distributions collaborated and stopped providing Python 2.x; 99% of software writers would just check out how to write their code in Python 3, or move their code to that version. The other 1% would be people who "knew what they're doing" and custom install whatever version they needed. Imagine if Ubuntu 14.04 (Trusty) didn't bring Python 2. All devs of relevant stuff would have received a shower of upgrade requests. Maybe 2014 was too early to force this, but I'm sure in 2018 it could have been done with Ubuntu 18.04. I know this looks like work for the sake of upgrading, without any real benefit for most projects. But I guess it's not wrong either; you just couldn't expect that Qt 3.3 (circa 2004) was distributed 10 years later in Ubuntu 14.04 (Qt is just a library, not a language, but it practically transforms the way you write C++ so it's a valid comparison IMO); however here we are in 2018, 10 years after the release of Python 3, and Python 2 is still the default interpreter in Ubuntu 18.04.
- dang 8y agoPlease don't rewrite titles, especially to make them more baity. This is in the site guidelines: "Please use the original title, unless it is misleading or linkbait; don't editorialize." Titles are by far the strongest influence on discussion, so this rule is much more important than it seems. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html (Submitted title was "Python 3 Is Now 10 Years Old Was It Worth It?".)
- starpilot 8y agoIn the submission form, have the title field auto populated from the URL.
- aviv 8y agoWould take about 5 minutes to integrate this... certainly less than it takes to deal with people coming up with their own titles, sometimes without a malicious intent, they just don't know the rules. https://embed.ly/extract https://embed.ly/extract
- dang 8y agoYou don't have to look at many URLs to see how hard that would be. Not to mention "unless it misleading or linkbait", which is not something code can take care of.
- B1FF_PSUVM 8y agoIf the "was it worth it?" bit is the focus of the piece, that's actually helpful and informative. Not all title additions are bad. Edit: not really the focus, it's more of an outline of an overview of what happened. But still.
- MR4D 8y agoPython 3 is the open source equivalent of Vista - too much potential, but too much time to realize it, and the world doesn’t slow down in the meantime. I love python. For me, it’s damn near perfect in many ways. But it’s looking more and more like Perl 6 than what it should have been. The sooner we get to Python 4 (whatever that ends up being), the better, as we need to move past the v2 or v3 question for developers and users.