Tuesday 27 November 2007

One Computer

Thomas Watson from IBM said that he could foresee a need for perhaps five computers worldwide, and we now know that that figure was wrong, because he overestimated by four. - Clay Shirky

There is only one computer in the world now, and that computer is the World Wide Web. Developers must know that, understand that and believe that.

Software does not matter unless it is written to run on that one computer. Know that too.

I have been saying this for awhile now, and some people have had some trouble understanding what I mean. I am not saying that the only thing that is to be written must be web applications. What I am trying to say is that if you are writing software it must be able to be used by applications and software that does run on the Web.

If your software does not, then it will simply be ignored. That's not malicious or intended as a criticism of your code, I'm sure it's very good. Think about it this way: as OS/2 faded away any software that only ran on OS/2 simply stopped mattering. This is just happening again, except all operating systems are fading away, replaced with that one computer.

So, if you have some amazing idea for writing some beautiful video processing code in the current functional-language-of-the-moment, you must have a plan for making that code useful to the web otherwise no one will ever use your code.

Positive Change

There was a federal election in Australia, just last weekend: the 24th of November. This election went a lot better than the last few years worth of elections. John Howard finally lost. After 11 years in power and four election victories against either ineffective or insane Labor opposition, the mean, evil little troll has finally been ejected from power.

It was very satisfying to also see him so thoroughly ejected from power: only the second sitting prime minister to lose his seat. Ahhh...

And Australia can now try to once again become a better place to live.

There has been much discussion over why Howard deserved to lose. Many have correctly pointed out that for all his claims he was not a leader who championed much reform; that the continuous 11 years of economic growth was really part of a longer 16 years of growth started under the previous Labor government due to actual economic reforms; that he no longer offered any kind of vision for the future of Australia; that his threat to hand over to Peter Costello was seen as just that: a threat; that it was just his 'turn' to go.

For me, while all of those (except the last) are true, none come close to the real reason why I have always been adamantly against Howard, and why I am particularly happy that he has now been voted out.

Howard was a leader who created a government of isolation, selfishness and meanness. And of course this sort of attitude at the level of the federal government can't help but affect the entire shape and direction of Australian society.

Consider a handful of events under Howard's watch:

  • Pauline Hanson spewed her racist, xenophobic vitriol without any form of condemnation from the government, permanently damaging our image and reputation throughout Asia.
  • Refugees aboard the MV Tampa were prevented from entering the country, extending our damaged reputation to the entire world.
  • The GST, a fundamentally inequitable tax hated by both small businesses and the poor alike, was introduced. When there was apparently no need as all the earnings were returned as tax cuts.
  • Children nearly drowning while on their way to the Australia was used as a wedge to further incite anger against refugees.
  • A deeply unpopular war was started with the sole justification of supporting George W. Bush.
  • Tax cuts were the sole mechanism of delivering benefits to the population: a mechanism that always favours the rich over the poor.
  • University educations became a mechanism to turn a profit.
  • The enormous earnings from the global resources boom was squandered without any investment in social services.
  • The Australian republic movement was deeply damaged.
  • There was absolutely zero progress on Aboriginal reconciliation: capped with the 'intervention.' Itself worryingly reminiscent of the Stolen Generation.

Ultimately, this was a government of the mean to benefit the rich. Under Howard and his cronies Australia became a more selfish country, a more racist country, a country of people who would not do something just because it was the right thing to do.

I was always against Howard because of the damage I thought his ideaology was doing to the fabric of our society. In the end, my theory is that he lost because people finally saw him for what he was. [WorkChoices] showed that he didn't really care about his 'battlers.' And also, I believe that people didn't want to be selfish and scared anymore. The country wanted a more positive view of the future. You can only be terrified of your neighbour for so long before you decide that it's enough.

It is interesting to see that others are also coming to this conclusion. My fervent hope is that his legacy is seen for what it really is. In the end, the country will be a better place without him. Hopefully, it won't take too long for the damage to be repaired.

Good riddance Howard, we're better off without you.

Monday 19 November 2007

Currying

As a lazy functional language Haskell has to provide automatic currying of all functions. But once you've tried to use a functional language that doesn't automatically curry you realise this isn't just an implementation detail, it's a useful technique for concisely implementing programs.

but before describing how currying helps, what is it? Currying is a concept from the analysis of mathematical functions. Say, you have a function f(a, b), that takes two parameters and returns a value. Currying reduces this to two functions: one that takes the other parameter and returns the original value.

That is, currying reduces functions parameter-by-parameter into other functions - these new functions each take one less parameter, but return a function, instead of a value, that then takes the remaining parameters.

For example: f(a, b) = a + 2b. If this were curried with respect to a = 5, b = 10, then the function would be reduced as follows:

f(5, b) = 5 + 2b
        = f(b)
f(10) = 5 + 2 x 10
      = 25

And hopefully you noticed that halfway through that evaluation we found a function over b which had already had a value substituted in for a. This, by the way, is also an example of partial evaluation. In fact, it's more an example of partial evaluation than currying, as currying does not require values for function parameters.

Anyway, that's a brief introduction to currying in maths, but I'm not a mathematician so for some more (accurate) information try reading up on combinatory logic.

So, how does currying exhibit in Haskell? Function application is treated as a special operation, distinct from calling a function. Functions are applied from left to right, to the first parameter, producing a new function that is applied to the second parameter and so on. A Haskell function call like:

f 1 10 "Hello"

is evaluated as if it's parenthesised like:

((f 1) 10) "Hello"

If working from left to right each additional expression produces a new valid expression, then does that mean we can leave off an arbitrary number of of expressions from the right and still have a valid expression? Yes, that's precisely true. In fact that would actually be a function which could then be given a name and provided with any number of values.

And this is where currying really comes in use for expressing code. Using the right functions and operations you can typically define your own functions without naming any parameters.

In particular, this dramatically reduces the number of anonymous functions you need to declare. As opposed to Scheme, they become quite rare.

A Scheme implementation of reverse could look something like:

(define (reverse lst)
  (define (r lst)
    (if (null? (cdr lst))
        (lambda (t) (cons (car lst) t))
        (lambda (t) ((r (cdr lst)) (cons (car lst) t)))))
  ((r lst) null))

While an equivalent Haskell implementation could look like:

reverse lst = r lst []
  where
    r (h:[]) = (:) h
    r (h:hs) = r hs . (:) h

Of course, in the languages' standard libraries these functions are defined quite differently (Haskell's is only one line...) But this is useful as those are equivalent implementations - Haskell's is shorter only because it automatically curries.

Finally, currying is required in Haskell because it's a lazy language. The currying produces a train of anonymous functions - each retained as a value. Arriving at a result when required is simply achieved by evaluating those retained anonymous function values. But only the minimum set that are actually required.

Understanding currying and being able to curry your own functions is your head is a fundamental step to 'getting' functional programming.

Bear With Me...

