1 Because I like Python and have spent some time with it, I recognize some of its downsides. These criticisms are meant to be constructive.
3 ## Python 3 introduces breaking changes into the language
5 It's common for code written for Python 2 to not work on Python 3. This is an unfortunate situation and means lots of code has been or needs to be ported. Once the dust settles and no one uses Python 2 anymore, this will be a non-issue. Until then https://pythonclock.org and http://python3statement.org are good sites to keep an eye on to see the latest news on the transistion.
7 Over at https://matthiasbussonnier.com/posts/planning-an-early-death-for-python-2.html which was discussed at https://pythonbytes.fm/episodes/show/5/legacy-python-vs-python-and-why-words-matter-and-request-s-5-whys-retrospective it is argued that Python 2 should be referred to as "Legacy Python" to emphasize that it is going end of life soon.
9 In https://github.com/python/devguide/pull/344 the date after which Python 2.x will no longer receive security updates has been finalized as January 1st, 2020.
11 I remember when Steve Jobs gave a [eulogy] over Mac OS 9 in a casket and I feel like the Python community would benefit from watching it. The similarities are striking.
13 [eulogy]: https://www.youtube.com/watch?v=G1SLCAiGkVQ
15 ## Python's signficant white space prevents quick experimentation with code you paste in
17 For me, one of the major downsides of Python is that it doesn't allow me to paste code into existing code and worry about reformating it (programmatically) later. Rather, Python insists that I adjust the indentation first or else the meaning of the code is changed. In my mind, this prevents me from trying quick experiements with code I've just pasted in.
19 TODO: Rewrite this example using [go fmt][] and mention the section about "mechanical source transformation" at https://blog.golang.org/go-fmt-your-code especially "Mechanical transformation is invaluable when working with large code bases, as it is both more comprehensive and less error prone than making wide-sweeping changes by hand."
21 [go fmt]: https://golang.org/cmd/gofmt/
23 Let me try to illustrate with an example, contrasting Python with a language that doesn't have signficant whitespace (Perl):
25 Let's say I have the following Perl code (with `use v5.10` for `say`):
31 # FIXME: add inner for loop?
34 It prints the following:
40 Now, let's say I want to nest another for loop inside the existing loop to produce the following output:
55 Here's where you have to bear with me... let's pretend that the code to produce "goodbye world" is long enough that you grab it from some other project you've already worked on. The indenting is off but you paste it in as a quick test and it works fine. Your code is a little ugly at the moment, but it works:
66 Since the test works, you run the code through `perltidy` to clean it up. Now it looks like this:
77 Now, let's talk about Python. You paste the "goodbye world" code in...
85 ... but it doesn't give the desired output above. Rather, it prints this:
94 You have to go fix the indenting before you get the meaning you want. Here's the version that produces the desired output:
100 print 'goodbye world'