3 ms·
I don't get the Python3 bw-incompatibility hate. Getting rid of cruft is literally the only way to get rid of cruft. It's literally the Pythonic to not have cru
by Avamander 6y ago
I don't get the Python3 bw-incompatibility hate. Getting rid of cruft is literally the only way to get rid of cruft. It's literally the Pythonic to not have cruft.
I dread the day Python will be as bloated as C++ or Java, neither that dare to remove things.
- rahimiali 6y agoWhat cruft did py3 remove from py2?
- Avamander 6y agoUnintuitive string types, weird print function, unintuitive division, to name a few. I'm sure there are more things I can't recall at the moment.
- jldugger 6y ago> unintuitive division Arguably worth it. Dividing 1 by 2 with "1 / 2" and getting 0 is a real 'wat' for novice programmers. And the workaround is a 'wat' for experts: instead of using a floating point division operator, cast one of your parameters to float.
- kjeetgill 6y agoHey! Leave Java out of this, Java didn't do anything to you! Joking mostly aside, python is way way closer to C++ in terms of language feature bloat; where Java is notoriously spartan and slow moving (moreso historically). Ofcourse I know you're also reffering to standard lib gunk but that's relatively less impactful. The big issue with the python 3 shift was when you touch something as substantial, subtle, and pervasive as strings you're going to cause problems. I wont speak to if it was worth it.
- overgard 6y agoProbably less to do with backwards compat then how it was handled. The first few versions of python 3 didn't really provide any compelling benefit, (indeed things like performance were worse, not better), and most people didn't _care_ about the cruft it removed. The "print" statement being a great example. Was it kind of weird? Sure. Did that weirdness have any consequences at all? Not really. Was it worth it to force people to replace thousands of lines of code for something that was essentially a minor aesthetic issue, if that? No way. Also the python 2 string type was more in line with how other unix utilities work, so while I do think the 3 string type is generally better for the web, it wasn't an obvious improvement for the other large usage of python. While it's a very versatile language, I would say the major niches of python are: web dev, shell scripting, and scientific computing. The changes in python 3 were (somewhat) helpful for web dev, but really were inconsequential and/or actively harmful for the other uses. Mixed with how condescending the python dev team acted about it, and how it really wasn't until about python 3.6 that there was any compelling reason to move to python 3,you can see where most of the hate comes from. And by the way, even if Python is very popular today, I do think that rift really hurt the language. I worked at least at one company where Python was considered for a project, but eventually shelved because of management's confusion over the 2/3 issue.
- _dps 6y agoAgree with everything you said here, but let me riff on this > The "print" statement being a great example. Was it kind of weird? Sure. I am reminded of the Emerson quip "A foolish consistency is the hobgoblin of little minds". The Py2 print statement is special/weird because it is a very important and special behavior, especially for newcomers. It's not randomly special, it's special because it models something that deserves special treatment. Py3 is more consistent, but less humane. I use it over Py2 only because the market has moved on, but every time I type print with parentheses I curse Guido.
- MisterPea 6y ago> It's not randomly special, it's special because it models something that deserves special treatment. Can you expand on this, why is this more humane? And why should print be a special function?
- _dps 6y agoTwo simple reasons. First, "hello world" requires less explanation print "hello world" vs print ("hello world") Second, printing a line to stdout is an extremely common and special activity (especially during debugging). There is almost no programmer-defined function you could write that has a function as fundamental as that of "print". Larry Wall of Perl thought about these things in terms of Huffman Coding, i.e. the most common thing you might want to write should have the syntax elide any easily understood context. In the case of "print", we know we're not talking about any random function here: it's the function for getting output to the terminal, one of the most fundamental operations in all of programming. So I think it's totally fine for it to have a special representation in the language.
- MisterPea 6y agoInteresting, thanks. One nit I would call-out is that most people don't put a space between the print and the ("hello world"), so idiomatically when learning, print is 'just another function'. And since HelloWorld is usually the first thing people learn, I wouldn't want them to think print is different than any other function. Also, the first line of The Zen of Python is "Beautiful is better than ugly", I can understand why consistency was a priority here. We could get into a whole other discussion about whether or not a programming language should have and adhere to a "culture", but fundamentally I agree with the arguments against Python making this change. It's just not worth the effort, and like others have said, they might've lost of a lot of momentum to JS.
- sukilot 6y agoThat's great for new programmers. It's terrible for people in a mature ecosystem of lame duck software. Some production critical python code is 20 years old.
- slightwinder 6y agoMost hate originates because they question whether it actually was cruft and wheter the new solutions are really better. And even more hate critics the way transition was handled. And indeed, that some removed features were added later again speaks for a certain lack of insight when decicions were made. That the transition took nearly a decade (and for some still goes at this point) and several minor-versions is another hint at strong problems in planing. At the end we got something better, but the road toward it was just far to painful for what we got. And this fuels hate till today.
- dekhn 6y agoPython3's intentions were good, but the execution was abysmal. It was just a bunch of extra work on top of what should have been a pretty straightforward migration.