I bought my first computer in 1985 when I was 15, an Amstrad CPC464 (roughly comparable to the C64 and it was actually called Schneider CPC464 here in Germany). One thing I liked about those computers was that they were simple enough so that you could understand how they worked and how the pieces fit together.
With a Windows PC this is practically impossible, given the Windows policy that the users are stupid, don't know what they do and that it's good to hide information from them. Add to that that even Microsoft doesn't seem to know how everything works in their own operating systems.
Linux and the other free software OSes are much more complex than those 8bit home computers, but with their modular nature it's still possible to understand how things work in principle and the availability of the sources means that you can delve into the details as deeply as you like. They also don't hide any information that might be interesting to a user. That's a very intriguing thing for an inquisitive newbie. If I were a teenager today, I'd probably be involved with free software in some way too.
Sketch
I've begun to implement a meta-data facility to make it possible to attach arbitrary data to an object. This is effectively a dictionary. This feature poses some interesting design problems:
- How is the data saved and loaded?
This is easy to solve by restricting the keys to strings and the values to a subset of builtin python types. It's possible and not even difficult to extend that to class instances if they implement a certain interface.
I could use pickle, but that would make the file format Python specific.
- What happens when you duplicate or copy/cut and
paste an object?
The easiest solution is not to copy the data at all. The duplicated or pasted object will have no meta data at all. This is obviously bad, since the user would rightly expect that cut and paste preserves at least some of the data.
The next solution is to make a shallow copy of the dictionary. This can lead to subtle bugs because objects can end up sharing mutable meta-data. Always making a deep copy is not useful either because there might be cases where that sharing is desired.
So perhaps the method that attaches a piece of meta-data to an object should have a third parameter in addition to the key and value, that describes what should happen with the data. That parameter would simply be a callable object that is called with the value and returns the value that is to be used in the copied graphics object.
This solution would be very flexible but it also makes saving and restoring the data harder.
In other Sketch news, I've received Italian translations for 0.6.x.
Sketch is also mentioned in the current issue of c't in the SVG section of the article on internet multimedia standards.
Movies and Books
I've seen several movies lately, including Lola Rennt, Chicken Run and the Wallace and Gromit films A Grand Day Out, The Wrong Trousers and A Close Shave.
I've also read quite a bit and finished Neal Stephenson's Zodiac (recommended by the other bernhard) and Good Omens by Terry Pratchett and Neil Gaiman which I've been meaning to read for a long time now.