Tuesday, April 26, 2005

Review : A Song for Arbonne

Recently finished A Song for Arbonne. It had been a while since I'd read a good fantasy novel, so this was actually a treat. Also, I've been quite impressed with Guy Gavriel Kay as an author -- he's one of the fantasy authors that I've heard rumored before as being a decent writer, but that I hadn't given the time to yet. I'm glad I did, and it won't be the last I read of him.

I'm not too keen on book reviews that recount the storyline. Since I'm blogging more about writing than reading, I'm gonna dig into what I learned from the book rather than details of what happens. If you want to know what the book's about, well, go read it.

The book was recommended to me on the basis of how Kay weaves in the back-story into what's happening in the present day. After reading it, I have to agree that he does it very effectively. It's amazing how little actual page-count is needed to build up a whole history in the reader's mind if it's done well.

Some points to remember about backstory:

  • If the backstory doesn't have direct impact on the present story, why are you telling it? This isn't to say that background doesn't have a place, but if you can't explain how the information is necessary it probably isn't.
  • Less is more. Probably one of the best effects in Song for Arbonne from the backstory is the desire to know more about it. The bits we receive are tantalizing, and rather than dolling out the history in big chunks he builds it up a bit at a time, sucking the reader along the whole way.
  • Emotion is key to engaging backstory... just like any other story. The backstory in Arbonne is charged with all sorts of different emotions -- love, desire, hatred. The intensity of the characters' past is part of what makes it interesting.

Monday, April 25, 2005

Interesting happenings

Had two things happen over the weekend that kind of struck me odd -- the kind of little tidbit that I'd love to work into a story somewhere. Nothing earth-shattering, interesting.

We were at a restaurant having brunch on Sunday. The room's full of chatter, people enjoying themselves, their food and/or waiting for their food. Suddenly, the power went out. Tall windows let in quite a bit of light from outside, but all conversation immediately stopped for at least ten seconds. It was kind of eerie in that interval while everyone sorted out what was going on. Then a waiter called out to the room in a loud voice for everyone to carry on, and that was that. Conversation resumed.

Second occurance was actually this morning as I drove to work. Paused waiting for a light on the St. Johns bridge, I noticed that the car ahead of me was shaking slightly. This isn't odd for the bridge, but on closer inspection the guy in the driver's seat was doing a drum-solo like crazy. He would do this while the car was stopped, then pull forward when traffic moved and resume the drumming.

Saturday, April 16, 2005

Cutting your favorite scene

I don't think I ever gave much credence to it, but I've definitely read before in multiple places that sometimes you have to cut your favorite description, line or scene from your book. I've even heard it stated that you ought to cut your favorites. Never really understood that until now.

Dreams of a Shaper has four parts. The first two are present day (1999), the third is a flashback and the concluding part returns to the present day. One of the things that I've learned from my critique group is about pacing. With their help, I've seen that a fair number of things in the first two parts were unnecessarily slow, dragging the book practically to a halt with details and characters that didn't really matter. In mind of that, I've been looking at the third part again, the flashback, and finally realized that it isn't going to work.

Now don't get me wrong -- the past is relevant to the story. But do those things require taking an entire quarter of the novel out of its main plotline to establish? For a while I tried to convince myself it did, but with the sneaking suspicion that I was wrong about it, I've finally sat down and read through it. As I expected to find, there's no excuse for the distance it drags the reader away from the mainline of the story.

There are other flashbacks in the book already, smaller scenes that reveal parts of the main character's past. I'm going to revisit those and see how I can work the third part into the rest of the book.

It hurts to cut it, 'cause I like it. I'm fond of the characters and the situations that show up in the flashback. But they don't build on the main story so they've gotta go. It hurts, but the book will be better for it.

Thursday, April 14, 2005

Charting Woes

I spent the bulk of yesterday generating bug trend graphs from our defect tracking software (which will go unnamed... lucky for them). It doesn't seem like it should take that long -- the app even has built-in charting functionality. All I wanted was two simple lines: total open bugs, and bugs developers have resolved that QA hasn't closed yet. However, as best I and my lead developer could tell, you couldn't do it with the software's reporting.

Every trend chart has three built-in lines (which you can hide, but can't delete entirely). One gives the total open count-- this is good, since it's half of what I wanted. One gives the change in closed bugs, the third change in submitted... not quite there but at least I can hide them. These options provide no means to alter them.

You can add other field trends to the chart, but setting criteria on them has severe limitations. Fields can be unassigned in this software, but you can't pick field=<> as a trend. Other non-charting portions of the software provide a pretty solid way to query information (with it's own quirks, but you can typically get what you need there). Why can't the charting do the same? The one saving grace for it was that you could create the report in a table view, copy-paste the data into Excel, add a few formulas and get the graph I wanted.

