In some ways a toddler is easier to care for than a baby. In other ways it’s a lot more complicated. On the one hand, a baby’s needs are simpler, but on the other hand, a toddler can tell you much more clearly what she wants or needs, and a toddler can actually take responsibility for their needs to a surprisingly large extent.

Sleep is a case in point. Ingrid was a lousy sleeper for a long time. It was really hard for her to fall asleep, and it took a long while for her to understand that falling asleep is not a terrible thing to be avoided at all costs. Now she knows that sleep is good, and actually wants to go to sleep. When she starts looking tired, I ask her if she wants to sleep. Often she says yes and runs towards the bedroom, waiting for me to follow. If she says no, I try again 5 minutes later, and again, until she says yes. She always does, after a while. I think there was one evening when we came home really late and she was really cranky and was saying no to everything, so I carried her to the bedroom despite her NOs, but once there, she was happy to go to bed.

Food has always been simple with Ingrid. I’ve never had to worry much about her eating habits or weight gain. She’s been happy to breastfeed and happy to eat, and especially happy to feed herself. There was a period when I thought she ate too little, but I could see that she still had more energy than she needed, so obviously she got enough food somehow. And then I read that 50% of parents think so about their toddlers, so I stopped worrying. (I still don’t understand how she can get by with so little food, though!) In any case she now eats without any fuss, and eats a reasonably varied diet, too.

The one thing I’m struggling slightly with is potty training. From what I’ve heard and read, she seems old enough for potty, but we’ve had very little success. We tried in May to let her go without a nappy. She peed on the floor lots of times and was very distressed every time it happened, so we gave up. We tried again in June, and while she was still peeing on the floor all the time and not much on the potty, she was no longer unhappy about it. We tried again in July, and still most of it ended up on the floor. She never says when she needs to go. When I suggest that she should sit on the potty, she generally refuses, or sits for a while and then runs away, and then pees on the floor two minutes later. (Luckily she points out where the puddle is when I ask her, after I notice that she’s all wet.) It is getting a bit tiresome to dry up all these puddles. I don’t know whether there’s any point continuing or whether we should take a break, go back to nappies, and try again in a month’s time.

I like working with good tools. Work is more fun when I feel that the tools I have make work go faster and more smoothly, and give better results. It’s important to me that the kitchen knives I use have a good edge, that the chopping board is solid, that my pruners are sharp and the cleaning cloths are absorbent. I do not understand how people can make do with dull knives and cheap plastic chopping boards.

Likewise I like to work with good software. I need good software. I don’t understand how people can stand having Notepad as their text editor, not because they are uninformed and believe that Notepad is all there is, but because they can’t be bothered.

My two latest favourites are Selenium and SourceMonitor.

Selenium is a tool for testing web applications. Very easy to get started with, powerful, and flexible.

It’s got a “recording” module which records your actions in Firefox – what pages you open, what links you click, what text you type – and also lets you easily specify test conditions such as “verify that, after I’ve clicked all these things, this particular text is present on the page. You can save the tests in html format, and the file structure is so simple that anyone can edit and extend the tests. But you can also export the tests in your favourite programming language, or, if you prefer, write the tests from scratch in that language.

I used the Firefox addon to record the first tests and exported them to C#, and then went on writing the rest of the tests directly in C#. The whole process was very straightforward. We now have about 45 automated tests for core high-level functionality.

Plus, it’s free!

SourceMonitor is a tool for estimating code complexity. It is also free.

I’m very aware that our code needs refactoring, because large parts of it are so complex that they are effectively unmaintainable. But because everything needs refactoring, and I’m still not familiar with all of the code (because it is so hard to read), I don’t know where to start.

SourceMonitor has been very helpful for finding the hot spots, for prioritising the files and methods that are in most urgent need of cleanup. It quickly shows which files and methods are largest or seem most complex. It can sort them by size, complexity, levels of nesting, number of calls out to other methods, etc. This can be done for the project as a whole, or for a particular file. SourceMonitor also saves the results of each analysis run, so you can see how things change over time. I like seeing measurable progress, so this feature really appeals to me. There is something immensely satisfying in knowing that I have just reduced the size of our code base by 400 lines and at the same time made it better.

