A contract lead got me to try learning more about a technology which the client needs. Working from an e-book which I already had, I soon was thinking that it’s a really confused, ad hoc library. But then I remembered having this feeling before, when the problem was really the book. I looked for websites on the software and found one that explained it much better. The e-book had a lot of errors, using JavaScript terminology incorrectly and its own terminology inconsistently.
A feeling came over me, the same horrified realization the translator of To Serve Man had: “It’s a cookbook!” It wasn’t designed to let you learn how the software works, but to get you turning out code as quickly as possible. There are too many of these books, designed for developers who think that understanding the concepts is a waste of time. Or maybe the fault belongs less to the developers than to managers who want results immediately.
A book that introduces a programming language or API needs to start with the lay of the land. What are its basic concepts? How is it different from other approaches? It has to get the terminology straight. If it has functions, objects, classes, properties, and attributes, make it clear what each one is. There should be examples from the start, so you aren’t teaching arid theory, but you need to follow up with an explanation.
If you’re writing an introduction to Java, your “Hello world” example probably has a class, a main() function, and some code to write to System.out. You should at least introduce the concepts of classes, functions, and importing. That’s not the place to give all the details; the best way to teach a new idea is to give a simple version at first, then come back in more depth later. But if all you say is “Compile and run this code, and look, you’ve got output!” then you aren’t doing your job. You need to present the basic ideas simply and clearly, promise more information later, and keep the promise.
Don’t jump into complicated boilerplate before you’ve covered the elements it’s made of. The point of the examples should be to teach the reader how to use the technology, not to provide recipes for specific problems. The problem the developer has to solve is rarely going to be the one in the book. They can tinker with the examples until they fit their own problem, not really understanding them, but that usually results in complicated, inefficient, unmaintainable code.
Expert developers “steal” code too, but we know how it works, so we can take it apart and put it back together in a way that really suits the problem. The books we can learn from are the ones that put the “how it works” first. Cookbooks are useful too, but we need them after we’ve learned the tech, not when we’re trying to figure it out.
RDFa 1.1
Lately I’ve been looking at RDFa 1.1. Previous versions of RDF and RDFa had been hampered by not being usable in ordinary HTML. RDFa 1.0 could be used only with XHTML. With version 1.1’s usability in HTML5 as well as XML, a lot more possibilities for embedding metadata in documents arise. It’s invisible in the browser but can be extracted more easily and reliably than data can be mined from ordinary Web pages. Dublin Core metadata, for example, is often expressed in RDFa.
The quick explanation, in case you aren’t familiar with it: RDF is an extensible way of expressing arbitrary data relationships by triples, which consist of a subject, a predicate (property type), and object (property value). It makes heavy use of IRIs, which are like URIs but allow the full Unicode character set; IRIs are used rather than simple names to avoid ambiguity. “Title,” for instance, means one thing when talking about books and something else when talking about British nobility; different IRIs can distinguish between them. To create a new RDF vocabulary, you just have to create new IRIs. RDFa is a way of expressing RDF in XML or HTML5 syntax. You’ll often run into the term “linked data” in connection with RDF.
I’ve started work on a possible tool to take advantage of RDFa data in HTML. I start a lot more projects than I ever bring to completion, so for the present I won’t say more about it.
Comments Off on RDFa 1.1
Posted in commentary
Tagged metadata, RDF