I can't imagine that the developers for this package purposefully thought, "You know, this'll really infuriate our users... let's do it that way!" But in the end, they don't seem to have noticed the frustrating limits they built in.

This puts me in mind of the software I write. How am I making sure that I'm not boxing my users in? How do you make sure that your users aren't cursing your name every time they try to print a report?

Monday, April 11, 2005

WM_NCACTIVATE and the edit control

I ran into an interesting bug the other day. I noticed that in one of our grids, the edit control that pops up to allow you to modify values was not accepting single mouse-clicks to change where the cursor was. Uh-oh, I thought. I'd recently made a change related to capturing the mouse input, and this seemed like a side-effect I'd missed. So I fired up our bug-tracking software, entered a defect and got down to work.

Then a strange thing happened. The mouse-capture work that seemed likely to have been interfering wasn't doing anything of the sort -- all the clicks were going exactly where they belonged, to the edit control.

Since this edit control had an override for OnLButtonDown(), it was pretty simple to see that the click was getting to the control. It included some code like the following (sans the comment, which I've added):

int oldSelStart, oldSelEnd;
int newSelStart, newSelEnd;
GetSel(oldSelStart, oldSelEnd);

// Base class actually moves cursor for the click
CEdit::OnLButtonDown(nFlags, point);

GetSel(newSelStart, newSelEnd);

So the called to CEdit::OnLButtonDown() seemed like it should be changing the cursor position for us. Ran the test on a different grid, which didn't have the problem, and sure enough, the call to the base-class for that edit control updates the cursor.

What's the deal? I thought. I started stepping down into the CEdit code, but it's a really thin wrapper over top of the core EDIT control in Windows, so that didn't tell me much. After a few minutes, I did something I don't often have the chance to do: bust over into disassembly view and take a look at what's really going on.

After a few false starts, I found my way down into the function user32.dll!_ECIsAncestorActive. As I stepped through that function, I noticed that it was returning FALSE.

A little light went on in my head.

The grid that I was working with was part of a window that was docked into a view frame window. I had recently addressed a bug about both the docked window and the view window drawing their caption bars as having focus, rather than just one of them to indicate where the user really was. The fix had been to send an WM_NCACTIVATE to the view frame, causing it to draw as disabled when focus wasn't in the docked window.


From there it was a simple matter to cause the grid to reactivate its parent frame when we entered an edit control. Once the parent frame was live again, the CEdit::OnLButtonDown() acted as expected, and all was well with the world.

Sunday, April 10, 2005

IIS and ASP.NET mappings

During my setup for FlexWiki, I found the following KB link extremely helpful. I had installed Visual Studio prior to enabling IIS, which caused the IIS's mappings for ASP.NET to get our of whack. Running the steps described sort things beautifully, and I was up and running FlexWiki within half an hour.

Maybe it’ll help someone else out too: http://support.microsoft.com/default.aspx?scid=kb;en-us;306005

FlexWiki and Writing

My current novel, Dreams of Shaper has been in progress since at least January of 2000. As such, along the way I’ve had time to think about the book that I’ll write after that. Slowly, over time I’ve had the ideas building up, watching the characters and world take shape in the back of my head. In the past, I’ve always managed to keep all this sort of business in my head, but my critique group (indirectly) has led me to see that this might not hold up for the future. The new novel will be more complex than what I’ve written before, and I need to start taking notes if this is going to work.

Anyway, I’ve also been looking to use some wiki software (basically a website that anyone can edit). Although I’m looking at using it at work, I’m not sure how/whether that’s going to work out. Since I’m running a web-server on my local network already, it seemed like the perfect combination of interests.

I’m currently using FlexWiki, and it has been great. Not too hard to set up—actually helped me sort some IIS troubles I was having. I’m also finding that it is a great way to record random information and link different ideas together. As I get further along building my next world in a wiki, I’ll maybe post a bit about the experience.

Obligatory Introduction

I've been reading technical blogs for over a year, and thought I'd finally get into the act.

I work as a software developer, writing business applications for the construction industry. Primarily we work in C++ (lots of MFC/ATL code), with a little bit of C# moving into the picture in the last year or so. Dealing with a lot of legacy code has given me a huge interest in what makes software maintainable for the long haul. I'm keen on unit-testing and refactoring, although I've definitely run into the problems of trying to use those techniques in a large codebases that weren't built with testing in mind.

My second interest is fiction writing. I've drafted a couple novels and some short stories, but am only now really on the trail toward trying to get published. I don't plan to post my fiction here specifically, but more to talk about the challenges that come along with telling a compelling story.

Don't know that this'll be of interest to anyone but myself, but there you go.