Now that I'm using some proper tools for my blog editing I'm going back through my old posts making sure the formatting and HTML are correct. In particular, I've turned off the Blogger setting to do magic with line breaks, and instead I'm manually inserting <br/>'s where I want them to be.

This is better for my general OCD nature regarding all forms of code I write, and I hope my blog will look a bit better too. Please bear with me as all my posts slowly get cleaned up...

Oh, and if there are any other Mac Emacs users out there who are interested in my little tool, send me an email and I'll try to arrange to share it.

Sunday 18 November 2007

Local Editing

I was never entirely happy with using the Blogger editing box in a web browser for an entire, long post. It's in a browser, where the slightest click or accidental action could cause the post to be lost. Plus, all my blog posts are now stored on Google's server. Call me old-fashioned, but I like my work to be on my computer.

Plus, I'm an Emacs user, I want to edit my work in that editor/operating system/religion. Call me very old-fashioned...
Well, I've finally found a solution. The blog editing software from Red Sweater, MarsEdit, will quite happily deal with blogs on Blogger: downloading old posts and uploading new ones, unlilke some other blogging clients I've tried.

Though it has the ability to launch other editors, like TextMate, to edit posts this does not work immediately with Emacs. MarsEdit doesn't ever notice that Emacs eventually closes the file. The MarsEdit developer was very helpful. He pointed me to a page describing what MarsEdit is waiting for, and after a bit of Cocoa hacking I can now edit my posts in Emacs. Woohoo!

Well, that's assuming this post appears OK...

And as an aside, I'm pretty impressed with Xcode 3.0. It's got some pretty nice features: the purtiest were these colourful labels that appear directly in your source marking compiler errors and warnings.

Any way, assuming this appears correctly, I'll be buying MarsEdit, switching to that for blogging, and you should see a lot more posts out of me in the future.

Saturday 22 September 2007

I Don't Get Jeff Atwood

I read quite a few blogs, on different topics, but there is (obviously) a whole bunch of computing ones in there. I read some of the big name ones, like Joel on Software and The Old New Thing, as well as some that could possibly be regarded as second-tier in the blagosphere like Intertwingly and Steve Yegge.

But one big name blog I don't read is Coding Horror, by Jeff Atwood.

His posts appear pretty often on programming.reddit.com or digg.com, friends (who I respect) read him and recommend his articles, but I just can't figure him out. Sometimes his articles manage to completely miss the point, and other times he reasonably succinctly describes a simple concept.

For example, the post Building a Computer the Google Way contains an historically interesting photo of Google's first server. This server is interesting because it is fairly clearly a cobbled together set of home-built servers with some custom designed hardware. These servers were built by Google from the PCB under the motherboard on up. Sure, they used commodity parts, but I can guarantee there are some unique pieces in there. Probably in the vicinity of the interconnects.

This is an interesting example of how a successful company will control everything that possibly relates to their business. You can't afford to rely on the off-the-shelf components for anything that might be technically critical. For Google, indexing and querying speed were hyper-important. So they built their own hardware. Amazon did something similar when they wrote their own web server. Always remember these example when you're railing against Not-Invented-Here syndrome.

Unfortunately, Coding Horror proceeds to use the Google example as justification for why every good programmer should build their own PC instead of just buying one from Dell. I'm sorry, but I can't see how reading specs on PCI slot counts on a motherboard are going to lead to building the kind of server that could support Google's load, or perform their proprietary indexing any faster.

However, on other occasions, Coding Horror does actually manage to explain concepts accurately and clearly. Though I'm usually left thinking, this only occurred to you now? See Everything is Fast For Small n and You're Probably Storing Passwords Incorrectly.

He does, however, write well. And there lies a real skill. If only he could be brought up to speed on some actual modern computer science and software engineering concepts, we might have something.

Monday 3 September 2007

An Effective Use of Limited Transport Infrastructure


I wonder if I'll be arrested as a subversive for posting this?

Method Dispatch and Scheme

As I work on Shrew and attempt to learn more about Scheme, I've been doing some reading. And in one of my books I had one of those 'Aha!' moments where I really saw the benefit in the Scheme way of doing things.

In object-oriented languages there are two approaches to dispatching methods.
  • Message Passing: Objects are regarded as actors. Method call is treated as sending messages to those actors. Method dispatch is therefore determined solely based upon the type of the receiver of the method, the types of any arguments is immaterial. SmallTalk typifies this style. C++, Java and most other OO languages have adopted this style (badly.) This is also known as single-dispatch.
  • Multi-methods: Methods and the objects to which they can be applied are regarded as a cartesian product: objects don't own methods and methods don't own objects. Method dispatch is therefore determined from the type of all the arguments equally. CLOS uses this style. I am not aware of any other widely used languages that also use multi-methods.
The book I am currently reading laid out some Scheme code that showed how to implement multi-methods, and then followed it up with some code that implemented message passing. In both cases the code was extremely simple and easy to understand: the basics for two object-oriented approaches were right there on the page.

And most interestingly, there was no reason why both systems couldn't be used on different objects in the same program.

The book is about general computer science concepts, so it doesn't actually point out what it has just described, and nor does it provide a complete implementation of an object system (yet...) however it is interesting to see such a fundamental part of a object system in so few lines of code. It is the nature of Scheme that makes it possible to implement things that other languages regard as 'part of the language' in your own programs.

It is not possible to do this in Java; it is not possible in C++, not even with template meta-programming; and it isn't even in possible in Haskell*.

Now, that's not to say that having both multi-method and message passing dispatch is itself such a killer feature. But it's going to be kind of hard to beat a language to which both of these things can be added so simply.

* Of course, via differing mechanisms of varying degrees of pain, something like multi-methods could be added to all of these languages. Here I am talking about a simple, transparent at both caller and callee technique for achieving multi-methods and message passing.

Original Policy

Has a century of compulsory voting and a decade of international neo-conservatism finally killed off the last vestiges of original thought in governmental policy? It certainly feels that way.

As Australia approaches a federal election both major parties are competing based almost exclusively on policies either of cutting taxes in some form or giving money away in some other form. Is there no other mechanism of directing society? Surely there must be.

Look at the first home buyers grant. Instead of just cutting the price of a home, how about some other means of encouraging saving that isn't giving away the beginning of bank account? Where is the inspirational leadership and original thinking that gave us the Industrial Relations Commission; the Truth and Reconciliation Commission; the Marshall Plan?

That's the sort of thing I'd like to vote for.

In my other world of software development, this 'just give money away' approach is known informally as Econ 101 Management; as in it follows an economic model informed by only an introductory understanding of macro-economics.

I'd like to hope that our elected leaders knew a little more. Now please go away and demonstrate that.

Monday 20 August 2007

Megadata?

So the big deal is mashups and the massive amounts of data collected by the services being mashed. And this is becoming known as 'Megadata'. Lots and lots you can do when you have all this attention data, the activities of your users, and then when you combine that with what they do on other servers... Wow! The things you can do for your users really is pretty damn impressive.

Well, I was thinking today that with access to data across the activities of individual citizens accurate taxation suddenly becomes really, really easy. I bet you all just shuddered at the idea of the government (pretty much any government) having access to all that, right?

