3 ms·
Up until the Coronavirus hit, I was a volunteer teacher at a Girls Who Code club, where we used Python. I spent our very last class before the universe collapse
by Wowfunhappy 6y ago
Up until the Coronavirus hit, I was a volunteer teacher at a Girls Who Code club, where we used Python. I spent our very last class before the universe collapsed introducing students to the concept of functions.
Once we'd finished going over some example programs, I asked the kids to modify a quiz program they'd written previously with a different teacher. That program used copy-pasted lines of code in order to ask multiple questions, and I wanted the students to re-implement it with a single function instead. This was a pretty challenging assignment—the kids had never encountered functions before today, and I was purposefully not quite telling them what to do, only giving examples of functions used in other contexts. But one of the girls managed to get it, and I was really proud of her.
Except her code wouldn't run because—I realized with horror—the original program she'd done with the other teacher was actually python 2 code.
I am so damn frustrated that this happened! I was trying so hard to make these kids understand the concept of functions; I did not want to explain the differences between Python 2 and 3. It is, of course, primarily my fault—I should have coordinated better with the other teacher—although in my defense, we were both volunteers, and as it is I spent most of my Friday and Saturday planning this lesson.
It also should just never have happened! I'm not aware of any other language where this type of confusion is so common, and it really makes me wonder if we'd be better off teaching something else. I'm not sure who is to blame for the situation, but it really sucks, and I don't think it's going to go away just because Python 2 is now technically EOL.
- Xylakant 6y agoRuby went through a similar period when transitioning from 1.8 to 1.9. Strings learned about encoding, breaking most libs handling strings, some syntax was added, some removed. It was possible to write 1.8 and 1.9 compatible code, but it took some effort. However, the big players in the community, rails etc. tackled that change head on. It was a point of pride for libraries to be 1.9 compatible. And everyone moved on. I’m always puzzled by how hard the python community ist stuck on 2.x
- pansa2 6y agoPython didn’t have a single big player like Rails to “lead the charge”. Instead, its ecosystem is made up of many smaller libraries. Because it’s not possible to run Python 2 and Python 3 code together, none of those libraries could upgrade until its dependencies had done so. This just led to everyone waiting for everyone else.
- xapata 6y agoPoint 2 is False. It's easily possible to write code compatible with both 2 and 3. It's becoming less pleasant as one can't take advantage of the great new features from v3.6+, but I've done that for about a decade now. I agree somewhat with Point 1, but the Python ecosystem is larger than Ruby's. Each domain could have moved separately, and did, to some extent.
- pansa2 6y agoSorry, I meant that Python 3 code can’t use dependencies that are written in Python 2. Therefore a library couldn’t upgrade to Python 3 until all its dependencies had upgraded.
- deleted 6y ago[deleted]
- t-writescode 6y agoAt least Python did it on a major version release, when breaks are supposed to happen, not a minor version release.
- p_l 6y agoThe scuipie od changes was also intentionally smaller. I've seen programs where all it took to fix changes was maybe 15 minutes if you actually replaced the code, instead of injecting few methods to String class.
- mixmastamyk 6y agoConverting Py2 to 3 for trivial scripts is trivial. Usually consists of adding parens to prints. 2to3 may even do it automatically.
- deleted 6y ago[deleted]
- whalesalad 6y agoI would posit this is an equally valuable teaching moment for different reasons. I completely empathize with you, but this shit happens all the time in our industry. A brief sidebar to tackle breaking API changes (even if it’s, hey this is a shit show we will circle back to later) would be a helpful seed to plant in the mind of a young engineer.
- xapata 6y agoAnyone teaching Python 2 now is years out of date. It's not your fault that the other teacher isn't staying current. As a teacher, I made the switch around 2016 and I was slow to change. While the Python core team made mistakes in community management, I wouldn't blame them in this case. Back in high school, I volunteered to tutor math at a free summer camp for poor children. A professional high school teacher was also volunteering. I wound up tutoring her in math, so that she could teach the kids. Sometimes teachers need a little update.
- Wowfunhappy 6y agoI talked to her about it later. Without getting too far in the weeds, part of the issue is this browser environment we sometimes use, called Trinket.io. It seems to be very common in the educational space. The paid version of Trinket let's you use Python 3, but the free version forces you into this hybrid interpreter which attempts to run both kinds of code, and it does a bad job.
- xapata 6y agoI've been happy with repl.it as a browser environment.
- heavyset_go 6y agoThe only reason that I can come up with for teaching Python 2 in 2020 is that the instructor only became familiar with Python because they were expected to teach it. This is like complaining that calculus is too fractured because someone taught your students to use Newton's notation instead of Leibniz's.