A recent file rearrangement on my server resulted in all the links for “Snake Wrangling for Kids” breaking.
The problem is fixed now, and the zip files should be accessible again.

by Jason R Briggs
Snake Wrangling For Kids
A recent file rearrangement on my server resulted in all the links for “Snake Wrangling for Kids” breaking.
The problem is fixed now, and the zip files should be accessible again.
Well… not so sudden.. but yesterday I realised that this year will be the 30th anniversary of the first time I sat down in front of a blinking white cursor.
Said cursor was a small rectangular block, about 4 millimetres by 5 millimetres, and the machine was the Radio Shack TRS-80 — bought by my father for what is, now, quite a lot of money for a computer, comparatively speaking. That was also the year I started to learn programming (BASIC) — using a book which was the inspiration for my own programming book for kids. I was 8 years old at the time (in case you were wondering).
Thirty years is quite a long time to be using computers — although that’s elapsed time, rather than actual. There was a good period in my late teens when motorbikes were far cooler than computers…
In a moment of either inspiration or madness (I’m pinning my hopes on the fact that there’s a thin line between madness and genius), I decided to start work on a version of SWFK for the OLPC.
There are a couple of reasons why this is more of a challenge than the other versions of the book:
The first point is easy to solve. I’ve been running OLPC on VirtualBox (occasionally) for a few months now, so at least I have a vague idea of how to interact with the Sugar interface.
The second point is slightly more problematic. As far as I’m aware, the OLPC runs GTK, and so the pygtk module is available — but I have yet to come across a turtle implementation for gtk (ignoring, for the moment, the TurtleArt activity already installed on the OLPC, which I don’t think is particularly useful for my purposes).
It seems like quite a fun project — implementing the turtle module using pygtk — until you consider the arcane pygtk API, the (IMHO) lack of reasonable documentation (I’m not particularly impressed by the pygtk reference manual… particularly the lack of index), and simple examples to expand from.
Technical issues aside, a week later, I’m considering the semantics of an OLPC edition of the book. SWFK for Windows, Mac and Linux, all target the same fundamental audience. An OLPC edition has a completely different potential audience. The Western+English market is, no doubt, vanishingly small — so while, to date, I’ve had over 6500 downloads, I’m guessing an OLPC edition might garner less than 1-3% more. The real market would be translated versions (assuming the interest in translating actually results in translations) — but that begs another question: will kids in non-Western countries actually understand some of the references? Is talk of DVD players, in-car computers, Nintendos, etc (i.e. some of the references in chapter one, for example), at all meaningful in the developing world? I’m doubtful.
Which leads me to posit the question, is it worth the not-so-insignificant effort?
What do you think?
Genius or madness?
Long awaited by… well a couple of people at least… I’ve recently been working on splitting out Snake Wrangling for Kids into 3 separate editions: one for Windows, one for Mac and one for Linux.
This proved rather more challenging than expected (rather characteristic of LaTeX as a whole actually), and I haven’t fully proofed the final result yet. Those interested can check out the new editions here:
SWFK - Linux Edition
SWFK - Mac Edition
SWFK - Windows Edition
The Mercurial repository (here) containing the LaTeX source has also been updated with the latest changes.
So I’ve sort-of figured out how to do conditional blocks. The following LaTeX initially appears to work:
\newboolean{cond1}
\newboolean{cond2}
\setboolean{cond1}{false}
\setboolean{cond2}{true}
\ifthenelse{\boolean{cond1}}
{
A block of conditional text in here.
blah blah
}
\ifthenelse{\boolean{cond2}}
{
A separate block of conditional text in here.
blah blah
}
I say initially appears to work, because it works fine for the first 4 or 5 attempts, but then some combination of blocks (\begin{verbatim} for example), causes it to break on the 6 attempt. If I include a verbatim block in that 6 attempt, latex outputs an obscure error message… something along the lines of:
Runaway argument?
some code here \end {verbatim} \end {listing}
! Paragraph ended before \@xverbatim was complete.
<to be read again>
Which is rather infuriating, considering that I’ve got verbatim blocks in the previous conditional sections (it doesn’t complain about those), and because I’ve almost got the answer to my problem.
Does anyone out there know of a way to have conditional blocks in LaTeX that are controllable by external parameters?
The sort of thing I want to do is something like:
\configurablesection{someparameter_1}
some stuff here (this is block1)
\configurablesection{someparameter_2}
some different stuff here (this is block2)
Then, from the command line, set a parameter to include the text in block 1 AND/OR in block2, and produce different output as a consequence.
Any pointers welcomed!
I’ve had a few requests to release the “source” to Snake Wrangling for Kids, by people interested in translating the text into another language.
SWFK is still a work in progress — although that progress has been rather slow since we moved to the UK — but I can’t see any reason why I should put off releasing the LaTex source until some sort of mythical completion date, particularly not when there are willing participants out there.
So for those who are interested in translating SWFK to another language, the latex “source” can be found in the following Mercurial repository:
http://www.briggs.net.nz/hg/swfk
Note that it isn’t “buildable” in its current state. I haven’t added the image files yet because some of them are rather large (the cover alone is over 2MB) — the wonders of the EPS format. Mercurial doesn’t seem to handle excessively large image files that well (at least not on my web host it doesn’t), so if anyone has ideas on that front, let me know.
I’ve just uploaded the latest version of SWFK. This fixes a few issues with continuity (such as referring to functions before they were actually explained), adds a basic explanation about the use of brackets and order of operations (which I think was a serious omission given the context), and other minor grammatical and code fixes.
The only major change is to add a few exercises to the end of some of the chapters, plus a new appendix for the answers. This is a work in progress. Exercises are currently missing from Chapter 9, and possibly aren’t as detailed (nor fun) as they should be.
But they’re a start…
The latest version of “Snake Wrangling for Kids” has been uploaded, and is now available on the main page. This is the LaTeX conversion I mentioned in a previous post — but I’ve now applied a Python code checker to 99% of the example source code. Hence I’ve fixed up a few omissions, bugs, and so on.
Automating the testing of example code proved more challenging than expected. In the end, I failed miserably to get doctest working they way I wanted, and had to roll my own testing code which works for a majority of the examples. It’s not perfect, but picked up a few problems, so I’m reasonably happy with the end result… even if it is a complete hackjob.
I’ve finished the initial part of my conversion of SWFK from Word Processor format to LaTeX. Positive aspects? Looks much better than the original; I like working in a text-based format plus I’ll be able to automate the double-checking of my examples (not completed yet); and lastly the file size is a 3rd of what it was (hoorah for my bandwidth!). Negative aspects: the format is more obscure (not a big problem obviously) and the number of pages has significantly increased. LaTeX is a lot more liberal with whitespace than I was, plus I’ve probably accidentally increased the size of some of the images, which won’t have helped. So my apologies to anyone who wants to print it, and has to kill more trees as a consequence.
Download is available from this link, but I haven’t updated the main page yet. Note that this is a draft-draft. In other words, it already was a draft, and now it’s more of a draft…
I still need to tidy up some of my layout ‘messes’, plus re-check all example code, and a few other bits and pieces. Another positive aspective of converting to LaTeX is that I found a bunch of naff typos that appeared in latter chapters (and appendices), where my editing prowess obviously rather severely tailed off…
Feedback on the new format/layout welcome.
I started learning C programming in, or around, 1991. Up until that point, I had been exposed to Basic, Pascal, Modula-2, and (I think) Prolog. C was… somewhat of an eye-opener. Anyone who has had to come to grips with pointers and memory management in C, will know what I mean (and thank goodness for the Borland C IDE help system - unparalleled as a learning tool).
At University, we had papers that required learning a functional language and assembler, but neither of these were like the screaming brick wall that I hit in my second year when I decided to learn C.
Actually, since then, I can’t think of a single technology where I’ve experienced a similarly steep learning curve.
Until LaTeX.
I knew what LaTeX was, of course. But neither had the need, nor in fact, the interest, in learning it before. But after deciding I needed to move SWFK out of the atrocious (and, from an automation perspective, useless) word processing format it’s in at the moment; and after a few aborted attempts to get some reasonable output from various docbook toolsets, I’ve been provided with just the incentive.
But the learning curve is excrutiating.
Get one thing working, and the next thing stops. Change this and effect that. It was all me, of course. There’s nothing wrong with LaTeX after you get used to how it works. But, oh that learning curve. I haven’t felt such a need to scream and yell at my computer in a decade.
This is not to say things are perfect now. I still can’t get the front cover to look centered (advice from a LaTeX guru would be greatly appreciated) and, at times, LaTeX seems to think it knows, better than I do, where to put figures. Working out how to put visible spaces in a \verbatim block is also proving a little challenging. But the overall result does look, in my opinion, much nicer.
Anyone interested in proofreading the new version, please let me know.
Sometime in the last 5 days, while I wasn’t paying attention, the number of downloads of SWFK jumped from just under 2000, to almost 5000 (about 16 downloads to go, to be exact).
To put it in perspective, my lowly WordPress plugin has yet to hit that number in a year or two.
Well… …I’ve hardly been slashdotted, or dugg, but I’m impressed. ![]()
I’ve partly changed my mind about the addition of WPForum. I’m leaving it there for YAK, but have decided that it’s not necessarily useful for the other projects (such as SWFK). Instead, I’m giving the wp-thread-comments plugin a try. At least you won’t necessarily have to register in order to comment.
Unless, of course, someone has a better idea…?
I’ve just added WP-Forum to my site, currently for YAK and SWFK. At 200+ comments, the YAK discussion is already too unwieldy to be useful, and the comments list on the SWFK page could probably use something a bit more ‘threadable’.
The URL can be found here. I’ll keep comments open on both pages, until any kinks have been ironed out. Here’s hoping it’s useful…
The newest version of Snake Wrangling for Kids includes some minor corrections dotted throughout the book (thanks to commentors on the SWFK page and the Edu-Sig mailing list members, once again), as well as a basic clarification as to why floating point calculations don’t always result in the number you were quite expecting (not too detailed an explanation, of course, because that would be boring…
).
The inclusion of SWFK on Pythonware’s Daily Python URL (thanks guys!), resulted in a sudden flurry of downloads, and some really useful feedback.
As usual, the download is available in zipped, PDF format.
The link on the Snake Wrangling for Kids home page, now points to version 0.4. In this update, I’ve re-ordered the chapters somewhat (as previously discussed on the Python Edu-sig mailing list), fixed a few references to code that wouldn’t work in Python2.4, included a brief discussion on while-loops, and added a long lamented (at least, by me) Table of Contents.
I have to say, OpenOffice.org is starting to become rather unwieldy. Partly my fault, because of the way I wanted to layout the book, but also because it’s not obvious how to accomplish certain layout & style tasks that are necessary to make a PDF look less like a unprofessional pamphlet and more like a professional piece of work.
Anyway, the latest version is downloadable from this link.
Since I’m already naming dropping… I thought I’d also mention I received a reply from David Brin (who was the reason I started working on SWFK) a few weeks back. I’m quoting part of it below (hopefully he doesn’t mind) because, let’s face it, it’s durn cool to get a reply from an author who’s one of my heroes.
Thanks for your thoughtful and interesting message in regards to my Salon Article “Why Johnny Can’t Code”.
Alas, this one swarmed me beyond all expectations. Who’d have thought that a little meditation on the inability of computers to compute would spark such fury! (Far more outright rage than when the topic is religion or politics!)
I appreciate your efforts to create a book on scripting languages to interest kids. At a brief glance, it looks cool. In fact, I have added it to my standard reply…
……snip……
With best wishes, for a confident and ambitious 21st Century,
David Brin
www.davidbrin.com
Coolness!
I know. I’m a geek.
On a whim I decided to send the link for SWFK to Guido. Not that I’m on a first name basis or anything…
Anyway, turns out that was a darn good idea, because he suggested sending the link through to the Education Special Interest Group; which resulted in a ton of downloads (well, compared to the few I’ve already had, at least), and some really useful advice.
The most common theme so far seems to be “move the turtle chapter forward” — something I’d already thought briefly about, but hadn’t come to any particular conclusions. So, I’ve decided to split the chapter on using the turtle module into two shorter chapters, and cover the basics in Chapter 5 (inserting it before the chapter on functions, modules, etc).
After I’ve tidied things up, I’ll update the site with the new version.
…this is patently -not- striking while the iron is hot.
Back in September last year (2006), David Brin wrote an article in Salon.com lamenting an inability to get the BASIC programming language running on a current generation Mac or PC.
That article made a lot of sense, though I disagree(d) with his essential argument against scripting languages…
BASIC was close enough to the algorithm that you could actually follow the reasoning of the machine as it made choices and followed logical pathways.
Well, to be more precise, I disagree with ruling out scripting languages based on this premise, rather than disagreeing with the fundamentals of that specific argument.
However, Brin’s article resonated more because I’d already been thinking (a few weeks earlier) that there didn’t seem to be anything out there similar to the BASIC programming book I’d read as an 8 or 9 year old. An Amazon search revealed a precious lack of any recent publications that seemed relevant. A few beginner’s guides, programming for dummies, and some seriously out of date books about… Basic programming (and by seriously out of date, I mean circa 1980s).
At the time, I wondered if perhaps I could have a go at writing a Python programming book for kids, so David Brin’s implicit call-to-action was just the added incentive.
It’d probably only take a couple of months…
This year, in January, O’Reilly Perl guru Nat Torkington continued the meme, and judging by the 50 comments (mine included), there’s plenty of interest in kids programming. More fuel for the proverbial fire. And then there’s Scratch, MIT’s (newish) programming language for kids — which seems like a fine idea, and is probably more approachable than the typical programming languages.
So, finally — almost a year after I originally decided it might be a good idea — I’ve completed the first draft of “Snake Wrangling for Kids - Learning to Program with Python”. But striking while the iron is hot — this, rather obviously, isn’t.
Anyway, the manuscript is pretty unpolished. It hasn’t had the advantage of a professional edit (nor has it been proofed by anyone knowledgeable enough to say, “What on earth were you thinking!?!?”). But hopefully posting it here will result in a few comments to help me tidy it up… and perhaps someone will find it useful — at least hopefully any kids that want to try something a bit different to Scratch.
The main page for SWFK is here, where you’ll find the download for the zipped pdf.