So, why are we so cool with random companies knowing?

Graining and Cities

In his book The Timeless Way of Building, Christopher Alexander states that people should work where they live. I had some trouble with this at first as it's pretty difficult to achieve. There aren't all that many good jobs, and the chances of already living in the same area as the job are pretty low; what are you supposed to do? Move?

In spite of this, I did keep reading. And Alexander does expand on the idea some more.

The point is not to live in the exact same area as where you work, but to work in an area you could imagine living and, as important, live in an area you could imagine working. When you walk down the street you need to see all the parts of life happening: you need to dodge prams, see people eating and drinking, watch people in their offices as they watch people lounging around in a park. You need to see kids streaming home from school in the afternoon, you need to see the retired out doing their shopping during the day.

And you need all this both where you live, and where you work. You need to feel when you're spending those 40 hours a week away from your home that you are still in a place that is someone's home. Seeing those people and all the disparate things they do forms a connection between you and them. If the place you work and the place you live both have this, then you can easily transplant the connection from home to work and vice versa.

There is a name for all this: community. Community requires all parts of life: babies through to the elderly; workers, shops, services. And if you're hiding away at work for 40 hours a week you tend to forget that not only this is all going on, but also that all these different kinds of people share your world with you.

This all comes down to graining. Think of it in terms of zoning. The zones of use form grains within an area. In older areas of a city, this graining will typically very fine. That is, you can walk a short distance down a single street and pass houses, offices, cafes, libraries, shops. In newer areas, the graining becomes larger, until you reach the 60's ideal of a city composed of satellite towns: rings of suburbs with a shopping/office district at the centre.

And in there, a community dies. Communities need people to spend time with them to grow, if a significant chunk of a community's demographic disappears for a big chunk of the day then it can't really survive. Look for the fine graining, try to live and work there if you can, but always enjoy the graining.

Sunday 19 August 2007

V for Vendetta

V for Vendetta
Alan Moore & David Lloyd

Another comic, though this one would definitely fit well within the hazy definition of a graphic novel. And this is what I was hoping to get when I started reading comics. On the surface, it's a fairly straightforward tale of a downtrodden society inspired to rise up and throw off their oppressors by an enigmatic leader. But, it's just told so well, and being a comic adds something quite different to the story. There are also enough new angles, and the refusal to go with the obvious pay-off adds interest.

Compared to The Sandman, V for Vendetta is a much more traditionally drawn comic; the panels are all regular shapes, with a regular left-to-right/top-to-bottom flow. And it just ain't anywhere near as purty: the colouring and graphic detail just don't match the amazing art of Sandman. It does have a very nice dark, brooding atmosphere, however.

V was first conceived back in 1981, and then written and published over the remainder of the decade, finally finishing up in 1989. My edition includes a short introduction by Alan Moore, written in 1988. And this is an interesting comment on those times and these. The 80's were a decade of conservative dominance, particularly in the UK and US. Moore writes about the Thatcher government doing everything it could to outlaw homosexuality. Moore was feeling deeply disaffected with his home country: he wanted to take his family and leave.

Now, (hopefully) coming to the end of another decade of worldwide conservative dominance, there is some hope to be had here. Sure, rights have been eroded and the world in general is now a less trusting and friendly place. You may look at leaders and policies and see just a bleak descent into a well of fear and anger.

But, we haven't gone that far backwards. Australia now has an openly gay senator: Bob Brown. Try though the conservatives and neocons might, the world will move forwards, and inevitably open up. The conservative decade is coming to a close, and just maybe the next decade will be a world better fit for everyone to live in.

Feersum Endjinn

Feersum Endjinn
Iain M. Banks

That's Iain M. Banks the sci-fi writer, not Iain Banks the modern literary fiction writer. It's actually the same guy, but he publishes his sci-fi with the middle initial. I'm working my way randomly through all of his sci-fi and I will probably try to read most of his literary fiction as well. I'm yet to hit one, sci-fi or otherwise, that I haven't enjoyed.

A friend warned me just before starting that this one was a little heavy going, due to the phonetic pidgin. In the end, it wasn't that bad. Not as bad as Cloud Atlas, but personally I don't find pidgin that hard to read, others might so be warned.

Imagine a future where nothing goes particularly wrong for the Earth and humanity. There is no apocalypse to be post-; technology keeps advancing, absorbing more of the little things we need to do, gently wrapping a comforting, protective blanket around everything.

Now, project that world and the people living in it forwards several hundred thousand, or possibly million, years...

And then something does go wrong.

Feersum Endjinn was published in 1994: I'd say that aspects of the Matrix's depiction of the machine world inside the machine are inspired by this book. Apparently, there is also some question about whether this book is actually part of the world of the Culture, from some of Iain M. Banks' other sci-fi novels, even though it isn't identified as one. It seems that this probably isn't the case, due to the back story surrounding Consider Phlebas, but this could be read as a hypothetical explanation of how the Culture originally formed.

Saturday 18 August 2007

Thoughts on Scheme

There's nothing like writing a complex application in a language for really learning it. I've been able to read and write small pieces of Scheme for years. And I've known enough of the underpinnings of the language to write a (very) small Scheme interpreter in the past. But, part of the point of writing Shrew in Scheme as opposed to, say, Ruby is to really learn the language.

I haven't been at it for long, but here are some random thoughts and comments so far. Much of this will change as I figure out how to use Scheme properly. These comments are also mainly a comparison of the only other functional language I know well: Haskell.
  • The syntax is not very clear: everything looks the same. This prevents you from scanning the code to get a feel for what is happening. The indentation helps, but fundamentally every operation is just a parenthesized expression. I am certain that this is just cultural, with more exposure I'll get better at reading; don't count this as a negative.
  • I really miss pattern matching. How can you program without it? I'm going to have to look into destructuring-bind.
  • Dynamic typing is sweet. As well as all the other benefits, dynamic typing + modules = as much encapsulation as classes give you in C++.
  • The standard libraries are pretty paltry. The SRFIs add a lot, but it's still nowhere near as rich as pretty much any other language. Maybe I'll explore Common Lisp at some point.
  • Currying is not just a implementation technicality, it's useful for designing data structures. I miss currying as well.

Tuesday 14 August 2007

What is Shrew?

Shrew: a small insectivorous, mammal; one of the descendents of the first mammals to evolve. Related to voles and hedgehogs. They are not rodents, and are not in related to mice and rats.

It's also an animal name containing the letters S, R and W: I use animal names for my project code names, and I needed this one to contain those three letters. The R and W are for REST and Web Server respectively, the S is for Scheme. I'll get to that later.

The idea of Shrew is to build a web server that makes the creation of RESTful web services easy. Popular web servers are still designed as file servers: a web server exposes a directory tree, and then allows certain files within that tree to be executed on the server, to generate the content to send to the client. This encourages (even forces) web applications and services to be built around files. RESTful services are supposed to built around resources. These resources are meant to be the logical 'things' that exist in your service: not files. You don't want to have ".aspx" or ".jsp" or ".php" appearing in your resource URI. It should look something like /person/visit/730. And one of the rewriting modules should not be how you have to get there.

