Quick clever idea I saw

Someone at work just pasted in some code that was locking two tables for write, inserting all of one table’s data into another, then making a trigger to keep them in sync in the future after inserts, and then unlocking the tables.

Someone else suggested just making the trigger first, and then replacing all of the data from the first table into the new one. Using replace means that some of the data may be double-copied, but there’s no table-level write locks used — pretty cool.

Also, we’ve been talking about hypergraphs, which are a little confusing. They’re graphs, but instead of each vertex having multiple edges and each edge running between two vertices, each vertex can have multiple edges and each edge can have more than two vertices! I ran into them once before, and still don’t quite understand how that situation even was a hypergraph.

Rigour vs Just Do It

I’m reading The Mythical Man Month, and I also happened to read this post on just getting something started this morning. I’ve got two (conflicting?) messages in my head at the moment:

From the Mythical Man Month, I’m hearing about how much planning used to go into development and testing of software systems. That sort of rigour just doesn’t seem to be present any more, and I am taking a desire away from the book to be a little bit more careful and systematic and thoughtful when approaching a new project. Kind of like that (perhaps apocryphal) Einstein quote about solving a problem in an hour: “If I had an hour to solve a problem I’d spend 55 minutes thinking about the problem and 5 minutes thinking about solutions.” It’s allegedly beneficial to sit down and think before you start doing.

Against that, from the Lean Startup and Fail Fast sort of camp, I have the suggestion to just get something out there. Write anything down, acknowledging that it’s awful, just to get started. Step 2 is easier, and iteration is what drives progress. You won’t know most of the problem until you really dive into solving it. That kind of thing.

These both seem right, but they also seem incompatible. There’s probably a middle road — I wonder whether it’s best to think out how to find it, or to just start trying things and hash something out?