Nice to see turtle graphics mentioned in this context. Back when I learned to code, it was one of the more common teaching techniques, and I still believe that it's one of the most "hands on" ways to explain loops, recursion etc.
As far as development environments - have you tried Thonny (https://thonny.org/)? It has some nice features in it that are specifically geared towards explaining how things work. For example, when you debug, you can step through subexpressions, and their values are automatically substituted in the editor as they are computed.
I might be odd here, but my intro to Python was with turtle graphics and I despised it. My spatial sense is rather poor, and having to translate between code and Cartesian coordinates and vice versa was a heavy mental overhead.
for x in range(0, 10):
print(x)
Is way clearer to me than having to draw circles or lines and then manually calculating the Cartesian coordinates I should have hit to make sure it's actually doing what I want.
Likewise with pretty much all of the constructs. It's easy to understand a function that sums a list of ints, and it's easy to check. It's much harder for me to grok and check a function that draws circles at a list of Cartesian coordinates. A recursive Fibonacci sequence is easy for me to grok; just have it print out the values it's using at each loop. A recursive function to draw fractals is going to take me forever to figure out what recursion is actually doing. I can see that it changes, but figuring out how/why or why I would ever want to use it is really difficult.
I think it's just too much of an abstraction for me. Code -> numbers -> coordinates -> image is too many indirections for me to follow. When I wanted something "hands on", I usually defaulted to consuming APIs. It's really not much harder to install a Reddit API client and use it. It gives me something I can check, it's something I would actually want to do, and it's practically infinitely extensible.
I'm not quite sure I follow; isn't the whole point of turtle graphics to not have to think about Cartesian coordinates, but rather in terms of "move that far" and "turn that much" (at least initially)?
Or do you mean the other way around, as in, you start with an image of the end result in your head that's defined in terms of coordinates, and then you had to write the move/turn code that achieves that? I can see how that would be quite frustrating; but if you are already thinking in coordinates throughout, then you don't need the "turtle" part anymore - but you can still do graphics.
I've never taught turtle graphics in python, but in Logo, Cartesian coordinates are seldom used. It's mostly relative movement, which is far more intuitive
For the first approximation, you can simply explain it as part of the for-statement syntax. When you get to lists and iterating over them, this simple approach breaks, but by then you can redefine it as a kind of list.
Once you have explained iterators - and I don't mean the nitty gritty of __iter__(), next() etc, but rather the high-level notion of a function that yields multiple values to the caller, the true meaning of range() is easily explained in those terms.
Back in the 80s I took a summer school class offered by the district in 'computer programming' which was about half logo half applesoft basic. The school even had a little 'turtlebot' driving pen plotter bot, tethered to one of the //e's by what I assume was a serial cable.
If your logo program was particularly cool the teacher would print your program out on the little dot matrix printer and project it up on a screen using an opaque projector and step through it line by line while the little robot drew it out on a piece of butcher paper.
Probably one of the early experiences that made me love pen plotters.
FWIW if you are operating on an extremely small budget and want to do something like this, you can definitely hit up your local thrift shops (or craigslist) for very cheap used monitors. I know that doesn't get you the Pi systems, but new monitors can be quite pricy.
FWIW you can probably find a hell of a lot ex office PCs for free
I do admire the raspberry pi project for their work, but for just programming simple python projects, any 15 year old core 2 duo will work and people can't get rid of them fast enough
Yeah but then you're in the "manage a bunch of really old hardware" business.
RasPi have that consistency factor and the "game boy" factor of kinda being able to throw one against a wall and for it to work.
It's not the best programming experience but at least it'll be consistent. (Part of this is a Python problem tho tbh. Every Django Girls thing is half "go through the code" and half "try to figure out what weird situation your computer is in", even for Macs)
The fact that real programming is a mess isn't like... important! It's entirely incidental and almost entirely due to this kind of attitude of "well I got it working on my machine" that slows down making real progress
Not to mention that all this futzing around is usually indicative of leaky abstractions up the wazoo.
There are hard things in programming, sometimes. It's hard to write iterative quick sort without introducing off-by-one bugs. But most shit is easy, and a lot of hardness is around just busted tooling.
The ones who get bit by the programming bug have their whole lives to be annoyed by the hassles of computer ownership, upgrades, etc.
But most won’t keep programming, so I think it’s smart to at least keep this class focused on its purpose, which isn’t to see who can get most frustrated by their decade old Dell tower.
Let’s say there are a dozen kids in the class. The library provided the monitors. How does the volunteer teacher get a dozen towers to and from the library? What do they do with a dozen towers in between classes? Would this be easier or harder with a dozen Pi 400s?
This is the real strength of the Pi 400 for this application: sure you could do it all cheaper with used office hardware, but it turns this "just works" intro class into a full advanced IT course (or a full-time IT job for the volunteer teacher).
If you want the RPi look and feel &/| if you happen to have said PCs lying around &/| buying brand-new Pi's is not an option, you can get Raspberry Pi OS for x86.
Yeah it is kind of annoying that the language that's going to be best for instructing kids/beginners has such a terrible ecosystem that will put kids in such frustrating PITA positions getting the environment right.
Don't forget the fact that standard PCs are very well-documented too. Instead of teaching on proprietary barely-documented systems, choose one that has decades of documentation and a huge software/hardware ecosystem.
Off lease refurbishers generally have old 1440x900 monitors in bulk, although in COVID world they're pretty picked over as everybody working remote has grabbed one or two.
Great post. And kudos to the groundbreaking work by Eben Upton and others in Cambridge, for giving the Raspberry PI to us so this kind of effort can now happen anywhere in the world at minimum cost.
PyTurtle is a great library for educational use - I used it to teach 11-year-olds in Scotland how to draw a house. The approach take was: instruct pupils to draw a house on paper, using only straight lines; teach them briefly what a coordinate system is (assigning numeric addresses - pairs of numbers - to points), which they haven't had in their maths curriculum at that stage, but which they easily picked up; translate the paper-based house into a sequence of PyTurtle Python commands.
But turtles do not use coordinates, if anything they use (relative) polar coordinates ... Oh, maybe you first coordinatize the house drawing and then make turtle commands from that? It seems that turtle programs don't need any mathematical priming....
Polar coordinates are coordinates too, and besides they can use cartesian coordinates as well as long as you use 'up', 'down', 'right' and 'left' commands, after all the fact that they are relative doesn't really matter all that much.
Really great efforts and I appreciate the write up!
If anyone here wants to think more about how to teach computers to children, I highly recommend this video with Seymour Papert, creator of the LOGO programming language and origin of the turtle concept.
Wow I’ve so far just watched the beginning with Papert but that is really good. Really got me thinking about how to teach robotics in “robotics land”. I’ve sort of done that once before but it would be great to do more.
I'd love a list of the materials the author is using for their standard work stations. I'm particularly curious about the "inline power adapters". I see in one of the pictures each one has a little black brick. Looks like maybe a USB hub or something? The Raspberry Pi 400 already has 3 USB ports.
I'm speaking as a daily Raspberry Pi 400 user. I've tried one of those USB hub things with power pass-through that I use for my Mac Book Pro, but it didn't work with my RPi400.
Always up for hardware tips for improving my Pi situation.
I bought a little raspberry pi kit off amazon the other day to run retropi on. It came with a usb-c wall wart and a little usbc-usbc adapter with a power button on it. It looks like the one i'm seeing in the plastic bag in the picture.
The nice thing about programming on a RaspberryPI is that the only websites that are light enough to use are Google, Stackoverflow, Github, ReadTheDocs, etc. If you try to check Reddit/Twitter/Facebook you get frustrated with how slow they are and go back to the text editor.
I get your point but I recently bought a RPI with 8GB RAM. Although it is in no way comparable to a modern Celeron or Pentium, SBC's are already to the point where they can sufficiently be used for web browsing.
Suggestion: Talk to the people face-to-face, and have a demo ready. If you tell them you want to do something for kids, in the demo there are free cookies, and besides offering the space they don't have to do anything, then the chance is almost 100% that they jump in.
PS: Some more traditional organizations don't even read their emails at all. So don't take it personally.
Does anyone have a good recommendation for ‘relearning’ basic programming practices when you don’t have much free time? I code every now and then but my workflow for coding/debugging is terrible now that I’ve essentially forgotten basic concepts like stacks, breakpoints, unit tests, etc. embarrassed to say I use print commands far too often.
There is no need to be embarrassed about using print commands for debugging. Tried and true method for many decades.
Suggestion: find a problem you want to solve, some small project or fun hack. And just do it. Every time you get stuck, go to google and search for the answer. Spend time looking at multiple responses and take your time rabbit holing and viewing tangential information. The important part is starting the project.
I don’t know the context of your situation but use an IDE with an graphical debugger. Eg. PyCharm. Then you can easily enter a breakpoint and inspect your code, move up and down the stack to see how you arrived at the point, etc.
Does anyone have thoughts on starting kids on manipulating CSVs or xlrd, instead of turtle?
I was exposed to turtle graphics in school when I was a kid, but I wasn't impressed. I thought there was a huge gulf between turtle graphics and actual programming. It wasn't until 20 years later that I realized there wasn't a huge gulf, I was just one module away from doing real things. When I figured out how to process data, and do useful things, it blew my mind.
It sounded like the purchase of the 5 Pi400s ended up being covered by the library system, but the guy teaching still provided his time and curriculum. I'd imagine getting budget approval for $500 in hardware is a lot easier than getting it for labor. It's good that the library had people there willing to work the system to help make this happen.
I learned to code without understanding first, and then came to understand later. I don't know if that's good or bad pedagogy in general, but it worked for me. Maybe a few more people can chime in; the plural of anecdote is data.
It definitely helped me start to understand sorting algorithms when I tried using skittles and other physical objects I could just move around. Before that it just looked like a magic loop that worked somehow, but afterward I had an idea of what the computer was doing in each step.
Really, all algorithms are better when demonstrated on sweet treats. :)
The value of the Pi is, that it is affordable brand-new. You can buy one or as many as you want and be sure that they are in a perfect working state, no repairs or special set up required. Just having identically machines is of extreme high value, if you are looking not only for a personal item, but something you can rely on for some kind of professional work.
Another nice thing is, that the Pi can boot and work solely on a single micro-SD card. That makes it easy to have any number of install "disks" ready at hand, you don't have to set up the systems hard disk first.
Finally, the Pi gives you a nice set of IO-ports, you can immediately start with any hardware tinkering project.
Affordable is relative. Once you factor in a power supply, mouse, mini-hdmi cable and SD card, you're looking at the best part of £100. And that's if you already have a monitor or can use the TV
There's a hell of a lot of ex office PCs that can run python for much cheaper, if not for free
> There's a hell of a lot of ex office PCs that can run python for much cheaper, if not for free
There are plenty of places that would donate to a cause like this. Or to anyone willing to cart the stupid hardware away, regardless of the cause. It is only "free" if one considers their time - and somehow, the gasoline they buy - to be worthless. The hours spent soliciting offers, picking up hardware, performing admin and tech tasks on old hardware, recycling the hardware that doesn't work, rinse and repeat would better be spent preparing a curriculum for the children.
Seriously, how does the above process not sound like hell to you?
Yes, you can get a random PC that is faster than a Raspi for cheaper. But it is a random used PC which you have to individually set up. Not counting that it is much larger, usually not portable and needs more electricity.
The Raspberry Pi 400 is a pretty much usable desktop computer out of the box which you can buy as a complete set for 100€ new, including a nice book. It is also very nice to use as it is compact, very portable and doesn't need more than an USB power supply.
In comparison it is very easy to grab an used screen, as the screen doesn't need to be set up. In addition, the Pi works well with a current TV. Brings back the best of the home computer age in the 80ies.
I'd agree that, in a teaching context, it's vital to have a consistant hardware / software experience - especially with beginner users, even different keyboard layouts are going to cause confusion. The Pi 400 is a great device, nice and compact - if you get the starter kit you just need to add a monitor / TV. That does somewhat assume someone has a bit of room, though - some space to plug in to what might be a shared TV. The really nice thing about Raspbian is that is does actually work on older laptops (with a couple of catches - no free Matlab), so, if you have an older laptop available and can spend a bit of time setting it up, you can give someone a very similar experience on a more all-in-one device.
Yeah but then you have to do the research that you have all the correct drivers and so forth. Also with time things such as harddrives deteriorate. And also by your same logic. If you are able to get computers for free then you would also be able to get the keyboards, mouses and displays for free right?
I think you are missing the point. Doing that for one machine for yourself: easy, cheap, maybe even fun. Doing that for 5-10 unknown machines for other people to use in a class... Each may be different, you have to setup each one, they may fail or misbehave at any moment, even during class... Not my idea of easy, cheap or fun. Talking from experience in exactly that kind of situations, working with donated hardware in a school setting.
But also now you have to try and fix up five rando laptops that you got off ebay or friends. Who knows what the state of the batteries, screens, keyboards are.
The pi400 kit is $100. Flash five cards and you are done. If you scavange anything it's monitors, there is a whole aisle old flatscreens at my local goodwill, you could find decent enough ones for under $20 apiece. Alternatively any local techish business probably has a closet of monitors they would happily give away just to get them out of the building.
If you're a broke kid who knows computers, then old office PC is 100% the way to go. A bike, $20 and craigslist ad and some door knocking will probably set you up by the end of the day.
If you're trying to help other people, something new in box is 100% the way to go. It's not worth the time of gathering and messing with dissimilar hardware.
Both valid strategies. A question of pull vs push.
Likely, as it was the library that bought them they had to buy via a pre-vetted supplier. Also, if you bought from eBay I'd be quite surprised if your overall time costs didn't multiply. There's something to be said for the Pi's ability to work right out the box without having to do any additional OS configuration.
The Pi also has the advantage of having a huge huge community, so any of the people learning from this person and deciding to get a Pi of their own will be able to find a lot of help online while they are experimenting with the Pi at home
You get what you pay for though, you don't need to spend hours cleaning up someone else's grubby old laptop, and it's a consistent and open source system.
Chances are you don't have to spend hours cleaning up an used laptop. 15 minutes should be sufficient to get rid of dust and upgrade memory of an old Thinkpad for example.
I agree about the open source part though, Raspberry Pi is a good fit for teaching purposes.
The advantage of giving a "toy computer" to a kid is that parents will not freak out if the kid tinkers with it. If a 10 year old opens their laptop, even a cheap one, a lot of parents will freak out.
> At the end of the four-day course, each student received a Raspberry Pi 400
So, the number of participants was limited to 5?
I don't know, that sounds a bit problematic. I would have opted for helping students set up a Python environment on their PCs or laptops (and maybe kept the RPi's to students who may not have one; although identifying students in this situation may be tricky)
> I would have opted for helping students set up a Python environment on their PCs or laptops
You assume that students have a PC or laptop particularly one they can do whatever they want on and that even if they do parents are happy with them installing development tooling on the laptop.
Some people have work issued laptops and know nothing about computers. They might be working remotely for a call centre nowadays, very common - so no, you can't install any tools on those. And even if you could I know many parents who wouldn't let their children install anything on their work machines as if that stops working they will get in trouble at work.
It seems like giving out RPi's seem like the perfect reward. It's tangible and it helps keep environments separate versus a Windows or Mac laptop. Kids can take risks on the RPi by breaking things which is a good learning technique.
I do hope the kids can retain any enthusiasm for using the RPis after the course is over, otherwise it might just sit on their shelf doing nothing. That's a bit pessimistic, I guess, but I definitely went through seasons of ignoring tech toys I'd been so excited about initially.
+1 for being able to break things, though. I know I'm way more likely to try risky (and educational!) maneuvers on a spare computer than the one I have to use for (home)work, assuming I even have one.
As far as development environments - have you tried Thonny (https://thonny.org/)? It has some nice features in it that are specifically geared towards explaining how things work. For example, when you debug, you can step through subexpressions, and their values are automatically substituted in the editor as they are computed.