Archive for November, 2003

Code Exercises..

Wednesday, November 26th, 2003

A while ago, Steve and I were talking about getting rusty codewise, and losing sight of the zone. That elusive place where the code flows from your mind and all is the nirvana it should be.

We got to talking about the idea that the reason we had lost it was due to a lack of exercise. We were unfit coders. Taking the analogy further, we needed to exercise.

Coming up with the exercises proved difficult. I liked things like Norbert which has very solid requirements, but Steve’s after more of a challenge. I also realised that I had been influenced by Dave Thomas’ Katas to a certain extent, though I feel as though the Katas are a bit too imaginary and I like to get something out of the exercise.

Think of it as the difference between chopping wood or punching a boxing bag. On the wood approach I end up with a nice lump of wood [which is nice if I own a fire, bad if I have to explain why my wife’s favourite tree is now toothpicks]. Punching a boxing bag merely exercises me. I like to be paid twice for one piece of work.

Anyway, all this happened a while back and I’ve no clue if I blogged on it. Steve and I lined up a monthly plan in which we would exercise for 3 weeks on the same thing, then spend the last week discussing. We leapt bravely into the world of OpenGL to draw a 3d witch on a broomstick. I managed a 2d one in an afternoon or so’s work [OpenGL is uggggllly], but attempts at 3d just created inside out terrors. I’m not sure where Steve got, we never finished.

Still, the last few days I’ve been partaking in another form of exercise. Unit Tests for code I don’t know much about. Most specifically, Jakarta Commons IO, a component I’ve been involved in from the beginning despite not being the original coder of a lot of the code, just trying to organise it into a release [2 years and counting]. So for the last four days or so, I’ve settled down and worked on basic unit tests at the end of the day. Nice exercising. I feel nicely warmed up and my mind has gone through the kata that is the foundation of the zone. Tonight was EndianUtils. Last night was too. There’s a lot to test.

And the real winner? Despite this just being a warm-up kata, and despite it being something that isn’t that big a deal codewise, I found a nice big fat juicy bug :)

So the reason for this blog is to suggest that exercise is good for you. Write a unit test for someone else’s code today.

Age of Spam

Wednesday, November 26th, 2003

Been saving up a few thoughts recently, meaning to post etc.

Neil Stephenson has declared the next age to be the diamond age, but it seems to me that the next age is the spam age. Increasing destruction of personal rights and privacy, increasing creation of the individual as a targetted wallet.

It’s not just about email spam, or junk mail, but every other medium with which we are lied to about getting content. Television is increasingly a vessel to deliver the real message [buy buy buy] to us. Half the shows are based on buying things [most techtv. all the fashion, redecorating etc shows]. Some people might know that the ‘fix a house/garden up in a weekend’ originally came from the UK, but before we had that dross we had ‘Time Team’. Perform a weekends worth of archaelogy in a weekend. Amusing if only for the terror a 3 day dig caused the rest of the archaelogy industry.

Magazines are largely spam. I’ve yet to see an advert be split over multiple parts of the magazine, and yet content regularly is. Sys-con are big leaders of magazine spam, but they all do it. A lot of technical books are kind of spam, in that they come from the same people that want you to ‘buy’ their product. That’s a bit ironic to be honest. I’m unimpressed by ‘Microsoft Press’ as it seems hard to trust their integrity, but I applaud every time an open source developer gets a book out. I guess the difference is that I never really believe ‘Fred Bloggs was the lead architect on MS Excel’ etc. Maybe I should start seeing if his name is in the credits.

[Looking at Apple’s Safari, the only names listed are open source names, not a single Apple person that I can see].

Another example, perhaps, in seeing us as pawns in a grand game is the company network. Companies are increasingly [and rightly] defensive on allowing non-company machines into the network [personal laptops etc], and yet it’s assumed that we’ll happily allow the company network into our homes via the wonderful VPN connection. More an inequity than spam.

I’ve diversed a bit, but the main push was that things seem increasingly targetted at manipulating the public. The concept of working with your audience rather than picking their pockets still fails to sink in.

call me mad, but I want goto…

Monday, November 24th, 2003

So I’d never realised this was legal:

public class fred {    public static void main(String[] args) {        boolean a = true;        boolean b = true;

        C: if(a) {            if(b) { break C; }            System.out.println(”HAPPENED”);        }        System.out.println(”DONE”);    }

}

Old memories of hacking around in basic and various other languages are trying to resurface and overturn the ‘follow the standard idioms for readable code’ brainwashing.

The same old anti-oss story

Wednesday, November 19th, 2003

An editorial at osnews.com: http://www.osnews.com/story.php?news_id=5180 suggests that open source documentation is in a terrible state and highly inferior to commercial documentation.

This is complete nonsense.

SuSE vs OS X vs Windows XP. The only one to provide any documentation worth a damn was SuSE. I recently installed OpenBSD based on a No Starch Press book, it was great. If I look for a Windows XP book, they seem to nearly all be ‘Blah blah for dummies’ books.

The same argument is given for support, and yet I’m still looking forward to the day commercial support gives me a feel-good moment. I always spend the time wondering why we’re paying someone to give us newsgroup like service.

Best language books? The O’Reilly Perl series.