Before choosing SourceMonitor I also looked at FxCop and NDepend, but both were too complex for our current needs, and did too much. We’re nowhere near the level of control that these two applications provide, such as enforcing naming rules. I expect that I’ll try them again in half a year’s time. I might have chosen NDepend anyway, because the demos look so slick, but it costs money, and given how little of its functionality we will use for now, I would find it hard to justify the cost.

FxCop is free just like SourceMonitor, and I did try it out, but it was not particularly easy to get started with. The main hurdle was that FxCop needs compiled assemblies to work with, which makes it very difficult to use with ASP.NET web sites. SourceMonitor analyzes source code instead. I also found SourceMonitor’s sparse interface much more comfortable on the eyes and the brain than FxCop’s flood of messages.

It may seem a million miles away
But it gets a little closer everyday

1.

The code base I work with is large, amorphous, and ugly. By now I’ve cleaned out the obvious junk (unused variables and methods, commented-out code, files that weren’t used). But the rest is still in a bad state. There are 3000-line classes and 500-line methods, and lots of copy-paste code.

Ugly code makes me feel uncomfortable, anxious, tense. It’s like an itch, or an unpleasant noise. I have clean it up because I couldn’t stand the knowledge that I’d have to look at this every day for months, or years.

Cleaning it up on the other hand gives me such a feeling of relief. Refactoring is a pleasure. I refactor when I am bored. I take a break not by eating ice cream, or going for a long lunch, or going out shopping, but by setting aside my main coding tasks and refactoring instead.

2.

The house and garden are a never-ending project. There is so much to do and so little time to do it. Even though I normally get home shortly after 6, I don’t get a chance to do much around the house until after Ingrid goes to sleep, which often happens as late as 8:30 or 9.

So I try take small steps in the right direction: half an hour here, half an hour there. It took 3 sessions to clean out all the dead branches from the lilac hedge. Every few days I spend 15 or 20 minutes exterminating cherry seedlings and the remains of sloppily cut-down cherry shoots. (They are all over the lawn – everywhere I go, I’m stepping on sharp stubs.) Every weekend we try to buy at least one of the things we’re missing: one day it’s a new saucepan, the next maybe some shelving.


I’m OK with these projects taking a long time, as long as there is progress, as long as every day makes things just slightly better.

One day, the stars disappear. It turns out that a barrier has been set up between the Earth and the rest of the universe. Research later shows that the barrier is a time discontinuity: outside it, time passes millions of times faster. Satellites sent out through the barrier seem to return within seconds, yet have weeks’ worth of data with them. But somehow there are still 24-hour days with sunshine.

It doesn’t take people long to figure out that given the size of the time differential, the Sun will soon have changed so much that the Earth would be completely uninhabitable if the barrier disappeared. An entire generation of people grows up having never seen the stars, and knowing that they might well be the last generation ever. Some go on with their lives, but as time passes, more and more of them live out their desperation and hopelessness.

Three kids happen to be out stargazing when the barrier appears. The rest of the story revolves around the three of them as they grow up. One becomes a scientist, obsessed with understanding the Spin, as the barrier is called. Another gets sucked into the various apocalyptic sects that are born out of this event. The third one observes life from the outside, never quite getting involved himself.

The SF part of the book is impressively well thought-out: all the various implications and possible effects of a time barrier are explored, everything is consistent and makes sense. Even the final explanation (yes, there is one) actually makes sense. Lots of logical but innovative side ideas are presented almost off-hand. A lesser writer using one idea per book could have built his whole career on the ideas in this book.

At the same time this is not just an idea book (as SF books can sometimes be). The human angle is all there, too. The characters are well-rounded and believable, their relationships dynamic and interesting. Humankind’s feeling of being doomed and having no future is subtly all-pervasive.

And to top it all off, the story is well told. The pacing is good, the language is smooth, and the classical flashback structure is really skilfully used. I actually want to know how the characters can get from the flashback time to the present time, and the chapters taking place in present time gradually make more and more sense as the past catches up with the present.