Shrew will make resources the centre of an application or service. The resources exposed will be listed and mapped onto a URI form, and also a piece of code to handle that resource. Shrew will also make no attempt to pretend that an application is not running over HTTP. All request headers will be available to the application; the application will be able to override the generation of response headers on a response-by-response basis; the application will be able to specify particular response codes.

Most importantly, dispatch of incoming requests will be performed not just on the request URI, but also the request method: GET, POST, PUT or DELETE.

The point of providing this level of control is to allow applications to be properly RESTful. For example, look at the Etags header. When a request for a URI is first served to a client a web server can generate and attach an Etag header. If the client requests that resource again, it can include the Etag header in the request. The server can then use the received Etag to determine if the resource has changed and needs to be re-sent. Sounds fantastic, right? No need to re-generate a complex page on the server, or send down a large amount of HTML. The server reduces its load, and the client can redisplay faster. A popular web framework even automatically implements Etags for you. Everyones' happy.

Not so fast. That popular web framework generates its Etags by taking an MD5 hash of the page before sending it to the client. This requires generating the full page, everytime. Even when it hasn't changed. It saves the bandwidth, but not the server processing time. To do Etags properly the application needs control of headers, it needs to be able to match the response to a particular resource.

The web changes rapidly, there could be other valuable headers coming soon, there could be interesting and unique ways of using existing headers. Instead of trying to forsee all those cases, Shrew will simply provide default implementations for headers, but allow an application to override those.

Of course, there's more to web applications than requests and responses. Part of the reason those rewriting solutions are distasteful is that the generated pages needs to use URIs in the rewritten space, not the developers directory space. Shrew will allow resources to link to other resources, by name and id, generating the correct URI at runtime.

Shrew will also include a library for writing markup. This will not be template based. The markup will be written in a Shrew DSL and then executed to produce the HTML. Inspired by Markaby. This markup will be renderable as HTML for serving to a browser, and also as XML for serving to a web service client. This will probably require some hinting, as large parts of the HTML will not be required in a XML view. It's going to be interesting to get that to work...

Finally, in my introduction to Shrew I mentioned some unusual technology choices: the whole thing will be written in Scheme. This is the other half of Shrew as learning project. As well as really getting a handle on REST, I want to learn Scheme. I can read Scheme and write small projects in Scheme, but there's nothing like writing something large for really getting a feel for a language.

In particular, Scheme's killer feature to me is 'data is code.' Not that code is data, nor the macro system, nor that it's a functional language. I'm really interested in exploring the data is code concept, and a web application/service framework seems like a good place to try that.

Monday 13 August 2007

The Clown House

Over in Darlinghurst, on the corner of Bourke and Stanley Sts, there is an old, very run-down, abandoned terrace. Fortunately, though it is essentially a ruin, it has not been knocked down. If you happen to approach this house from the back, by walking up Stanley St, there's a sight you can catch over the back fence.

I've no idea who painted it, or how long it's been there. I like it; it's nice to see these random expressions of art hidden away in the middle of the city.

Sunday 12 August 2007

The New Project: Shrew

I've been reading and thinking about RESTful web applications and services quite a bit recently. The last large web application I wrote evolved into a RESTful web application: readable, bookmarkable URLs; resources with unique addresses; and alternative renderings of a resource depending on the request.

It would have been a short step to complete this evolution and then expose the programmable interface as RESTful as well. This all happened without being aware of REST: it just seemed like the logical way to design a web application.

REST is starting to make a big splash now. Web services have been around for a few years, and many systems have been built upon them. Beyond the architectural considerations, it seems that the main differences between the two approaches is that it is easier to write clients for a RESTful service, and it is easier to write the service using SOAP.

Up until recently most of the development of web services has been for systems that do not cross organisation boundaries. Therefore, the consumer of the web service has usually been the programmer who wrote it. Or, if not actually the same programmer, then a programmer in the same organisation. SOAP works well in this environment as one development tool can be mandated and this tool can generate all the painful code required to consume a SOAP service, and when the SOAP service changes every single consumer can be informed.

However, now there are many services being exposed on the Internet that provide useful data. Services such as Google Maps. It is becoming more common to write applications that consume a handful of services from different organisations. Suddenly, it is more important for the client to be robust and easy to write.

Unfortunately though, it is still much easier to write the service using SOAP than REST. Most web servers don't deal well with the concept of the URI not referring to an actual file on disk, and there aren't many frameworks that put resources rather pages at the centre. There seems to a hole in the eco-system here.

I'm going to take a shot at filling it. For this project, as I'll be doing this for interest and to learn, I'm going to talk about what I do as I do it. Ruby On Rails will ultimately provide the full RESTful service framework that the world needs; I'm not expecting to make money off this project. No need to hide anything.

I've started writing some code, and planning a simple design. I'm going to make some apparently unusual technology choices, but this is for my learning. I'll talk about the technology and design in some upcoming posts.

Friday 10 August 2007

The Sandman, Vol 2: The Doll's House

The Sandman, Vol 2: The Doll's House
Neil Gaiman

Second volume of trade paperback editions of the Sandman comic series from the 90's. Clearly I liked the first one enough to keep going. And this one has kept me interested; I will be reading the third one. Unfortunately I still don't know how to write about comics very well...

Anyway, after this one I'll be reading V for Vendetta by Alan Moore and then probably onto The League of Extraordinary Gentleman, also by Alan Moore. We gave my younger brother Frank Miller's Batman, The Dark Knight books. I'll be hitting him up for some comments, and maybe reading those as well.

One thing I can say, comics take mere minutes to read. Grab a few and just churn through them, no long term commitment, no worry that you'll spend hours, days, weeks reading a book. A good way to just fill in some time with some (very) light escapism.

Thursday 9 August 2007

A Subtle Request

A few weeks ago, on the 5th of July, we came home to find the following subtle request:

Our London had pushed her empty bowl across the floor, and left it right in front of the cupboard we keep her tinned fish in. I wonder what she could have been after?

Wednesday 8 August 2007

On Books and Trains Stations

I didn't want to say anything about Harry Potter and the Deathly Hallows, but I will say that I deeply approve of the use of the train station. Train stations are magical places: journeys begin and end there. When they were first built, lives ended and began there. Train stations are intersections of everyone's world: your world with all the people around you; your old life with the new life awaiting at the end of your journey. With technology, the train station has largely been replaced in this role with the airport. Which is why it's such a damn shame that, with the exception of the now abandoned TWA terminal at JFK airport, airport architecture is so utterly anonymous and boring.

The builders of train stations through the 19th and 20th century understood the importance of what they were doing. You can't walk under the enormous, soaring arc of the roof of Paris' Gare de Lyon without feeling something. You may say that a train station requires an enormous roof - you need something to fit the trains under - but there's more to it than that. A train station does not require the main concourse of New York's Grand Central station. Humans required that grandeur for a building this significant to their lives.

