Sniff is a "Scratch-like" programming language that's designed to help Scratchers move gently from Scratch to more conventional languages. They can start writing programs, without having to learn a new language because Sniff is based on Scratch. They learn a little more about variables, compiling, syntax errors (!), and they can have fun controlling real hardware while they're doing it.

Why We Need Sniff

Scratch is a graphical programming language for kids developed by M.I.T.  It's a fantastic way to get  children to start programming. By  choosing blocks from a palette  you  can quickly build up a script to animate sprites. As a result it's become a popular way for schools to introduce children to programming.

So if Scratch is so great why do we need Sniff? The problem is that at some point you need to move beyond Scratch. It could be that you want to tackle a different kind of problem that Scratch can't handle well. Perhaps you've realised that graphical programming is a nice idea, and great way to start, but in practise its clumsy. Clicking and dragging blocks is a tedious and slow way to build large programs. It could be you need something that feels ``more grown up'' - the cat sprite/logo is cute, and even older children will find it fun for a while, but Scratch is designed to look and feel like a toy (even though its actually very powerful). For whatever reason at some point you start to look for something ``better''.

Having decided to move on from Scratch, the most important questions is ``to what?''. What comes after Scratch? Currently Python seems to be a frequent choice, but that seems to be more by default than through any great enthusiasm. This transition is critical, as its common for kids who loved Scratch to become discouraged and fail to make the transition to ``real'' programming.

Why do strong Scratchers not go on to become confident programmers?  In fact those keen Scratchers are already programmers - in Scratch. It's simply that the leap to Python is too big, for someone at a fragile stage in the development of their coding skills. In theory for a skilled Scratcher to become a skilled Python (or Pascal/C/Java) user they need to simply learn the new syntax, and the few quirks specific to the new language. So why do they fail?

Hypothisis: because at the same time as we ask them to use a different syntax/notation, we change the way they engage with that syntax in a critical way. The visual basis of Scatch means that users create code by selecting elements from a palette. That palette is a constant crib sheet presenting the set of options that the coder chooses from. In a conventional programming language (like Python)  the coder must learn and memorise the language constructs so that upon encountering a problem, they can write down of a suitable construct. The simple fact is that presented with the blank sheet of a text editor, and being asked to fill it with a valid program to solve a problem even competent programmers can feel overwhelmed.

Writing rather than choosing code is no problem for programmers familiar with the language --- even our Scratch users with some experience behind them are probably thinking of blocks and going to find them rather than choosing from what they see . It's at exactly this point that graphical programming becomes tedious --- ``I know what I want, but I have to go find it''. However now we reach the real tipping point for leaving scratch: Scratch users are ready to move on when they can ``write'' code rather than choose it.

So why do they fail to move on?  Because they're ready to write SCRATCH!!!!. They know the blocks of Scratch, they know the control structures, they know the messaging model. They can create Scratch programs without reference to the block palette, because they're Scratch programmers. Python (or any other language), looks different, has different syntax --- how can anyone remember Python when everything they've been taught is Scratch.

Sniff is what Scratch would be if you wrote it down. It's a regular programming language that tries to be as much like Scratch as possible, but being text based its much closer to being a ``real'' programming language. It lets experienced Scratchers use all their Scratch knowledge to write text based programs. Scratch and Sniff are designed to complement each other --- you can even take programs you've written in Scratch and type them into Sniff, and they'll generally work, so you can transition at your own pace to ``writing'' code.

Sniff isn't exactly the same as Scratch --- in addition to being text based, its compiled. It's also more strongly typed than Scratch. Both of these changes make it practical to run programs written in Sniff on the Arduino. While Arduino isn't an integral part of the Sniff concept, its a fantastic system which provides older children with the same kind of opportunities for engagement that Scratch does for younger children.  Sniff makes it easy to write programs that control motors, measure temperature, display messages on LCD, that actually do meaningful things. While finding prime numbers, and sorting lists into alphabetical order are classic textbook coding problems, they're simply not fun. Controlling a robot, or graphing the temperature data you collected from the school greenhouse are real projects that genuine value rather than just being an exercise in pushing numbers around.

Sniff is still very much a work in progress. It implements almost everything relevant from Scratch 1.4, but there are many things that could be done better. It currently needs to be used. Have fun with it, and please get in touch.


  1. Whats said in the blog makes a lot of sense and I can sympathize with the leaning curve as someone who was subjected to learning FORTRAN IV in 1975 using punched cards and some guy we thought was on drugs rabbiting on about some Guy who’s name rhymes with cabbage.

    I have scratch on my Slackware box and my daughter from my second marriage has it as default on her raspberry PI.

    I guess the time line should be Scratch → Sniff → Pygame focused python.

    Some links to sniff might have been useful

  2. I want to write programs for Arduino using Sniff on Windows / 7 and have installed MinGW. I have downloaded extracted it.

    The instructions in README file say "To get started, open a bash shell, and "cd" to the Sniff folder. Then type ". ./setup", and you're ready to go"
    however this is fine for Linux but will not work on Windows.

    How do I proceed from here?

    1. bash is included as part of the MinGW installation in the MinGW/Msys folder. Once you've got that running on windows its pretty much he same as on Linux.

    2. The Linux shell is not the same as the Windows command prompt! If you want to run the Linux shell, check out Bash for Windows.

  3. This comment has been removed by a blog administrator.

  4. This comment has been removed by a blog administrator.