How many commercial products have mail list archives I can look at? Some of the more open ones do, but the classic corporate ones are nice and hidden. The more private the support, the worst the archive.

Blogs are another good advantage for open source. Commercial products have nice ‘do-not-blog’ management that doesn’t allow people involved in a product to discuss it outside of marketing. Open source products are truthful.

Lastly there’s the classic open source support advantage. You talk to the developers, and not a tiered first to fourth support system, or some third party company [ie Dell] who are not the company who created the product you are using [Windows XP].

This applies to documentation too. Developers are a lot closer to the documentation and they’re not based vaguely on the requirements which might not be fully realised in the product.

Scraping RSS

Tuesday, November 18th, 2003

I’ve been working on a scraping engine for a while [anyone interested?]. Tonight I was hooking up an RSS parser so that I had a nicer way of scraping feeds into it. Seemed to be 3 RSS parsing libraries that emerged from googling:

The former is LGPL, so not something I feel I can redistribute with my BSD licenced software. The second one looked nice, but demands Xerces rather than using the xml parser in my JDK. The last is chiefly for writing RSS, but can parse.

It’s not as simple as rss4j in terms of business objects, but I feel that it’s probably closer to the real rss view of the world. It’s chief problem is that it depends on EXML, whose site doesn’t seem to have a working download at the moment. Fortunately I found a jar on the iBiblio Maven site which seems to work.

Thought I’d share.

Need to get to Vegas…

Monday, November 17th, 2003

Wishing I had the cash, and more importantly the vacation time from work, to be at the ApacheCon.

Quote from Jakarta Commons list

Sunday, November 16th, 2003

An amusing excerpt from an email from Geir Magnusson Jr, on a thread concerning whether Jakarta Commons has sufficient oversight for the Apache board to feel there are enough safeguards for legality.
======================================
“What have the romans done for us???”

“well, there are actual mature codebases in j-c.”

“And there’s active new ones too! People joining all the time,
suggesting new stuff.”

“Don’t forget the strong community.”

“Oh, and before the recognition and confidence by the rest of the Java
community was developed, no one talked to us.”

“And our history! Don’t forget our history…”

“Right! Aside from the active and mature codebases, the community, the
history, the links to other Jakarta sub-projects and the recognition
in the Java community, what have the Romans done for us?”

Mourning SuSE?

Tuesday, November 4th, 2003

I have a distinct feeling that in a year or so I’ll look back on today’s news that Novell are buying SuSE and mourn the end of Linux happiness for me.

I’ve had doubts recently about using SuSE Pro for servers, but chiefly only because I only like to have physical access to my servers once a year for an hour. Using SuSE Pro means upgrading the OS every 2 years, which isn’t that easy to do remotely.

Despite that, I am a happy user of SuSE. I disliked the Debian install process as just too full of magic, and am currently playing a little with FreeBSD. Neither of these would be my choice for a workstation.

So I’m hoping that Novell’s ownership turns out to be pretty uneventful on SuSE, but provide Novell with a lot of product to embed in their own branded systems to corporates with money to waste. With cynicism, does that seem likely?

Douglas Adams…

Sunday, November 2nd, 2003

I’m reading ‘The Salmon of Doubt’ at the moment. The posthumous piece from Douglas Adams, or rather from the auditing of his computers. It’s amazingly good. Brain-teasingly good. Listening to him speak is almost like programming in the zone, the humdrum and crap of normal life seems to recede and the possibility of brilliance seems to be a reality. The possibility mind you, not the actuality, but just to know that something might be starkly workable, or agreeable or acceptable is wonder.

The book consists of lots of different stuff. A lot of it is first-person stuff, I think, English is not my subject, in which DNA talks directly to the reader, or rather the audience as these are culled from newspaper articles, book introductions or speeches. That’s all of it so far actually, so I lied above, but I am tantalised with the vision that a final Adams manuscript for a Dirk Gently book hides in the rear of the book. The first-person stuff is great. More so because I keep reading things and thinking ‘I do that!’. The repeated times this is happening is starting to worry me. Not because I suddenly feel an urge to write a bestselling humourous book, but because I’d never realised the enormous influence DNA [he liked his initials apparantly] had upon me. I can think back to skits I wrote at school that stole heavily from his humour [though I was also in a political bent at the time so it was Hitchiker’s humour with Ronald and Maggie]. So I’m starting to think that I’ve been brainwashed at a young age, and it was by someone now gone so I cannot thank them.

There is one section in the book where he discusses religion. Well, there are many, but there is one section that I just read and kicked off an idea in my head. Adams’ is discussing the concept of whether there is an artificial God [which there utterly is] and he mentions that humans like creating meta-systems to manage the tiny details. Meta…meta…that’s programming right?
So my thought is that religion is basically programming. Humans are computers, and they are programmed to work together as a group with religion. So religion is not really programming, but parallel computer programming. I can’t think of many religions that are applicable to an individual person.

Maybe the next generation of languages, for grid computing or what-not, should be in the form of a computer religion. Human religions have many years of success at programming a collection of human computers, so why not give it a shot with computers.

We just need a computer that will believe that “What happens, happens” is a good enough foundation to build everything on.