January 2005 - Posts

Baboon Help

Random neuron firing-y thing:

I was browsing through some recent posts by Chris Sells, looking for Avalon-related items (my new hobby), and I came across a post entitled “Vote for Ballon Help in .NET 2.0”.
Except that I read it as “Baboon Help” (it's 7:27 on a Monday morning, and I need coffee).

Now, while balloon help is great, I can't help seeing the advantages in assisting people with a psychotic monkey with big teeth that pops out of the PC, stares in their eyes for a couple of seconds, then slaps their hands away from the mouse and screams at them for being so bloody stupid.
I think that could really work.

Note to implementers of public web services

The solution to interoperability is not to stuff an XML result into a string before serialising it.
That is is what's known technically as the Completely Bloody Useless solution.

I just thought you'd like to know.

Key omission from weblogging APIs

The Blogger API and the MetaWeblog API both have their quirks and failings, but on the whole they do a reasonable job for what they set out to do.
There is however one area where they both fall down badly in my experience:

If I want to provide a facility for people to edit or delete posts they have made previously, obviously it is necessary to present them with a list that they can select the relevant post from.
Both the Blogger API and MetaWeblog API have a method called getRecentPosts. This retrieves n recent posts where n is a number passed as a parameter.So far so good.
The problem is that they retrieve the entire body of each post: there is no listRecentPosts method. This is a very sad omission, and frankly quite hard to understand. Whenever one of a number of things may be selected for editing, it will be necessary to present the user with a list from which they can select the item in which they are interested. It is a given that the chances are that any entry that a user does not select, they are not interested in (otherwise they would have selected it)....so why retrieve more data than is needed? Several times more data than is needed.
To identify an entry to the software and to the user all that is required is title, date/time and id.
It is easy to see that Blogger is constrained by its lack of provision for titles, but MetaWeblog would be perfectly capable of providing a list of this information in a useful format - in its case the omission seems to be “for historical reasons”.
This is not simple pickiness - if your connection to the blog server is via a cellular network (for instance, from a Pocket PC Phone Edition device or a laptop or tablet using a mobile phone as a modem), chances are you are paying dearly for traffic, in which case you definitely do not want to be retrieving data that you are not interested in.

I've mentioned the specific example of the Blogger and MetaWeblog APIs, but sadly this is a common omission: the brand spanking new BlogService web service provided with the soon-to-be-released Community Server is likewise limited to a GetRecentPosts method that returns the entire body of each post.
It's all a bit sad really.

OK so I've had my grizzle, but do I have any constructive suggestions?
I think Blogger is pretty much in a corner owing to other design decisions (and I assume the emphasis there is on the Atom API from now on - that's a can of worms for another time).
I see no reason why MetaWebLog couldn't be extended (for all I know it has been in implementations of which I am unaware), but the problem would be to get such an extension picked up by enough implementers to make any difference (I'd be happy enough if a few blog tool providers would just implement newMediaObject - the early versions of APIs acquire/create a lot of inertia).
On the other hand, anyone writing their own API (whether implemented as a web service or whatever) has a golden opportunity to get it right. People might even thank you for it (unless I'm the only person in the universe who is bothered by this at all, which is admittedly true of quite a lot of things).
As a last, not ideal but sort of workable option, it would also be a pretty trivial task to write a web service that would accept a user's credentials, a blog address, blog id and number of posts, issue a metaWeblog.getRecentPosts call to the blog hosting site and then send a slimmed-down version of the result to the client, but obviously the site hosting such a web site would need to be able to handle the traffic (there would also be security issues, but that's true of most current blogging APIs in any case).

Multi-blog blogging app for Pocket PC released (by me that is)

It is now going under the name “Diarist”, because as I mentioned earlier I'm sick of “blog-this” and “blog-that”.
Anyway, it is available for download here.

Blog tools explicitly supported are .Text, Community Server, dasBlog, Blogger, BlogX and Blogsphere.
Categories are supported (although they still don't work for DotNetJunkies), and I've added a few features such as automatically backing up an unsaved new post when you exit the application (I haven't stated this anywhere, but if a textbox has focus you can exit the application by selecting Ctrl+Q from either a soft or hardware keyboard).
And this time I did remember to include a vertical scrollbar.

There is also real cut, copy and paste functionality for text: that one almost didn't make it in, since it took me a while to find a good workable solution. At first I was going to follow a suggestion to P/Invoke simulated keystrokes for Ctrl+C and Ctrl+V, but then I came across a comment from someone who had found that not to work with Windows Mobile 2003 SE, so that put me off that idea. Then my natural impulse was to use the Clipboard from the SDF, on the principal that it doesn't make sense doing work when a bunch of talented and very thorough people have already done it. But unfortunately that was a little more than I wanted, and by the time I'd finished trimming I'd naturally have had to include a disclaimer absolving the authors of all responsibility for the results of me butchering their code, which might not inspire a lot of confidence. So instead I went for a very minimal implementation from the CE.NET API docs. Not nicely encapsulated as P/Invokes should be, simplistic error-checking (”if nothing terrible happened, do the next bit”), but it at least seems to do the job. Currently however the Cut, Copy and Paste options can only be selected from the Edit menu: there's no tap-and-hold functionality. I'm not sure whether to include it or not, since the limitations of the CF mean it would only be useful for Paste. 

I have only tested with Compact Framework 1.0 SP2. I'm pretty sure SP3 would be fine, SP1 might be mostly OK, but I definitely wouldn't put any money on the original RTM version.

Blogging from the pub

...Courtesy of my new, improved, multiblogging app.
Now called 'Diarist'.

My favourite blog tag line

Christa Carpentiere over at Sqljunkies.

A nice antidote to self-importance.

On the surprising difficulty of naming applications

This is a follow-up to the previous post.

As I was walking down the street this afternoon (not going anywhere in particular, just staying outside because it was too hot to be inside) I decided on yet another name change for my soon-to-be-released new application. The working version I've been using is simply the initials of the name of the first version, with “2” on the end. That was always uninspiring, but I was at a loss what else to call it. A number of times I'd think of a name or someone would suggest one and I'd think “Yep, that'll do”...then I'd invariably get sick of it after a while. Then I tried thinking up imaginative nonsense names derived from various permutations on the word “blog” combined with elements denoting smallness, multiplicity and so on, but as soon as I'd find a likely candidate I'd hit Google and find that it was either already taken for something very similar, or happened to be exactly the same as the Czech for “Person who is excessively intimate with cabbages and sometimes, beetroot”. You know, that sort of thing.

Then it struck me: I really hate the pseudo-word blog, and avoiding it in my new app name will therefore be a liberating experience. Or something. That helped.

But all of this has caused me to have renewed understanding and sympathy for, of all people, marketing types and those who associate with them. Since I'm having such trouble coming up with a suitable label for a free piece of fluff, I have to admit that describing and placing actual commercial products looks hard. This is probably why people are given money to do it. Well, that and the fact that cocaine doesn't pay for itself...(that was a joke. So just relax, OK?)
I have renewed sympathy for certain former employers and colleagues with whom I have in the past energetically (but not inappropriately) debated the wisdom of particular  marketing choices:
I forgive them for “Fido”.
I even forgive them for the water-soluble umbrellas (and in fairness, nobody knew they were water-soluble. At least until it rained).

Right, that should be enough humility for 2005

My contribution to Pocket PC blogging moves forward

I've spent the last few days putting some of the finishing touches on the upgrade to my Pocket PC blogging application, which adds support for multiple blogs using various blogging engines (and categories, except that they still don't work with dotnetjunkies...I'm pretty confident that they will once DNJ switches over to CommunityServer).
Last things to do are to add one more blog engine, implement a desktop setup job, write a ReadMe file and of course do some more testing.

Once that's done I intend to update the original single-blog Pocket Blog Writer so that it supports categories and will work with CommunityServer::Blogs when that goes RTM (for various reasons the original version would not have...). The other improvements I will back-port to the original version are the ability to update the post you have just sent (the app switches to update mode immediately after a successful new post) and saving an unsent post as a 'draft' when you shut down the application and automatically retrieving it next time you start it up. 
I think that version will still be the best choice for people who only have one .Text or CS::Blogs  blog, from the point of view of code size, complexity and avoiding unnecessary execution paths (no point in checking for something that will never be there).

But if you have multiple blogs or you use Blogger, Blogsphere, DasBlog and certain others (I'll provide the full list later) then you may find my new masterwork (or as some might have it, appalling kludged together piece of garbage) of interest. 

Something I'd like to see in the CLR...

At least I think that's where it would belong:

One of the features I liked about ObjectSpaces <sob> was the OPath query language...I especially found the XPath-like syntax very elegant and powerful.I believe something object-oriented languages and frameworks could really do with is the ability to obtain subsets of collections and arrays of objects based on the values of properties.
So if I have an array of Person objects called people (and they're always Person objects, aren't they?...either that or Customer, or God help us, Employee...) I want to be able to do something like the following:
Person [] coolPeople = people[][”GivenName='Kevin'“];
Or even better;
Person [] coolPeople = people[][.GivenName=“Kevin“];(Although that's possibly too VB-ish)
I know that right now I can do something similar with DataSets, and to make it slightly less gross, typed DataSets, but that limits me to the relational DataSet model (and database-obsessed objects lacking in behaviour, unless I jump through hoops), and I want it with POCO (Plain Old CLR Objects).

And I'm not going to eat my greens until I get it...