The end result is an intelligent and enjoyable book. Really really good.

Amazon UK, Amazon US.

Ingrid’s hair smells like wool. When it’s wet, it smells a bit like a wet poodle. Clean, but faintly animal-like, and very very pleasant.

Initially we fell into the usual “must have lots of lotions and products” trap and bought a baby shampoo / bath lotion. It made her skin dry and red so we stopped, and had a lot of trouble getting her skin back to normal again. Now I wash her with just water, and use soap on hands and feet only when they are really dirty or greasy.

I wish I could do the same with my own hair. Apparently some people can get by with just conditioner, no shampoo. (Google for “conditioner only” if you’re interested.) I tried that for a while, but my hair never felt really clean, so now I’m back to using shampoo again, but the mildest one I could find.

The book thief is Liesel, a young German girl who is sent to live with her foster parents during WW2. There are bombings and book burnings, a Jew hidden in a basement, and Jews in a concentration camp. There are also childhood games and stories and accordion music.

The story is narrated by Death. Death has a penchant for ominous flash-forwards, and for printing short fact-filled asides in bold type, and for comparing everything to colours.

As you can see, I found Death an annoying addition to the story (at least as a narrator – I admit that where he actively participated in the story, he was necessary for the story).

The rest of the story was interesting and moving, and often went off in an unexpected direction. There are believable characters, touching scenes, and lots of emotion. But I found the Death angle annoyingly contrived, and Zusak’s handling of the English language pretentious and clumsy.

A more detailed review that says what I would say if I had time.

Amazon UK, Amazon US

The decline that started in early July has continued and reached an absolute minimum (from my point of view). This afternoon I was the only person in the office. It felt very empty. If I’m lucky, someone will come back from vacation next week. But just in case, I think I will bring a radio to work, to give me something to listen to apart from the quiet clatter of the keyboard.

The most memorable change for Ingrid this month was the advent of two-word sentences. Now she often says things like “Ije baga” (Ingrid magama = Ingrid sleep), “toga pall” (stor pall = big ball), “atta ommo” (vattna blommor = water the flowers), “emme itta” (emme sitta = mummy sit) and so on. Sometimes when I say a longer sentence (“The boy is playing with a big ball”) she tries to repeat it by makes several shorter ones out of it: “boy play” plus “boy ball” plus “big ball”.

She also uses language in more varied ways now. She can point out things, and describe things, and ask for things – but she can also make suggestions, which are clearly less determined in tone than pure requests (“Ije?” while pointing at Eric’s sunglasses, meaning “could I play with those?”) and ask questions (“onu?” while pointing at a newspaper means “are there any pictures of people in there?”). (We’ve been focusing on people words such as “man” and “woman” and “boy” and “girl” recently.)

I’ve noticed is that she is more adept at listening, too. What I mean is that she notices which words are important to the speaker, which words are said with extra stress or attention or emotion. The one time one of us said a (very mild) swear word (“jäkla sniglar” = “darn snails”) she immediately picked up on the “jäkla” and repeated it many times with great glee.

Her pronounciation is a lot clearer (most notably P and K are now separate sounds, so a tree is no longer called a moon) but as you can see from the examples, her language is still very much in a state where only a parent would understand her. We generally understand most of what she says now, even though we sometimes struggle when she freely mixes Swedish and Estonian in a single sentence. Generally she knows the names of the most important things in both languages, but for other things she often only has one of the words. Sometimes, though, I suspect that she switches to a language of her own, because suddenly she says something long and fluent but completely incomprehensible.

A few weeks ago I wrote that ise (= myself) was a much-used word. And it still is, because she likes to try to do things on her own. She’s getting better at it, too: just this evening she managed to get both legs into her pajama bottoms, and her attempts to wipe up spilled food from the table now actually make the table slightly cleaner.

But the world is now less black and white: it’s not a choice between “mummy do” and “Ingrid do”. She has now added the word koos (= together) to her vocabulary and uses it when she wants us to do something together, such as sit in the sofa and read a book. Likewise she’s understood that sometimes ise is not best, and it is good to have some help, so she says aita (= help).