And this is why I'm so disappointed in airports. Books aren't switching from train stations to airports because airports aren't inspiring or significant. They look like low, bland, corporate office blocks. Full of bland, inoffensive corporate colours, with plenty of practical reusable furniture and rooms. As train travel becomes less and less common, we're in danger of losing a whole raft of ideas and images. In 15 years time will a child reading Harry Potter who's never been inside a train station really understand the significance? Will that chapter grab them? Do children reading now understand this? Architecture is not just about building the most practical, useful building for the cheapest price. Architecture is about shaping our world, and thus our culture and experiences.

Harry Potter and the Deathly Hallows

Harry Potter and the Deathly Hallows
J.K. Rowling
Don't worry, there won't be any spoilers, or anything even remotely like a spoiler in this post. I'm not doing that to this book.

I liked this book, a lot. It would probably be my favourite of the series. The ending really nicely wraps up the story without leaving any major open holes. Everything that is supposed to happen, happens. Which, according to Rosencrantz & Guildensten Are Dead, is the definition of when a story is supposed to finish.

Two days before reading this book, I was talking to a friend at lunch about books. He was complaining that the ending of Neal Stephenson's Cryptonomicon doesn't live up to the rest of the book. I then made the extraordinary claim that no book I've ever read had an ending that could live up to whatever expectations had been built during the previous few hundred pages of the story.

And then this book comes along and makes a liar of me. Maybe my expectations were lowered by reading a kid's fantasy adventure; maybe it was exhaustion: finishing at 4.30am after reading continuously all day. I'm a slow reader, I know. Whatever it was, I thought the ending actually worked.

Many people choose to regard Harry Potter with some funny mix of amusement and contempt. You're probably missing the point. It's a fun, easy to read fantasy epic that doesn't take itself too seriously. There is a special skill in writing something that is both easy and enjoyable to read.

Tuesday 7 August 2007

Harry Potter 1-6

Harry Potter 1-6
J.K. Rowling

In preparation for the upcoming release of Harry Potter and the Deathly Hallows, I followed the fantasy fan grand tradition and re-read the entire series from the beginning. It took me about 10 days, including staying up til 4.00am on the Friday before the release of book seven, to finish them all. It was worth it in the end: I cared deeply about the characters and their fates; perfect for finding out how it all ended.

Some random thoughts from reading them a second time.
  • The Philosopher's Stone will always be a sentimental favourite. It has an innocence and magic that the other's can't match. The surprise of this enjoyable world can't be repeated.
  • The Prisoner of Azkaban is the strongest; The Chamber of Secrets is the weakest.
  • Ron is a lot less irritating on paper than he is in the movies.
  • The big action sequence at the end of The Order of the Phoenix is disappointing.
  • The Philosopher's Stone was a test book: will this sell? The Chamber of Secrets was 'Oh no, we're on to something get this out quick!' The Prisoner of Azkaban was introducing some new characters and casting around for the real story. The Goblet of Fire is where the story really started. The Order of the Phoenix and The Half-Blood Prince were middle books.
But no matter how I read them, and what different spin I read into them, I loved the story. And to be honest, it fits together a little too well for that final (cynical) analysis to be entirely accurate. All those of you planning on re-reading The Deathly Hallows but slower, I can recommend starting right from the beginning again, if you haven't already. You will get something out of it.

Monday 6 August 2007

Perl

I don't usually post entries that just refer to someone else's post and then comment, but I thought this one was worth it.
For the sake of comparison, people have been saying that Cobol has been dead for more than 20 years, but there are over 1000 Cobol jobs per month posted on Monster.com, and more than 5000 per month for Perl. - JT Smith, posted by chromatic on O'ReillyNet.

Everyone got that? Perl is doing absolutely fine as a language; there are still heaps of jobs going for COBOL programmers, and Perl has even more! Clearly this is the only measure of a language's health and therefore we should all kindly stop pointing and laughing.

Personally, I think this couldn't come sooner. A technology isn't really dead until people feel the need to loudly proclaim how not dead that technology is. People have been declaring the end of C++ since Java first arrived, but no one is defending C++ yet... more's the pity.

Oh, and I particularly love his analogy to COBOL programmers: smooth.

Sunday 5 August 2007

Against the Day

Against the Day
Thomas Pynchon

This was an absolutely massive brick of a book. 1,085 very dense pages. The longest sentence I remember encountering was a page in length. He's maintained his pattern of hard to read, but very rewarding, books. Though this is only the second Pynchon I've read, I will be going back for more, call me a masochist if you will.

Mathematicians are major characters; reasonably common in sci-fi, but most surprisingly the maths is depicted accurately.

Except... ideas of science are never considered in a rational vacuum. These ideas are always filtered through unbalanced, biased, imperfect humans. We attach extra value to these ideas; we invest in them, growing them beyond a purely rational consideration into something larger. Something that a person could start to believe in. Don't be distracted by false claims of inaccurate ascriptions of religiosity. It's not there. These both emerge from the same base. The linguists who analysed the unusual language of the Pirahã ended up spending sometime literally not speaking over a disagreement in interpretation of language constructs. This is more than science and rational discourse over ideas: this is belief.

No scientific proof is ever accepted from being derived from first principles. Russell showed that isn't actually possible. Well, Russell gave it a shot; his failure showed it wasn't possible then Gödel showed why.

This book is an historical fiction set around the turn of the 20th century: but if it was set now then it would be a near future sci-fi. Something in the line of Stephenson or Gibson where the possible effects of recent discoveries are explored. That's not what the book is really trying to explore however. It feels like a daydream in the end. After exploring many different forms of literatures, sciences, ideas and political battles through the pivotal period of the 20th century the story lazily surfaces into what feels like our world.

You're never quite sure where you've actually been.

Monday 30 July 2007

For London

Funeral Blues
W.H. Auden
Stop all the clocks, cut off the telephone,
Prevent the dog from barking with a juicy bone,
Silence the pianos and with muffled drum
Bring out the coffin, let the mourners come.


Let aeroplanes circle moaning overhead
Scribbling on the sky the message He Is Dead,
Put crêpe bows round the white necks of the public doves,
Let the traffic policemen wear black cotton gloves.


He was my North, my South, my East and West,
My working week and my Sunday rest,
My noon, my midnight, my talk, my song;
I thought that love would last for ever: I was wrong.


The stars are not wanted now: put out every one;
Pack up the moon and dismantle the sun;
Pour away the ocean and sweep up the wood.
For nothing now can ever come to any good.


We'll always love you Pundy.

Wednesday 20 June 2007

The Box Doesn't Exist

One word that always causes me to shudder: 'Content.' This is now apparently the standard word that people in the software industry use to refer to that which is created and owned by their users.

To me it's just the latest horrible, bland, meaningless MBA word. Except it's not. Like all words, 'content' implies something about that which it refers to: that it's irrelevant and doesn't matter, that anything would do in its place. Content is what you put in a box so that the box is no longer empty, it doesn't matter what it is, it's just there to fill the box.

