Tuesday 17 February 2015

NOTEWORTHY

Dick Pountain/Idealog 242 /14 September 2014 13:35

One of the inescapable facts of life is that memory worsens as you get older. 40 years ago I could wake in the night with an idea and still remember it next morning. 30 years ago I put a notepad and pencil by my bedside to record ideas. 20 years ago I started trying to use mobile computers to take notes. I last wrote here exactly two years ago about how tablet computing was helping my perpetual quest (I confessed that text files stored on DropBox worked better for me than Evernote and its many rivals). So why revisit the topic just now? Well, because I just dictated this paragraph into my Nexus 7 using Google Keep and that still feels like fun.

I've played with dictation software for years, right from the earliest days of Dragon Dictate, but always found it more trouble than it was worth and practically unusable. So why is Google Keep any different? Mainly because I was already using it as my principal note-taker, as it syncs between my Nexus and my Yoga laptop with great success. I actually prefer Keep's simplistic "pinboard" visual metaphor to complex products like OneNote and Evernote that offer hierarchical folder structures, and its crude colour-coding scheme is remarkably useful. So when one day Google announced that I could now talk into Keep I tried and it just worked, transcribing my mumblings with remarkable accuracy and speed. Voice only works on Android, not on Windows, and it doesn't support any fancy editing commands (but who needs them for note taking)? Does that mean my 30-year quest is over and I've settled on one product? Er, actually no - I now have *three* rival note storage systems working at the same time, can't make a final choice between them and find myself struggling to remember whether I saved that tamale recipe into Keep, OneNote or Pocket. Doh...

The thing is, there are notes and notes. When I get an idea for, say, a future Idealog column, that's only a few dozen words that fit neatly onto a Google Keep "card". I colour these green to spot them more easily, though like everything Google, Keep is search-based so just typing "Ide" brings up all Idealog notes. On the other hand long chunks, or whole articles, clipped from magazines and newspapers stretch Keep's card metaphor beyond its usefulness (and its integration of pictures is rudimentary). For such items OneNote's hierarchical navigation becomes useful to separate different categories of content. Then there are whole web pages I want to save for instant reference, like recipes, maps or confirmation pages from travel sites. In theory I *could* send these straight to OneNote, or even paste them into Keep, but Pocket is way more convenient than either and works equally well from inside Chrome on Nexus, Yoga and phone (Chrome's Send To OneNote app doesn't work properly on my Yoga).

The fundamental problem is perhaps insoluble. Capturing fleeting ideas requires the fastest possible access: no more than one click is tolerable. But to find that idea again later you need structure, and structure means navigation, and navigation means clicks... Mu current combination is far, far better than any I've tried before - popping up a new Keep note or saving a Pocket page at a click is pretty good - but once I accumulate sufficient data the question of where I stored a particular item *will* become critical. This wouldn't be such a big deal if either Android or Windows 8 searches could see inside these applications, but they can't. Neither tablet search nor the otherwise impressive Win8 search will find stuff inside either Keep or OneNote, which isn't that surprising given that both apps store their data in the cloud rather than locally, and in different clouds owned by different firms who hate each other's guts.