And of course, whatever we do, she wants to join or copy. Mummy takes a handbag when she goes out? Ingrid takes her bag, too. (The bag is one of her few important possessions right now.) Daddy climbs a ladder to pick cherries? Ingrid wants to stand on a ladder and pick cherries, too. I generally try to accommodate her as much as possible in these situations. When Eric is on a ladder picking cherries, the option of doing nothing does not exist: she would climb up after him. I could take her away so she cannot see that he’s climbing. But if I’m going to be busy keeping her out of his way, I might as well do it so that she is a part of the action: bring out the small stepladder and find a low-hanging branch that she can eat from.

In fact the surest way to make her angry is for one of us to do something that she can see, and finds interesting, but isn’t allowed to copy. And of course it must seem terribly unfair. The other sure way to anger her is to ignore her: to sit in the sofa and try to read, and tell her to play on her own. For everyone’s peace of mind we try to avoid both, if possible.

Of course it isn’t always possible. When I’m eating dinner, I’m not going to stop just because she wants to play with me. And then she gets angry. Being upset and crying is nothing new of course, but now she displays proper anger and sometimes starts hitting and throwing things. She has no other way to diffuse her anger, I guess. Sometimes she sits down on the ground and picks up whatever is closest and throws it, and then goes after it and throws it again, and again. It’s kind of funny when that thing is a small piece of crumpled-up paper… Less funny when she’s sitting at the kitchen table and we see she’s about to get angry, and the closest thing is a glass of water. (The glass gets quickly moved out of range.) But the violent anger dissipates quickly, and she calms down enough to come to us for a cuddle of consolation.

When she isn’t joining in our activities, we’re often out doing something active. We go to playgrounds (climbing, swinging, splashing in a pool), or kick a big beach ball around the garden, or simply run up and down the lawn. All of these are quite social activities: she quickly loses interest in the ball if I’m not there to kick it with her (and when my attention wanders she reminds me that it’s my turn now), and running is a lot more fun when she can hold my hand.

A relatively new favourite is spinning around in circles. Ideally she’d hold my hand and then we’d both spin until she is so dizzy she falls over. Unfortunately I feel nauseous well before we get to that point. I generally try to convince her to run around me while I sit on the ground and hold her hand.

Books are still popular. She’s now getting interested in actual stories, not just pointing out things that she sees. Some of the baby books are going out of favour, while others that she had ignored are now suddenly interesting, because they have a story. And she listens attentively to the bedtime stories I tell her. I’m planning to do some major book shopping when I go to Estonia later this summer.

Drawing is another nice indoor activity. She used to enjoy scribbling with crayons, but now she prefers to watch me draw, and then either guess what I’m drawing, or suggest things for me to draw. Her own scribbling used to be forceful but artless, focusing mostly on making as big a mark on the paper as possible. Now I think she has once or twice tried to actually draw something. At least she once drew a brown line and then a green one, and said “puu” (= tree), moments after I had drawn a tree for her with the same crayons.

Here’s what they look like:

And here’s what Ingrid looks like after eating them:

More pictures

Yesterday and the day before were the two most boring days of coding I have ever experienced. I hope I never have to do anything like this again…

We’re reviewing our database access code and decided to switch from executing plain SQL statements and stored procs, to using parameterised queries. In practice this meant replacing a method that built SQL statements as strings, with one that created SQL commands, and replacing all calls to the previous method with calls to the new one.

Because the new method returns a different data type, we couldn’t automate this. Each method call had to be changed manually.

Unfortunately the various previous developers did not believe in having a separate data access layer, so there is data access code everywhere. And I mean literally everywhere: every single aspx file has at least one, and often up to 10 database calls.

This led to a sum total of exactly 879 method calls that had to be changed. Manually. One by one. It took me most of Thursday and half of Friday to slog through them all. That’s more than 80 method calls per hour, or one every 45 seconds.

The only good thing about this (apart from making the application more secure) is that we are now even more convinced that we need to refactor this beast into a more manageable shape, and sooner rather than later.