Today's @dabeaz example in PL shows why it's essential to understand aliasing (which a lot of people don't!). Apparently Python programmers get pretty confused by the fact that `del b` didn't "do anything", which further confirms this. #PyThOnIsEaSy
@shriramk Strong agree re aliasing. “Shared mutable state” ought to be a concept students learn to spot early in the curriculum.
It’s true that Python's wording choice here (`del`) makes this •extra• confusing, and that’s unique to Python. (The Swift folks have been working through a closely related problem with the new explicit pointer ownership & lifetime features, and reached a somewhat better place imo: https://github.com/apple/swift-evolution/blob/main/proposals/0366-move-function.md#)
I put aliasing and shared mutable state in the same breath in our 2nd semester course, early and throughout, but I’m not sure how well it truly sticks. I’ve •definitely• seen confusion around this decrease as we got more mindful about teaching it, but the battle continues!
@inthehands@dabeaz Nice, thanks! I've been wanting to spend more time studying Swift's notion of ownership, and this clearly plays in with that.
Think about all the intro programming texts you've read that begin with mutation. Now think how many of them explained aliasing in the context of shared mutable state. (Pretty close to zero, I'm guessing, unless you've written a book…)
We have a whole tutor to help with this! Want to take a peek?
@inthehands Here, take a look at the tutorials linked from here: https://cs.brown.edu/courses/csci1730/2023/smol.html They're explicitly offered in multiple syntaxes, to show that the underlying ideas are essentially the same. Each tutorial is quite short (5-10 mins max), so you can get a sense of how they play out…
We've already got several universities using it (and finding problems in their student understanding!). The whole tutor is built entirely around known misconceptions and fixing them. @dabeaz