On top of that there's the problem of different abilities within the same app on the different platforms. I've said Keep voice only works on Android, not on Windows (voice input also works in Google Search on Android, and tries to on Yoga but says it can't get permission to use the mike). OneNote on Android can record sound files but can't transcribe them, and though it syncs them with its Windows 8 app, the latter can't record and plays files clunkily in Windows Media Player. In short, it's a mess. Perhaps the paid-for, full version of OneNote is slicker, though I'm not greatly tempted to find out. Perhaps Google will soon enhance the abilities of Keep *without* rendering it slow and bloated. Perhaps there is a Big Rock Candy Mountain and somewhere among its lemonade fountains there's a software start-up that gets it about note taking...

OOP TO SCRATCH

Dick Pountain/Idealog 240/05 August 2014 10:34

So, 20 years of this column now, and so far I haven't run out of ideas. Of course one good way to achieve that is to keep banging on about the *same* ideas, and I plead guilty to that with a broad grin. My very first Idealog column in 1994 was entitled "OOPS Upside Your Head" (that prehistoric disco reference will be lost on the youth of today) and it expressed my faith in the long-term potential of object-oriented programming, along with my disgust at the misuse of the term by marketeers and the maladroit/cynical implementations by leading vendors like Microsoft, and this 240th column will be about object-oriented programming too, largely because I recently encountered a curious little OOP product that has renewed that faith.

The product is called Scratch and is intended to teach programming to very young children. At first sight it looks like Lego, thus neatly linking the topics of two of my other recent columns. You build programs by dragging different coloured "blocks" into a window, where they will only fit together in certain ways decided by their shapes, thus removing at a stroke the possibility of making syntax errors (probably biggest source of frustration for beginners). Some of these blocks are control structures, some are data objects and some are actions, and what powerful actions they are, a complete multimedia toolkit that lets you create animations with sound (warning: requires Flash) remarkably simply.

You'll not be too surprised to learn that Scratch was developed at MIT's Media Lab - started in 2003 by a team under Mitchel Resnick - and was originally implemented in a modern dialect of Smalltalk. The latest version 2 is written in Adobe's ActionScript. It's free to download from scratch.mit.edu and you use it online via your browser (though you can store the source for your projects locally too). Scratch is most certainly not suitable for professional development as it can only handle small, visually-oriented projects, but what grabbed me forcefully are the principles it demonstrates.

Scratch is based around a little-used style of object-orientation that employs cloning instead of class-based inheritance. Everything you build is an object called a "sprite" which contains all its own code. Every sprite is executable (it doesn't have to be visual) and one of the things it can do is spawn clones of itself at run-time. Clones behave like their parent, but have their own identity and all run concurrently: they're automatically destroyed and garbage-collected once execution ends. Scratch is also event-driven and supports events like keypresses, mouse clicks, sound-level thresholds, and message-passing between different sprites and their clones.

My first impression of Scratch was so Toy Town that I almost walked away, but then the old Byte training kicked in and nagged me to write The Sieve of Eratosthenes benchmark. It took me half an hour to grasp the principles, the program stretched to all of 10 "lines", looked like a colourful Lego picture, and required a leisurely 40 seconds to find the first 10000 primes. I rapidly knocked out some other old chestnuts like Fibonacci and Factorial to convince myself Scratch could do maths, then had the brainwave of reviving an abandoned Ruby project I called Critters, an animated ecosystem in which various bacteria-like species swim around eating each other, recognising their preferred prey by colour. I'd scrapped my Ruby version when the graphics became too tedious, but Scratch got an impressive version working inside an evening, thanks to predefined blocks that detect whether one sprite or colour is touching another, and a built-in sprite editor to draw the critters. That done, my other old favourite - an animated real-time bank queue simulation - submitted equally gracefully.

Scratch has several, deliberate, limitations. It supports lists and parameterised procedures, but neither are first-class objects that you can pass as parameters, which limits the level of abstraction you can achieve. Everything is tangible, thus overcoming another steep obstacle faced by novices (at the cost of failing to teach them abstraction). The only I/O is export and import of text files into lists (surprisingly usable) and the ability to talk to Arduino and Lego WeDo controller boards. While reading up about Scratch I discovered that a group at Berkeley has created a derivative called Snap! which extends Scratch by introducing first-class lists and local procedure variables. I duly tried it and it works well, but to my own amazement I actually prefer the challenges that Scratch poses to an experienced programmer! In our programming world of 2014, every development tool from C++ through Javascript to Python employs OOP, and I no longer need to defend the technique, but Scratch looks to me like by far the most fun way to teach it.  

[Dick Pountain had rather hoped that his second childhood might no longer involve computers - dammit!]

SOCIAL UNEASE

Dick Pountain /Idealog 350/ 07 Sep 2023 10:58 Ten years ago this column might have listed a handful of online apps that assist my everyday...