(Ln(x))3

The everyday blog of Richard Bartle.

RSS feeds: v0.91; v1.0 (RDF); v2.0; Atom.

Previous entry. Next entry.


3:03pm on Thursday, 24th July, 2014:

Coding for Fun

Anecdote

I'm writing a book over the summer. Well, I've been writing it for some time, but I'm putting it together over the summer. It's made up of about 1,400 articles from a paragraph to a page in length. Some of these articles need to come after others, but some can go anywhere. I added the dependencies when I wrote the book, with the idea that I'd maybe print the articles off (with their dependents and dependencies attached) and then order them on the floor. I was not expecting to end up with 1,400 articles, though.

I considered putting together a spreadsheet to create a partial ordering of the articles, but that seemed like a lot of work. I'd have to go through 1,400 articles manually and check that dependent/dependency relationships were bidirectional, then figure out some way to look for circularities (where one article had to follow another, and another, and so on back to the original article). In the end, though, I decided to write a program to do it. I went with C, because I figured I'd have to deal with Microsoft's unnecessarily complex format for Word documents, although in the end I didn't bother as it looked even more tedious to implement than constructing the spreadsheet would have been.

It's great writing programs for myself! I can hack as much as I like. I can call my variables what I want to call them, comment nothing, forget about memory management, use fixed-length arrays for variable-length quantities, take as many shortcuts as I like. I found lots of inconsistent dependent/dependency connections, but surprisingly there were only four circularities.

Now I'm at the stage where I can actually create the output I want (the partial ordering of articles). That shouldn't take long, but I'm reluctant to do it because then I'll have to get back to working on the book again instead of enjoying myself coding.




Latest entries.

Archived entries.

About this blog.

Copyright © 2014 Richard Bartle (richard@mud.co.uk).