Sure, as software people you're all very proud of your box. You've put a lot of effort into making your box very pretty, and emergent, and Web 2.0, and now you just need something to fill it up. When all you do is build boxes it's very easy to only see boxes.

Well, guess what? Your users don't even notice the box. That content that you regard as interchangeable filling is all they care about. That's what they've spent time, effort and emotion in creating. They don't want to just dump it in some box somewhere, they want it treated specially and with respect. Referring to it with some bland management-speak term is not showing respect.

Words matter. The words you use to refer to something shape your perception of it. If you're in the business of building something where users can display their creations you need to remember that those creative works are the entire purpose of your web site. So don't refer to it as 'content' and then focus on the box. Remember the box don't exist, and treat your user's works with respect.

Don't call it 'content.'

Ticket'd

Spotted out our window one cold winter night:


A drug bust? A shooting? International crime syndicate? Nah, just a P-plater getting a speeding ticket.

Wednesday 13 June 2007

Is Something Burning?

We suspect this singe:


On this cat:


Was caused by one of these lights:


Trendy though they may be, it seems that if you have a brain the size of a peanut and a love for heat, heat, glorious heat, halogen lights set at floor level are a little too attractive on a cold winter's morning.

If they hadn't attached themselves to humans cats would long since be extinct. Probably through some accidental fire.

Tuesday 29 May 2007

Where-house?

These were taken in January, after we picked up the keys but before our stuff had been moved in. By now I figure that those of you who can make it here to see our new home have, so these photos are for the rest of you.


The building is a converted warehouse from the late 1890's. Until (I think) 1994 it was used as a warehouse. For most of that time as the headquarters, offices and printing rooms of the Sunday Times, Sydney's third Sunday paper. From the 1840's to the 1890's there were smaller buildings on the site, and before that, the area was market gardens.


The envelope of the building (the external brick walls) is original, and a lot of the original materials have been reused in the reconstruction. There's an old wooden pillar by the front door, for example, and some of the floor joists are original, though the floors themselves have been moved. Moving the floors has given us the 6m ceiling I've mentioned before, and the bedrooms have been tucked into a mezzanine that hangs over and opens out into the living area. The black rectangle in the photo is one of those openings.


They don't mention the joys of living in a converted 1890's warehouse in the trendy New York novels: our wall leaks. That's right: wall. Ahh, well. I call it character.

Monday 28 May 2007

Embrace Your Inner Geek

Why bother reading long posts about esoteric language features that your language doesn't provide, or even if it does, it's not a good idea to use too often?

Two and a half reasons really.

Understanding your language is important. This is not magic we're doing here. It's engineering, one of the purest and most mathematically oriented branches of engineering you're likely to earn money engaged in. When it's magic you're not supposed to know what's going on, that's why it's magic. You are supposed to understand engineering though. Languages are the most complex pieces of computer software. You understand complex things by exploring the boundaries. What do they do well? Why don't some things work at all? How could they be better? All professional programmers should be able to name several critical failings of the language they are currently working in; if they don't hate it all together.

Related to that, when programming it's not enough to memorise the class and function names from the whopping great big framework of the week. You'll generally have inferred something about how the framework works underneath. You'll know that before calling function A, you had to instantiate class B first, unless you called function C first, because that happens to create a B for you. Blah. Languages are the same. Why does a variable declared inside a while loop disappear outside? This isn't voodoo. The goblins don't eat it. There's a reason. The language is implemented in a certain way by the compiler and runtime combination that causes these things to happen. You should understand that relationship. Every thing we write is built on some similar layer of abstraction. You need to understand (at least theoretically) how to implement the layer immediately beneath you or you'll end up wandering off into some abyss you didn't even know was there.

And finally, we're professionals, dammit. Where's the intellectual curiosity? Where's the 'Hey, that's cool. Now, how do I break it?' Or, 'I wonder what will happen if I do this...' Or, 'How does that work?' And most basically of all, 'Why?' Geeks are supposed to be into that sort of thing. We got beaten up in high school because we were enthusiastic about things it wasn't cool to be enthusiastic about. Now there's a lot of money to be had out of that enthusiasm. Let it out, embrace your inner geek. Enjoy this amazing, complex, unique, ever-changing world around us. Explore those things you've always felt a connection to. If you're in computing, there's a good chance that's something mathematical. Most things in computing are... For me it was languages. What's it for you?

Oh, and last week at the pub we had a big discussion about category theory, higher-order functions, contination passing web servers and finishing up with the difference between a program that generates a program and writing a custom compiler and interpreter. Geeky you may say. Well, today I noticed a colleague reading up on continuations on Wikipedia. That's what I'm talking about.

Sunday 27 May 2007

The Sandman, Vol. 1: Preludes & Nocturnes

The Sandman, Vol. 1: Preludes & Nocturnes
Neil Gaiman

Is that how you credit authorship of comics? I don't quite know. There are artists involved, and I'll leave it at that for now. But yes, that means I'm reading comics now.

I've never been a comics reader. Sure I read some comics as a kid. Asterix and Obelix and Footrot Flats were both pretty important to me. I'm pretty sure I've read them all. I also read the occasional Tintin, and there was one dark single issue comic Where the Wind Blows that I discovered in high school that was pretty damn good. But I never read seriously the Marvel and DC comics involving Spiderman, Batman, etc, etc.

Sure I'd get hold of a comic here and there. But it would usually be issue 23 out of 148, then several months later I would read 92, then 5, then the grand finale. Overall, the story didn't make a whole lot of sense...

I have always been a big fantasy reader, and for the last five years of so I'd been hearing a lot about Neil Gaiman. Very popular, very well regarded. But when I looked into him I found he'd only written a couple of novels and a collection of short stories. Strange. It usually takes a long line of novels and an epic series or two to build this kind of cult following. Looking closer he was always credited as 'gaining his following through the cult 1990's comic series The Sandman.' Interesting...

After talking to friends, reading blogs and then reading Pynchon's Gravity's Rainbow, my interest in comics, especially the more modern darker ones was lifted. For example, I thought the V for Vendetta movie was pretty damn good, and apparently the comic was significantly better.

So, on finding Kings Comics on Pitt St, here in Sydney I decided to start with The Sandman. This is the first volume and so far I'm impressed enough to go back for the next. It's a dark, kind of gothic horror fantasy story. I can't review this as any sort of expert comic reader, but I enjoyed the stories and the artwork. Most importantly for me, the character of the Sandman was one that interested me. He is not clear cut. Not a hero, not a villain and not always someone you appear able to trust.

For me so far, comics are looking good. I want to read more Sandman, V for Vendetta, and as Damana also bought volume one of The League of Extraordinary Gentleman, I'll be checking that out as well. Any other recommendations?

Stupid Software Tricks

Or, My Computer Was Possessed!

