by illumen · 12y ago · 0 comments
I'd much rather bet on the python developers who are shipping software. All major python libraries have been ported to python 3, many of them for years. There's 4799 packages registered on pypi as supporting python 3.
Python is becoming less popular? The author provided no evidence at all. Downloads of python3 from python.org are higher than python 2, and have been for a while now. Job websites show python having more postings than 2 years ago.
Not much has changed in python 3? What rubbish. You just have to look at the thousands of commits, and change lists. Python 3.4 has generic functions to do single dispatch matching on type. You can statically type check python now (see pysonar2, pylint, and pycharm for example). Not only as pypy made a major breakthrough with performant STM based concurrency(no threads), but threading has been improved in python 3 too. There is the new asyncio library for really elegant async, which go along with great generator improvements(yield from). We have CFFI for simpler FFI. Lambdas are kept simple for readability, as functions are preferred.
I'm just going to stop here... many of his statements are just insane. Like this one: "You might as well ask someone to port their entire codebase to Ruby". Um, yeah... porting a codebase to python 3 from python 2 would take more time than porting it to an entire other language. What complete nonsense!
Edit: the post isn't from Microsoft, so fixing it so it isn't misleading. There was a link to a Microsoft person on the top right of the page, which seemed to indicate he was the author. Instead it was just someone promoting the page. Oops/sorry!
The "lazy people" you refer to is 98% of the Python community.
Python 3 didn't "gain" static type checking. You can (and I do) run pylint against Python 2 code which is just static analysis, not full type checking. The situation here has not changed between Python 2 and 3.
Python is glue code. You write a small piece of Python to tie together external libraries. Moving a smallish piece of Python code from Python 2 to Python 3 often means porting several 3rd party libraries. If you were to move to Ruby, all you'd need to rewrite is your own code, as there are likely already 3rd party libraries which need no porting.
Um, no. Major applications are written in Python. It looks to me like the problem is not Python but your perception of it.
Which is not a good metric. Have there been any actual surveys or studies of Python programmers to see what the distribution is?
> having written a major application in python, I'm not really convinced it's a good language for it.
Out of curiosity, what was the major application?
I wonder what would have happened if the software that was called 3.0 had been released as "Python 3 Preview Release" or something. I guess the thinking was that would have held people back even more from trying it/porting stuff, but maybe scaling back (end user) expectations for those first couple of versions would have been the better path.
Well, for one thing, Python 2.7 is a newer release than Python 3.0 (2.7 was released after 3.1.)
However, while there may have been good reasons to choose 2.7 over 3.0 (or even 3.1), there aren't nearly as many reasons to choose 2.7 over 3.4.
I think the main role of authors of books on programming is to help their readers to become more effective in solving their programming tasks. So they do, if they're wise and honest.
Maybe you need to read more up to date books. The latest release is Python 3.4, and even most Linux distros are at least at Python 3.2.
The other 11 in order of popularity are #1 Mint, #2 Ubuntu, #3 Debian, #4 Mageia, #5 Fedora, #6 openSUSE, #7 elementary OS, #9 Zorin OS, #10 Puppy Linux, #11 PCLinuxOS, and #12 CentOS.
Most Linux distros use Python 2.
Why are you spreading lies? You are hurting your cause (advocating Python 3).
Let's take a look at latest Ubuntu:
$ cat /etc/issue
Ubuntu 14.04 LTS \n \l
$ python --version
Python 2.7.6
How about the popular server distro CentOS 6? $ cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m
$ python --version
Python 2.6.6
What exactly are these "most" Linux distros everyone is using that I haven't heard of?English is a much better universal language than esperanto ever will be for this very reason.
You are right that the same tools work for python 2. However, I mentioned tools there which allow python to do type checking, and type inference because they can be done now. See here on how to use them: http://renesd.blogspot.de/2014/05/statically-checking-python...
You're right in that case where you use several libraries that aren't ported. However, there's 4799 packages registered on pypi as supporting python 3, and most of the popular ones are ported. Considering that most libraries are ported, porting small scripts should be easy most of the time. I don't know if you actually ported any code, but it's often trivial.
Glue code is only one of the things that Python can be and is used for. Python is used for small, medium and large [2] applications as well.
Do all of the following look like glue code?
Recent marketing brochure from the PSF (Python Software Foundation) - (it's a PDF):
http://brochure.getpython.info/media/releases/psf-python-bro...
Python success stories:
https://www.python.org/about/success/
Google's web front-end (many of their URLs even end in .py)), Dropbox clients (wxPython), YouTube [3], Disqus are some apps / sites written in Python.
[1] See the paragraphs about YouTube near the end of this post (by me, but much before this current thread):
http://jugad2.blogspot.in/2013/03/youtube-dl-yourube-downloa...
[2], [3] The PyCon talk below is by one of the original engineers at YouTube.
https://us.pycon.org/2012/schedule/presentation/128/
The Wikipedia article below says YouTube is one of the largest web sites in the world. A lot of YouTube is written in Python.
As I noted elsewhere in this thread, the list gets shorter every day:
I actually made the decision to run on Python 2 due to unavailability of these libraries for Python 3 about a year ago (I didn't really care about Python before as I primarily used C++/Java/Asm/GLSL/C#/Haskell in the past) - I was deeply shocked by what Py3 did to its own community and still have that weird feeling that Python is slowly killing itself. I didn't want to write my own Amazon and MS Office wrappers in Python 3 anyway and from all platforms available Py2 seemed to have the least amount of troubles (though I had to write some Py3 code for handling advanced TLS properly).
I think the flack Java gets is for not modernizing fast enough, but I think in a way that makes you stop and smell the roses (the roses being many years' worth of badass JVM features and massive flexibility/reliability in software development).
But Ruby & Python (I am an ex-Ruby guy) take this cutting edge thing wayyy too far & end up with a community of people who can't trust them anymore cuz they all had their damn feet shot off. Sometimes I see the rates for Ruby guys & wonder if they're high cuz its so productive or just cuz its very niche & the stack is shite. On principal, it's hard for me to imagine going back down that road after experiencing the JVM (plus, I'd like to get away from web one day...).
EDIT: Funny thing I just realized actually -- all the Ruby rates I've seen tend to be exactly on par with a lot of FUBAR niche near-extinct Java technologies. The only people I've seen do better than both these camps are down & dirty Linux/Oracle/Java guys. Maybe my view is skewed but I always feel like the rock-solid langs will live on & eventually "modernize" (though lets be real, modernize is kindof a BS term for slim API & lots of MVC tutorials). These other techs are at the mercy of market trends.
I mean, yeah, the list is getting smaller. That's understood. But that doesn't render the problem of depending on only-Python 2 libraries moot.
I think the fundamental insight of the OP is that Python X (the purgatory corresponding to code compatible with both Python 2 and 3) is an absolute pain to write. There's plenty you can do to make Python X easier (like the `six` library or ignoring Python 3.{0,1,2}), but the programmer is still left with the burden of writing code compatible with both versions.
There's just no denying that the Python 3 transition is a huge fucking pain that is costing people tons of time and money. With that in mind, it is absolutely reasonable that people are resisting the change.
gevent is ported, but not in an official release.
There is a mysql alternative module.
mechanize is ported, but not in official branch
nltk alpha3 for python 3 is available
There are python3 thrift ports, but the maintainers are slow.
And it's getting better everyday.
These are really HUGE and I can not do my work without them.
It is not dying. It just gets better.
If the libraries are used by people, they tend to get ported. Like most of the most popular packages, and 4799 packages listed on pypi.
Any others you depend on? I'm prepared to roll up my sleeves and help.
Perhaps the way the entire question should be thought of is: are there actually many properly useful Python 3 libraries that are not available in Python 2?? I bet the above equation would look much better when inverted.
http://highscalability.com/blog/2014/4/28/how-disqus-went-re...
Sorry, I'll have to disagree with your disagreement. Thousands of commits doesn't mean it is worth breaking backwards compatibility. Unicode support? Yeah it is nice. But it worked fine for me before. Print is a function. Again, pretty nice, not nice enough to break backwards compatibility.
> Python 3.4 has generic functions to do single dispatch matching on type.
Ok. Never really needed that in Python. So again not worth breaking backwards compatibility.
> There is the new asyncio library for really elegant async,
That is a bad idea. Promises and futures are not a very good concurrency construct. Light threads, processes and message passing are better. Twisted has been around for ages, and even though it is used here and there it hasn't exactly taken the world by storm yet. So I certainly don't see it as a positive, rather it is a negative. I would rather they adopted greenlet and supported gevent better or integrated PyPy's STM
> We have CFFI for simpler FFI.
Ok, I just used CFFI in Python 2 last week, worked great.
> Lambdas are kept simple for readability, as functions are preferred.
Heavy lambda usage is not that good of a practice in Python. And Python 2 has lambdas as well. It use them sparingly.
> I'm just going to stop here..
Oh no, please don't stop, because you haven't convinced many people Python 3 is better.
> You can statically type check python now (see pysonar2, pylint, and pycharm for example)
You know what has better static type checking? Go. I am sitting down looking at static type checking and fixing code for backward compatibility, I will also be evaluating other languages and platforms.
Python 3 is not bad. But is is not that much better than Python 2. Sorry. A lot of that is not Python 3's fault as much as a testament to how good Python 2 already was.
I think Python 3 should have offered a lot more than unicode and print as a function. A list of possible improvements:
* A JIT compiler
* An STM module
* Better concurrency (removed GIL)
* Maybe integrated requests or flask or some other modern web tools and libraries>> That is a bad idea. Promises and futures are not a very good concurrency construct. Light threads, processes and message passing are better.
Not so much in Python I'm afraid. The new asyncio module is worth the switch by itself I find, while Twisted is pretty good it can be very verbose and suffers from a number of issues.
You say that it's not worth breaking backwards compatibility for genuine warts in the language and seem to think it's only worth progressing the language if its by implementing huge changes like adding a JIT or removing the GIL (why you would think of bundling requests or flask with Python is beyond me). Python 3 may not have those big blockbuster features but its a nicer language with fewer warts (from __future__ import division? please).
I gave Python 3.4 a try while porting a Twisted application to asyncio and I was very surprised. After using it in a couple of Django projects I have yet to come across any packaging issues, and I use the awesome 'six' library so my code runs on 2 and 3 without modification.
So what if it is. Why not just make prnt a function. Or println or something.
Have urllib and urllib2. Make urllib2 or just put requests in the stdlib.
Still don't see what was worth breaking backward compatibility over.
> You say that it's not worth breaking backwards compatibility for genuine warts in the language and seem
I say it is not worth doing it at the time they did. It just came too late. People how didn't pick python over other frameworks probably weren't put off by the print statement.
This should have happened 5-10 years ago not now. Not it was time for better performance, packaging, web frameworks, better concurrency constructs.
> ts by implementing huge changes like adding a JIT or removing the GIL (why you would think of bundling requests or flask with Python is beyond me).
Removing the GIL shouldn't break sane code. With GIL you still have race conditions and have to guard against them. You just can't run CPU bound code in parallel. That would be nice to fix.
And if it is beyond you read up on how JPython works because it doesn't have a GIL.
> why you would think of bundling requests or flask with Python is beyond me)
How does bundling a library like that break code?
> I gave Python 3.4 a try while porting a Twisted application to asyncio and I was very surprised.
I switched to using gevent from Twisted and saw speed improvement and code reduction by about 30-50%.
Make another function to print output while also having a print statement? "There should be one-- and preferably only one --obvious way to do it". Same with urllib. Lets just be clear, they didn't release Python 3 because urllib and urllib2 were not combined, so no by itself it's not worth breaking backwards compatibility for (and hence why there were 2 urllib modules). But combined with a bunch of other issues, some of which necessitate breaking backwards compatibility, why not combine them?
> I say it is not worth doing it at the time they did. It just came too late. People how didn't pick python over other frameworks probably weren't put off by the print statement.
Fair enough, but better late than never right? You can't maintain backwards compatibility forever especially with syntax changes. That's why it was put into a major release and the 2.x branch continued to develop. Porting the code isn't hard (there are even automated tools to do it, like gos gofmt command), and I think every major web framework supports py3 now.
> How does bundling a library like that break code?
The best things about python packages is they can be updated independently of the standard library that ships with Python. Why would you want to add flask or requests to the standard library? Is executing one shell command too hard? Including popular packages just because they are popular at the time is not a good thing to do.
> And if it is beyond you read up on how JPython works because it doesn't have a GIL.
You mean Jython? That's a silly comparison. CPython is the reference implementation for Python. A JIT compiler could be added to it, sure, but actually think about it for a second: writing a JIT compiler for Python is a huge undertaking. PyPy has one, but it's not 100% compatible (no eval and others for example, which is sometimes used) and for some workloads slows down execution. Not to mention PyPy is a very advanced project and it has taken years and years of development by people specialized in writing JIT compilers (remember Psyco for Python 2.5?) to get PyPy to where it is now, expecting the Python developers to whip up a usable JIT compiler in a jiffy is not exactly realistic. Adding one would add huge complexity to the reference implementation of Python, the same goes for the GIL. Read here[1] for reasons why the GIL will never be removed and use the awesomely simple multiprocessing library to spread work over multiple cores, that's why it was made.
Using argument annotations for type checking is quite useful in IDEs and for statically checking your code.
Asyncio, and yield from have been in the design phase for many years by Guido and the community. This is seriously well thought out concurrency done by people with lots of experience. It's the 4th generation async framework for python.
The better unittest framework saves me time, and helps me with error handling.
pip installed everywhere is a serious productivity improvement.
Function dispatch based on type (ie, pattern matching like some functional languages) is something I've missed for years. It was originally planned for py3k, and I think is the main missing piece from the original design docs.
Importlib is much improved, so you can do some really interesting things with importing code. If you're working on IDEs, or other apps like games this is pretty cool stuff.
Little things like the enum module make APIs that tiny bit cleaner and more intuitive to use.
Speaking of nicer APIs, the Documentation got a lot of fixups too in Python 3.4.
Want to track down memory leaks? Python 3.4 has a whole new set of memory debugging primitives to make this much easier.
There were also a lot of security improvements for 3.4 that have not been backported.
That is a problem.
Just last year, msft gave $100k to the ipython project -
http://ipython.org/microsoft-donation-2013.html
It feels like the original commentor has a beef against msft to read company action into what is an individuals blog entry...
That is a ridiculous statement. So everything like most of the *nix OS and a dozen other super popular products that require python 2.6 or 2.7 are lazy too?
These lazy people probably have a day job where they have to do something productive instead of wanking around with "fun" language features.
PHP 82.0% ASP.NET 17.5% Java 2.7% ColdFusion0.8% Perl 0.6% Ruby 0.5% Python 0.2% JavaScript 0.1%
http://w3techs.com/technologies/overview/programming_languag...
And Coldfusion over Python and Ruby? i dont think so.
Nowadays hardly anybody seems to use Ruby for new projects...
Do you have evidence to back up the claim that Ruby isn't being used for new projects? Even assuming HN is a skewed environment, I see enough Ruby projects popping up here to make that seem unlikely.
http://www.tiobe.com/content/paperinfo/tpci/images/history_R...
1.9 was initially released 2007, 1.9.1 was released in 2009... Not sure if you remember it, but one of the early 1.9 releases was reeeeally buggy.
1.9 was the cleanup release after the language became popular and very necessary.
Also, everything before 1.9.2 was considered a preview release.
That's quite some historical revisionism -- there was quite a while when quite a lot of libraries weren't running on 1.9. It wasn't as bad as with Python, probably because Ruby wasn't popular for as long as Python was, so there weren't as many big libraries that were hard to update. But it was a huge deal.
> 1.9 was the cleanup release after the language became popular and very necessary.
It was necessary for much the same kind of reasons (and, sometimes, the exact same specific reasons) as Python 3 -- particularly, the string encoding problem.
I concur. The _expectancy_ that libraries should be updated was there pretty quickly. New libraries were generally created with both versions in mind. It was a huge porting effort, especially with 1.9.0 being very buggy, but there was a general sense in the community that you need to port or die.
Yeah, but 2.x didn't have major breaking changes. The big breaking change from 1.8.x that parallels the Python 2->3 change was 1.9, which has been out for two years longer than Python 3.