Last night I was following some blogs, and I found a link to a kind of rubbish photo sharing site. I won't mention the name here, for reasons that shall become clear. It's been around for a few years and has gone through some major rounds of publicity and then failed. It's now into it's third beta in a row. In short, going nowhere real fast.

Anyway, I was curious about their site, so I went to read their news page. When I'm using a computer I tend to leave what I was last doing open on screen. On coming back I can then pick up where I left off. There's always a browser open, usually with four or five tabs I want to read.

I open the photo sharing news page in a tab and then wander off. Our apartment is a loft-style space in a converted 1890's warehouse. The entire apartment is basically open-plan with the upstairs bedrooms opening out near the six metre ceiling of the living room. My computer is in a study that opens into the living room, downstairs.

At 4am this morning the entire apartment was awakened by the these bizarre screams, crazy distortion and static. What the hell is going on? Is this something from the pub next door? Have our neighbours turned some movie on? Has one of our cats stood on the TV remote again?

I stuck my head out into the living room to try to work out where the noise was coming from. The weirdest thing was that I couldn't understand the noise. I could hear voices that seemed to speaking English, and I could pick out words, but I could not understand what was actually being said.

Coming downstairs to investigate closer, the noise was coming from my computer. And it really was strange screams, distortion and static. Being closer made it no better. I started closing tabs in Firefox, as that was all that was open. Eventually I closed the photo sharing news page and it shut up.

I've never seen anything like it. The news page had a bunch of embedded videos from all over the web, and it was like Firefox and Flash had buffered the videos, and then after several hours of boredom started to explore what interesting sounds could be made by sampling and looping the soundtracks.

Spooky.

And with apologies to Yasmin, who was visiting us this weekend and was very rudely awakened.

And I haven't linked to the site because they really don't deserve even the feeble publicity a link here would grant. I found them through the Blagosphere, and I don't post vias.

Wednesday 23 May 2007

A Conspiracy

I don't believe in the Internet. It's a conspiracy of network engineers... with a lot of pigeons.

Friday 18 May 2007

Continuing on Closures

This is the (long awaited) second part of my tutorial on closures. This part describes how your language's runtime might provide closures. I've assumed that you understand what a closure is, if not, read the first part of this tutorial first.

So by now we know that we can think of a closure as an object: an instance of an automatically generated class. This class has just one method: apply() that executes the body of the closure. The class has one member variable for each variable in the active scope at the time the closure object was constructed.

But local variables are only available to the function that defines them and even then only for the lifetime of that particular function call. How then is it possible for a closure to access these values? To explain that I'm going to briefly go over how functions work, bear with me if this all seems a bit basic.

Sometime back in the 1950's, during the design of ALGOL the concept of the call stack and stack frames were discovered. The call stack is just a list of called functions, implemented as a stack so that as functions return they can be popped off the call stack, leaving the calling function on top. A stack frame is the object that is pushed onto the stack to describe a function. A stack frame contains the line of code to return to when the function returns, the parameters to the functions and the local variables of the function.

Every invocation of a function causes a new stack frame to be created and pushed onto the call stack. Among other things, this makes recursion possible. Early versions of FORTRAN don't support recursion: no call stack.

Your program executes; functions are called; stack frames are constructed; values are calculated; frames are updated; and return values are returned. But every time a function returns its stack frame is destroyed, and the very next function called will completely overwrite the memory where the last stack frame was. So how can a closure always be guaranteed to still be able to access a local variable?

Earlier I referred to a stack frame as an object. In languages like C and Java a stack frame is not an object at all; it's just some conventions for how certain pieces of data are stored. All of which are calculated and laid out ahead of time by the compiler.

But what if the stack frame was an actual object stored with other objects on the heap? What if, instead of a stack, a linked list was used to connect the frames? Hmmm... interesting... The linked list would represent the call stack. Every new stack frame would be constructed with a pointer to the frame of the current function. Like all other objects, these frame objects would be subject to the garbage collector. This prevents a frame from being destroyed until it, and all functions it called, have returned.

Once the runtime provides this implementation of frames and the 'call stack,' a closure can include a pointer to the current frame. When the closure needs access to anything in its containing scope it can now just use this pointer. And as the frame contains a pointer to its calling function, the closure can now work its way back through any scopes it's interested in.

Extra Credit: The ability to work backwards through the scopes of all the functions in the call stack is known as dynamic scope. It's pretty uncommon now, as it's virtually impossible for a human to understand in any kind of complex program. As a result languages that support closures generally provide lexical scoping. In lexical scope the structuring of the program text defines the scopes available to a function; and therefore a closure can only use the local variables of the frame immediately referred to by the closure. But enough on scoping; for more compare early versions of Lisp to Scheme.
Frames as a linked list would not make any difference to your program as the act of reading the data stored in a frame is still hidden by the compiler and runtime.

And that's really all there is to it. Closures can now access local variables that seemed to only exist at the time the function was defined. The reference by a closure to a frame behaves like any other reference: the frame will not be destroyed until the closure is destroyed.

Hmmm... didn't I mention earlier that a frame also contains a line of code to return to? Doesn't that mean that any frame can be safely returned from? Yes, it does. Now, if we move our current line variable into the frame itself we have what's called a continuation. That is, a single frame object describes the current values of all local variables for a function, the next line of code to execute in the function and which function to return to. And that function in turn also has all the same information preserved.

If the language then allowed it, you could pick up that underlying frame object, store it away somewhere and then use it to later on continue execution where it was previously left off. Hence the name: continuation. To pull this off the language needs to provide two features.

Firstly, the ability to get a reference to the frame object for the currently executing function, at the same time halting execution. Secondly, the ability to call that frame object at some later point and have execution pick up exactly where it left off, as if there was no pause.

Continuations as a concept are regarded as 'difficult.' As a result, even though most languages that provide closures could also provide continuations the programmer is not given direct control over them. Some languages do provide this control: Scheme (noticing a patten here?), Ruby and Smalltalk, amongst others.

So what are these good for? Before getting into an example of how continuations can be used, I want to say one thing: powerful language features are always useful. If you're not used to having a feature in a language, the first time someone shows it to you the immediate reaction will be: 'Sounds cool; but what use is something like that?' A fairly normal reaction and simply the result of not having the feature available. Once you've used a language with an 'advanced' feature you'll find all sorts of uses, until eventually you won't be able to imagine coding without it.

Anyway, onto an example. When writing web applications a big problem is the enormous gap between the page displayed in the user's browser and where the server thinks the user is up to. Continuations can make this almost completely disappear. Once the application on the server has prepared a page, instead of winding up the call stack and then returning the page to the user a continuation could be captured. This continuation is stored on the server and a key is sent to the browser to be returned with the other data on the page. Using the key, the continuation is invoked, and execution of the function picks up where it left off.

The code running on the server to handle screens in the application could then look something like the below. The statement yield causes the continuation capturing to occur. And remember, all of this code executes on the server, there is no AJAX or anything like that.
function checkout()
{
  // The following three functions add UI elements to the
  // current page. These are rendered as HTML. 
  displayCartContents();
  addButton(new NextButton());
  addButton(new PrevButton());

  yield; // Continuation is captured, and the page so far
         // is sent down to the user

  // The user has sent a response back to the server
  // The functions payment() and home are similar to
  // this function: they create specific pages.
  if (Page.SelectedButton == Button::NextId)
    payment(); // Display a page to collect payment
  else
    home(); // The user wants to continue shopping
}

As well as this simple server side logic, the user can then explore multiple paths through the application concurrently, with multiple windows and using the 'Back' button with abandon. You, as a programmer and a program, will never become confused. Pretty nice, huh? There is a web server already out there that gives you this: seaside.st

And any language can make these powerful features available simply by implementing the call stack as a garbage-collected, linked list of simple frame objects, instead of a one-dimensional stack of data. Pretty powerful, and remarkably simple. Makes you wonder what other abstractions are lurking behind small implementation decisions.

Monday 14 May 2007

Worst Example...Evar!

Way back in my first year of university, as part of a first year discrete maths unit we were taught introductory formal logic. After introducing propositional logic and covering ANDs, ORs and truth tables, we moved on to implications. For this particular lecture we had a fill-in lecturer. I can't remember why.

In explaining implication to us this lecturer used an example that has stuck with me ever since. This isn't because it was one of those glorious examples that are like a light being turned on; suddenly it is all clear and new vistas of understanding open up. Oh no, this example was the other kind.

One of those examples that distracts with its own internal errors and inconsistencies; that steers you in completely the wrong direction; and, best of all, pollutes your mind enough that you may never understand the original point.

The bad example:
An implication would be when your mother says to you: 'If you clean your room, then you can go to the movies.' So after you clean your room, your mother lets you go to the movies and the statement is true. But if you don't clean your room and go to the movies anyway, the statement is also true.

Huh?

Logically, yes, that's correct. Single implication works like that. But the world doesn't, and it's pretty hard to ignore that little detail.

Bonus points if you can work out who the lecturer was.

Thursday 19 April 2007

Peopleware

Peopleware; Productive Projects and Teams
Tom DeMarco & Timothy Lister
Note: This review is of a software development book, not a work of fiction. The book that is; the book's not a work of fiction. Neither is the review, I hope.

I've heard about this book very often from Joel, of JoelOnSoftware.com. He recommends it very highly, in fact one of his recommendations is on the back. This is also one of the first 'software development process' books that I've ever managed to read cover-to-cover, all the way through, and in only a day and a half. Usually these sorts of books are very dry, kind of suck and end up just annoying me.

This book is different, however.

Essentially, Peopleware is saying that any attempt to project manage software development is doomed to (painful) failure if it focuses on issues like technology or process and policy. The point is that like most things humans do, the problems are usually sociological. It's all a matter of getting different people to work together - understanding how they think and what is important to them at a very personal level is how you achieve this.

Joel makes a big deal of how important the office environment, particularly a quiet space with a door that shuts, is to any software developer. This book really makes that very clear. All 'knowledge' workers need some level of quiet and privacy, or there really is no point in having them around. The book took the discussion further and points the reader off towards Christopher Alexander, as the entire environment from the building down to the angle of the desk matters.

As an aside, if you haven't heard of Christopher Alexander, then go read about him. He has nothing to do with software development. He's a real architect. Not one of those pretentious software ones. Anyone who ever lives or works in a building should have some idea of what Alexander is on about.

I can't overstate this, if you currently manage software development; would like to some day manage software development; or are a software developer being managed, you really should read this book.

And the thing is, if you aren't in software development but can ignore the references while reading this book, you'll find it useful. The principles apply to any job where the workers are required to think independently to get anything useful done. If you think while working, this book is for you.

Tuesday 10 April 2007

The Power and the Glory

The Power and the Glory
Graham Greene

Reviewing this book really seems a bit ridiculous. Who the hell am I to review this? If you haven't read it, go, go now. It's only 220 pages, won't take you a minute... Don't worry, I'll wait for you.

It also didn't occur to me that I was reading a 'Catholic book' over Easter weekend until I was nearly finished.

This isn't a book about the Catholic sacraments, or about religion or faith. It isn't even about persecution and martyrdom. The value and effect of all those is well understood. This is about something deeper: the moral ambivalence and ambiguities at the heart of everyone. All these characters fit together and draw so much from those around them - misinterpreting each others actions, intentions and clinging to the the symbolism of another person. Their individual actions are small. The overall result may be large, but often it isn't. In the end though, it doesn't matter. Labels are attached, conclusions are drawn, meaning is derived, and the world moves on.

Sunday 8 April 2007

Mandarin

Some places and people really ain't worth remembering, but hey! At least I got some cool time lapse photos out of it...


Kind of a symbolic progression, actually.

Saturday 7 April 2007

A Fire Upon the Deep

A Fire Upon the Deep
Vernor Vinge

This book was recommended to me about four years ago by a colleague at SoftLaw. It took me about that long to find it. If you're in Sydney, I can highly recommend the Galaxy bookstore on York St - thanks for putting me onto them, Jen!

The underlying premise interested me enough to keep an eye out for this book for four years. The galaxy is divided into zones. As you move up through the zones more advanced thought and science becomes available. From the Unthinking Depths, where rational thought is barely possible, through the Slow Zone, where there is no faster-than-light travel, to the Beyond, with faster-than-light travel and advanced artificial intelligence. To me this is still an interesting and novel view of the Universe. It provides both an extrinsic motivation common across individuals and species - to move up to a more glorious life that can't even be expressed at your current level - and also a danger and a fear. There is nothing worse than falling into a lower zone. Sounds religious doesn't it? And that is alluded to, although it would have been good to see that developed some more.

The rich potential of this premise left the book as a whole slightly disappointing.

Overall, the story is a quest. Which is another point in favour of my 'Sci-Fi is fantasy set in the future' hypothesis... A quest story is really a journey to the depths of the soul for all the major protagonists. For some of the characters in the story, this was handled very well. For others though you just didn't get the feeling of plumbing depths from which they could never return.

And so, just like Thomas Pynchon's 'Gravity's Rainbow' ruined David Mitchell's 'Cloud Atlas' for me, so was 'A Fire Upon the Deep' ruined by Iain M. Banks' 'The Algebraist.'

To first world citizens, the world is no longer a huge and almost infinite place. Stories where a significant part of the dramatic weight to the quest is the enormous distance that must be travelled to cross a country no longer ring true. We can now fly to the other side of the world in less than 24 hours and for less than $3,000. The other side of the world no longer feels like an vast distance from where we started. But we are starting to stare up into the night sky and imagine just how far those other points of light are. Distances such that after 30 years a satellite has only just left our solar system.

Treks across this almost infinite emptyness are the things that amaze and scare us now. And unfortunately that was exactly the feeling 'A Fire Upon the Deep' failed to capture.

Don't get me wrong, it is a great Sci-Fi story, and the premise is very interesting. It just could have been so much more. Hence, the feeling of disappointment. If you're into Sci-Fi though, I would recommend it.