Stuart Ainsworth

#TSQL2sDay 001: Date/Time Issues and Data Modeling

This is my first post for T-SQL Tuesday (thanks, Adam, for the idea!); I’m hoping this will be a continuing block party, and hopefully connect a lot of us SQL bloggers together.  There’s a lot of great content out there, and sometimes it’s just tough to find.

Just a few notes before I get started on this; for this particular post, I’m pulling from my experiences as a data architect for the last few years.  I spend a lot of time reverse-engineering other databases in order to centralize and analyze data from a variety of sources.  Most of my efforts pre-date SQL 2008, so I don’t have a lot of experience with the newer datetime data types introduced in that version; however, I’ll point you in that direction if I think it might address an issue that I raise.  Also, there’s no particular order to my list of notes; think of it as a random collection of date-time issues.  Some of them may be specific to T-SQL and SQL Server, and others may just be procedural notes about data integration (and thus may be applicable to other platforms).

Ready?  Let’s get started.

1.  If you are a database professional that works with SQL Server, strike the word “timestamp” from your vocabulary.

Way back when SQL Server was in its infancy, some developer decided that timestamp would be a good name for a binary column that changes whenever the row was updated.  I don’t know the origins of the timestamp datatype; all I know is that it has nothing to do with date or time.  So why am I including it in a post about Date and Times?  Because for most speakers of the English Language, a timestamp is a marker that indicates when an event happens.  Many junior SQL Server developers and even senior developers on other platforms will often be confused by the timestamp datatype, and wonder what’s going on with that column that they just added.

My recommendation?  Avoid using the word timestamp in design discussions.   When someone mentions “we need to add a timestamp to that row”, make sure that you understand what they mean.  Usually they want you to add a column to capture what datetime the event happened, NOT an indicator of when the row will change.  Note that I’m suggesting that you avoid the WORD timestamp; obviously, if a database requires a timestamp column, use it.

2.  Does anybody really know what time it is?

One of the benefits of a distributed architecture is that your database server doesn’t have to live on the same box as your application server; in fact, your database server may not be in the same timezone as your application server.  And, if you’re using a webserver as an application host, your user may not be in the same timezone as either your application or your database.

I mention this because as a database designer, you may need to capture multiple points-in-time (or you may not); you cannot assume that the application is consistently providing the same time reference for all users.  If you’re using a truly distributed design, you may have one host in New York and one in Los Angeles, and your users may connect to either one to enter in data; what date do you use?

For this reason, I usually advocate two things: 1) always include a database-centric referential date of event (in other words, include a column with a default value of the database time for important data), and 2) always use UTC for saving time.  That second statement’s important enough to warrant a note of its own.

3.  When in doubt, use UTC.

Time is relative to geography; the application you build today in New York may eventually have clients in New Delhi.  If your processes could ever have the potential of crossing multiple time zones (for example, you want to track shipping from Atlanta to Oregon), you’d get the most benefit out of storing your data as UTC in order to understand the relationship between event A (which occurred in EST) and event B (in PST).  It’s a lot easier to change the display of events to a local time from UTC than it is to convert from local time to UTC, do the math, and then convert back.

One problem with recording data with UTC times that I’ve encountered is that is you have centralized data, but distributed users that want to see their data in local time, building OLAP cubes is a pain.  If you’re wanting to analyze data for Atlanta and data for Oregon, Atlanta’s day begins 3 hours earlier than Oregon’s.  I have not found an easy solution to this yet, but am starting to investigate the new datetimeoffset data type in SQL 2008.

4.  Use a standard notation for calculating differences between dates.

Obviously the new date and time datatypes in SQL 2008 address a desire of many in the development community for a method of storing ONLY the date or time of an event, but if you’re using an application that still stores the datetime of an event and you need to round the data to the nearest day, hour, week, whatever unit of time, then use  a standard method for doing so.

(I am assuming that you are using date-based arithmetic rather than converting to a varchar and back).

SELECT DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0)

is the preferred method; you can read why at my previous post.

5.  Use a standard notation for referring to dates.

Americans are weird about dates; we’re one of the few countries that puts the middle container before the smallest container followed by the largest container.  Clueless?  When people ask you what’s your birthdate, how do you answer?  Most people rattle off Month-Day-Year.   An international notation would be Year, Month, Day.

Again, if you’re designing databases and queries that might cross international borders, you’ll save yourself some debugging time in the future if you can get into the habit of using an international standard notation for referring to datetimes.   A query that asks for data WHERE DateOfEvent > ‘11/1/2009’ may work fine in the US (returning data newer than November 1, 2009), but may blow up in the UK (returning data greater than January 11, 2009).

How do you know if you’re a DBA that’s been bitten by this?  You start dating everything (including personal checks) using a notation like ‘2009-11-01’.  I  get odd looks all the time (probably not just because of the way I date my checks).

6.  Finally, get used to the fact that there’s lots of methods to store datetimes.

If you’re doing any sort of database integration, you’re probably familiar with many of the same issues I laid out.  There are others that I haven’t covered, but the important thing I want to focus on is that just because I think these are good habits to get into, others have different opinions.  Some db pro’s prefer to use epoch time rather than a standard datetime; I not only have to be familiar with my own methods of doing something (and prepared to defend those methods), but I also have to be willing to understand other methodologies so that I can do the conversion.

OT: Endings and new beginnings

This is a personal post; I need to write it to explain my absence from blogging, and hopefully announce my return with new vigor.

My wife and I have decided to separate after 14 years of marriage; although it’s a painful process, I’m hoping that we’ll both survive this, and come out of it as better people.  I wish I could say that it was completely mutual, but to be honest, I’m no longer able to understand her motives.  All I know is that I needed something to change in order for me to be healthy and happy, and this seems to me to be the only option left (and please, if you have an opinion about that, keep it to yourself.  I appreciate the concern, but I don’t need advice at this point).

Anyway, I’ve been busy setting up a new home and working out visitation with my kids (who I think are doing remarkably well under the circumstances).  It’s been tough making the adjustment, but I think I’m finally at a place where I can start writing again.  If you’re still out there, dear readers, I hope that I can soon start contributing to the community at full blast over the next few days.  It’ll give me something to do 🙂

Thanks for your patience, your thoughts, and your prayers.  Life happens when we least expect it.

PASS Summit Day 2: the brief wrapup #sqlpass

I’m writing this post quickly, because I have a 6:30 SQLSaturday alumni meeting at a local donut stop.  Please don’t let the brevity of the post throw you off; lots of goals accomplished yesterday.  Unfortunately, going to sessions was not one of them 🙂

  • I spent a lot of time networking, and discussing Agile techniques for database developers with a lot of different people, as well as looking at some of the latest and greatest tools for SQL Server.
  • Speaking of vendors, I shipped home two huge boxes of free stuff, most of it from Quest, Idera, and Red Gate.  My shipping costs were $80, so you can imagine the stuff I had.
  • Finally, and I’ll probably return to this in a later post, I met with the Board of Directors of PASS in an intimate session on governance.  It was fascinating, and I’m surprised that more chapter leaders were not there, because we discussed A LOT of issues related to the local chapters, and how PASS runs itself.  I don’t think that any particular goals were met, but I do believe that the following is true:
    • Change is coming for the local chapters; the PASS board is going to try to do more to connect with the local chapter, but will want more from the local chapter as well.  Think of it as having more concrete discussions about how the local community uses SQL Server, and what niche can PASS fill.
    • Steve Jones asked a series of great questions, including: “What have you done for me?”  He wanted the Board to be able to be more transparent, and expose their accomplishments beyond their individual audiences (for example, Greg Low’s work with the chapters should be available to those who are not chapter leaders).
    • More to come.
  • The day finally wrapped with an afterparty at a local arcade, hosted by Microsoft.  Lots of fun, but I was exhausted.

Gotta run; day 3 will be a blast.

PASS Summit Day 1.5

So this is the first official day of Summit, but since I got here in the middle of the day yesterday, I’m cramming a brief post in combining yesterday and today.  I could sum up the experience in one word:

Awesome.

I have met SO many people face to face that I normally follow on twitter and other social tools, and it’s been amazing to sit and chat with other SQL geeks.  I ended up buying the DVD set today because I had too many sessions to attend, and too many people to chat with.  It’s truly inspiring to hang out with a bunch of intelligent people who are really passionate about what they do.

Highlights:

  • Pinal Dave stole my pen.  Well, he actually borrowed it to fill out his sqlbingo card, and then forgot it.  It’s OK, because I know if I make him feel guilty, he’ll fly back to the States from India to bring it to me.  And I could make him speak at our newsgroup.
  • SQLBingo has not taken off as well as I had hoped, but it’s going OK.  They’re drawing the first two winners tomorrow morning, and I hope to pitch it harder tomorrow.  I forget that just because I’m a social person, not everyone else is.
  • I learned some new stuff at Michelle Ufford’s presentation on VLDB’s.  Need to check things when I get back in the office to see if they’ll help some performance issues.
  • Met Patrick Leblanc, Tim Mitchell, Lori Edwards, Jeff Rush, etc., etc.,etc…
  • Met Remus Rusanu today after Brent Ozar’s session, and was told by him that he liked some of my responses on StackOverflow.  That really made my day, because he gives some great advice on that website.
  • Kevin Kline gave me AND the user group autographed copies of his latest book.
  • MidnightDBA gave me free stuff.

LetDowns:

  • I didn’t win any blogging awards.  More incentive to keep working at it.
  • I realized I should have submitted something to present.  Paul Waters and I made a pact to come up with 3 submission ideas for next year.

OK, I’m officially out of steam.  More to do tomorrow.

Packing my bag for PASS Summit 2009

Flying out on Monday, and I’m so excited.  Here’s the stuff I’m throwing in my bag (as if any of you care).

  1. My Archos 5 IMT – 6+ hours and an extended battery.  Gotta load it up with all of the TV shows I’ve missed over the last few months on my SageTV rig.  Since I can’t find my boosteroo audio amp, I’ll need to go see if I can get a good set of headphones for the plane.
  2. Pad and pens.
  3. My laptop computer, complete with the Nokia softphone software.  I’ll still have to touch base with the office occasionally, and this way I can have portable VOIP.
  4. I’m writing a review for The Art of Unit Testing for the AtlantaMDF Reviews site.  Need to pack the book for the plane.
  5. Airborne Vitamin C.  I know it’s not likely to prevent germs, but boosting my vitamin C intake before I travel is almost a superstitious rite for me.
  6. My #sqlbingo cards and tag.
  7. My PASS Summit itinerary;  I was going to load it into Outlook, but I remember that the last time I did that, everything got screwed up because of the time change. 
  8. My phone, and an extra battery (for all of the twittering I plan on doing).
  9. Business cards.

And I still gotta pack clothing and essentials.  I’m hoping I can do it all with the carryon+laptop limitation, particularly since I have a layover on my way back.

SQLBingo: a few more things to consider…

SQLBingo is still on at Pass Summit 2009; we’re less than a week away, and this should be a lot of fun.  To sum up, a bunch of us SQL Tweeters are going to be wandering around Summit; if you want to play Bingo, you have to match the real person with their avatar on the card, meet the person, and get their codeword.  Should be a lot of fun, but I have a few more things to add.

If you haven’t read the following posts, you may want to start with them first:

SQL PASS Twitter Bingo: The rules so far…

A basic summary of the rules for squares (with some general advice for players).  I’d like to add some things to the “how to play” list, but we’ll get to that in a minute.

#SQLBingo: Meet nice people and learn their safewords.

Brent (as usual) writes a very succinct post on how to play if you’re not a square.  What’s important about Brent’s list is that he lays out some guidelines for things to do BEFORE you go to Summit.

Wanna play?  It takes some prep work…

It should be noted that this is a low-budget game at best; I think one of squares called it “guerrilla networking”, which I think is an awesome term for it.  What it means is that we’re trying to keep the rules and the play very simple, but unfortunately, that also means that the players have to provide some of their own resources for playing.

If you are playing, follow the steps at Brent’s blog:

  1. Print your cards ahead of time from http://sqlserverpedia.com/bingo. (Be sure to refresh in between)
  2. Find the tweeps.
  3. Turn in a card per day when you’ve filled out a row on Tuesday, 2 rows on Wednesday, and blackout on Thursday.

You may also want to set up a Twitter account between now and then.  If you’d like, you can check out sqlbingo’s profile; this is a dummy account set up by Aaron Nelson and myself to follow all of the squares.  The whole point of this account is to simply give you a quick list of all of the Twitter accounts that are on the cards.  You may also want to set up a search for the term #sqlbingo; remember, the squares will be broadcasting their location periodically throughout the day, and using this term will help find them.

Already a square? It takes some prep work…

Same rules for players applies to the squares; however, we’ve decided that squares are not eligible for prizes.  Sorry.  However, if you’d like to make it easy for your adoring fans to find you, you may want to print out a simple badge with your avatar and username on it.  Just a 2×4 scrap of paper, and tape it to your standard Summit badge.  If you forget, c’est la vie!  It’ll just be tougher for people to find you.

Looking forward to meeting all of you face to face!

Stu

Good Habits To Adopt: Enforcing the natural primary key

I’ve been reading Aaron Bertrand’s great series of blog posts on bad habits to kick, and have been thinking to myself: what are some good habits that SQL Server developers should implement?    I spend most of my day griping about bad design from vendors, yet I hardly ever take the time to document what should be done instead.  This post is my first attempt to do so, and it’s based on the following assumptions:

  • Good habits are going to be a lot more controversial than bad habits, and
  • SQL Server doesn’t enforce many of these good habits for you.

The first point refers to the fact that some of the choices that I make are not necessarily the best way to do things, and they may not satisfy the need of every application.  I’m a firm believer that there is an exception to every rule, but my goal is to at least define what the rules are (and again, these rules are my own creation and someone may have better rules).  The second point refers to the fact that SQL Server enforces the rules of SQL, but leaves some of that enforcement open to interpretation.  For example, the relational model defined by SQL assumes that tables are related, but SQL Server doesn’t require that you define a FOREIGN KEY (or even a PRIMARY KEY).

So here’s my first good habit:

When defining a surrogate primary key for a table, you should enforce the natural primary key with the use of a UNIQUE constraint.

To really understand this, you have to start with defining what a surrogate primary key is versus a natural primary key.  You can search for a variety of definitions, but I’ll use the following:

  • Primary Key: a non-nullable attribute (or combination of attributes) that can be used to uniquely identify a specific instance of an entity.  When used within SQL, a primary key can be mapped to a column (or columns) in a table, and the value of the key uniquely identifies a row.
  • Natural Primary Key: a primary key that is not auto-generated by the database or application.  The key is comprised of attributes that are associated with an entity, and the value of those attributes is defined by some authority beyond the scope of the database or application.  For example, a Social Security number is a “arbitrarily” assigned number that belongs to a specific citizen of the United States; most databases that use the Social Security number do not create the number, but rather use it as a reference to a particular US citizen.
  • Surrogate Primary Key: a primary key that is auto-generated by the database or application to specifically identify the row in the table representing the collection of entities.  Surrogate keys have no meaning outside of the database and have no relationship to the other attributes in the table.  An ID of 1 simply identifies a row in a table; a row representing a person, a squid, or an automobile may all have an id of 1, depending on what table the surrogate key the data lives in.

Sidebar: as I was writing this, Pinal Dave post the following to his blog: http://blog.sqlauthority.com/2009/10/22/sql-server-difference-between-candidate-keys-and-primary-key-2/ 

Most novices recognize that every table needs a primary key, and surrogate keys offer some benefits that natural keys do not, including:

  • Immutability: the ability of a key to stay constant over time.  A natural primary key (such as a person’s name) may change, but a surrogate key does not.
  • Simplicity of relational JOINS: surrogate keys can remain as a singular column for each table they represent.  For example, a complete invoice may need to be represented by a ClientID, an InvoiceID, and the LineID’s for the lines on that invoice.  Joining on the natural keys may require the Client Name and Address, the Invoice Number, and the Line Number. 

However, surrogate keys have one major weakness; they do NOT enforce the unique validity of each row.  If you use an IDENTITY function in SQL Server to auto-generate your surrogate PRIMARY KEY, and you insert Stuart Ainsworth into your table of Employees, and you accidentally run your INSERT script again, you’ve just double-inserted Stuart Ainsworth.  While there are certainly multiple people with my name, I’m the only one at my company.  However, my application never noticed it.

Using a UNIQUE CONSTRAINT on the columns holding the natural key information avoids this problem; you get the benefits of a surrogate key AND the unique validation of a natural primary key.   The hard part is, of course, identifying the appropriate natural primary key to enforce.  However, this exercise should NOT be overlooked when designing a database.

SQL PASS Twitter Bingo: The rules so far…

Sorry for the late posting on this, but it’s been a heckuva day 🙂  Anyway, we (Brent Ozar, Blythe Morrow, several others and I) have had several logistical discussion about how Twitter Bingo will be played at PASS Summit 2009, and I thought I would post what we’ve discussed so far.

The goals!

The goal of the game is to increase networking opportunities between the SQL Twitter community and face-to-face PASS Attendees.  Our hope is to a) strengthen existing relationships between SQL tweople, and b) encourage new people to start using Twitter and contribute to the social interactions beyond Summit. 

What is NOT the goal!

To win fabulous prizes.  Quest and SQLServerPedia are putting together some encouragement for new people to play, but the focus isn’t on “winning”; it’s on community interaction.

“Squares” and players…

Squares will be the volunteers who agreed to have their Twitter avatars placed on the cards.   Squares may certainly play the game by printing out cards and pursuing other squares, but at this time, squares are discouraged from entering the prize drawing (Sorry about that; the prizes are fabulous, but not that fabulous).  Again, we want to encourage new people to join the community; if you’re a square, you’re already there (ooh, that was a horrible rhyme.)

How will players mark off squares on their cards?

Each square has a code word; when asked for that code word, they should provide it to the player, who can write it on their card.  I realized that code words will probably be shared among players, but again, the goal is to encourage community interaction even at the risk of minor “cheating”.   We may come up with a more secure scheme next time, but this time, it just seems easier for Quest/SQLServerPedia employees to validate code words.

Arlene Gray (@whimsql) suggested that she write her code word on the back of her business card; I think that’s a great idea.

How will players know where to find me?

Twitter is an option 🙂  If you can, tweet your location throughout the day using the hashtag #sqlbingo.

Brent also suggested that if you’re a speaker, you may want to ask squares in the room to stand up before you begin your session, so players can identify them.  We’re also planning on asking squares to print out a small badge to tape to their regular conference badge showing their avatar and username.

Where do players get their cards?

We’re going to ask players to print out their own cards and bring them with them; we’ll also have some cards available at the Quest/SQLServerPedia booth.  Blythe Morrow also suggested that we use the PASS help desk booth as well.

How do players play?

We’re planning on adding this to the card:

Here’s how the contest works: print out 3 Bingo cards.  Try to meet as many people as possible that are on your card each day.  Each person has their own code word, and you have to write down their code word in their space on the Bingo card.  When you get a straight line (5 people in any direction) on Tuesday, you can drop off your card in the SQLServerPedia booth in the exhibit hall.  Each day, we’ll draw 2 winners and email them with their prize package – things like signed books, gift cards, and more.  On Wednesday, it gets tougher – you have to have two straight lines filled out.  On Thursday, you have to have a blackout – all spaces covered!  Only one entry per person per day.

Who’s a square?

Below is the list of squares:

Square SquareUserName
Andy Leonard AndyLeonard
Aaron Bertrand AaronBertrand
Aaron Nelson SQLvariant
Adam Machanic AdamMachanic
Allen Kinsel sqlinsaneo
Andy Warren sqlAndy
Arlene Gray whimsql
Bill Fellows billinkc
Bill Graziano billgraziano
Blythe Morrow blythemorrow
Brent Ozar brento
Brian Kelley kbriankelley
Colin Stasiuk BenchmarkIT
Denny Cherry mrdenny
Eric Humphrey lotsahelp
Geoff Hiten SQLCraftsman
Grant Fritchey GFritchey
Jeff Rush JeffRush
Jeremiah Peschka peschkaj
Joe Webb JoeWebb
Ken Simmons kensimmons
Kendal Van Dyke SQLDBA
Lee Anne Pedersen leeannepedersen
Lori Edwards loriedwards
Mike Walsh Mike_Walsh
Mike Wells SarasotaSQL
Pat Wright SQLAsylum
Peter Schott paschott
Peter Shire Peter_Shire
Ross Mistry RossMistry
Rushabh Mehta rushabhmehta
Steve Jones way0utwest
Stuart Ainsworth stuarta
Tim Benninghoff bugboi
Tim Ford sqlagentman
Tim Mitchell Tim_Mitchell
TJay Belt tjaybelt
Todd McDermid Todd_McDermid
Tom LaRock SQLRockstar
Trevor Barkhouse SQLServerSleuth
Wendy Pastrick wendy_dance
Wesley Brown WesBrownSQL
William McKnight williammcknight

 

That’s all for now; I’m sure more will come up as I think about it 🙂

All aTwitter about PASS Nominations

Lots of interesting conversations about the PASS nominations happening on Twitter today; if you are not up to speed, you’ve got a lot of reading to do.  I’ll try to sum up as best I can:

  • Some people applied to be nominated for board positions; a nominating committed approved 4 applications for 3 open positions.
  • 3 of the 4 positions are well-established members of the SQL community; one is a bit more controversial.
  • All 4 candidates have been invited to express their opinions on various forums, and all have been “interviewed” by Brent Ozar on his blog.  Links are below.

If you haven’t read these interviews, you need to.  For the most part, they’re pretty insightful, and they suggest what direction each of the candidates is moving in when it comes to PASS.  Matt’s candidacy raises some interesting questions about the nomination process, and the role of the Board in determining the direction of PASS.  It also raises some definitional questions about what PASS is, and what it should be.  I applaud him for his comments on Brent’s blog, because it takes a lot of guts to stand up under fire (even though I disagree with some of his positions). 

EDIT: I should have also stated that I applaud ALL of the candidates for their willingness to engage the members of PASS, including the first step of applying for the job. 

Before I go too much further, let me say that this post is intended to be an indictment of myself; I did not apply to be on the Board, nor did I even express much interest in the nomination process before today. I also didn’t even blink before I voted; I picked the three candidates that I felt comfortable with, and was going about my business until the conversations began on Twitter today.  I will not be so lax in the future.

What bothers me most about Matt’s candidacy is not his position, nor his background, nor the responses he gave to the questions asked of him; it’s the fact that he’s the only candidate that the community seems to have engaged in this fashion.  Granted, many of the questions asked were for him to clarify how his professional expertise would make him a good fit for the Board, and those are legitimate questions.  There were also other questions that were asked to help clarify his vision of direction for PASS which would have been suitable for the other candidates as well.  All of that’s fair game, but why didn’t we challenge the other candidates as well?

When I asked the question on Twitter, the general response I got was that “we know the other candidates; we don’t know Matt”.  That may be true, but even though we know someone, that should give us the opportunity to engage them on a deeper level than the “dark horse” candidate.  Instead, we as a community let 3 out of 4 candidates express themselves with little or no interaction from us, and instead focused on 1 controversial candidate.  I am not suggesting that Matt should not have been questioned; I am suggesting that we should have taken more advantage of the opportunity to get to know the other candidates better.

EDIT: As pointed out in the comments below, Matt was not the only candidate to engage with questioners; I didn’t mean to overlook the efforts of the candidates to make themselves approachable, but I did want to point out that many of us didn’t take them up on that offer.

Again, I’m pointing the finger at myself as much as anyone else.  I should have applied for the position; at the very least, I should have asked more questions before casting my vote.

Maker’s Schedule, Manager’s Schedule, User’s Schedule

During the recent SQLSaturday #25 in Gainesville GA, we had an open session at the end of the day which we treated like a “Meet the Experts”.  During the discussion, Cliff Jacobson referred to an article detailing the difference between the Maker’s Schedule and the Manager’s Schedule. 

Here’s the link for your reference: http://www.paulgraham.com/makersschedule.html

It’s a quick read, but I’ll sum it up for you

There are two types of schedule, which I’ll call the manager’s schedule and the maker’s schedule. The manager’s schedule is for bosses. It’s embodied in the traditional appointment book, with each day cut into one hour intervals. You can block off several hours for a single task if you need to, but by default you change what you’re doing every hour… But there’s another way of using time that’s common among people who make things, like programmers and writers. They generally prefer to use time in units of half a day at least. You can’t write or program well in units of an hour. That’s barely enough time to get started…

I would argue that (at least in our shop) there’s a third schedule: the User’s Schedule.  Some managers ARE users, so their time alternates between the Manager’s Schedule and the User’s Schedule, but for the sake of this discussion, we’ll keep this separate.

What is the User’s Schedule?  Basically, users only know of one time: Now().  Now is when they have to get their work done, and Now() is when the software breaks.  When their work gets interrupted, they have to resolve the problem before they can move on.

Why is this important?  Because when Users need a resolution, they don’t want to hear it’ll take a week to implement; they want it fixed Now().  When they request a feature, they want to know it’s being worked on Now().   Obviously, this is unrealistic for Makers; good code takes time to write, time to test, and time to document.  When a Maker skips one of those steps, it’s usually because they’re attempting to work on the User’s Schedule.

Now() is not necessarily a bad time; Users are not attempting to screw the Maker out of task completion.  The User really believes that Now() is when the Maker wants to know about the issue, so that the Maker can fix the problem before it gets too severe.  Notifying the Maker about the issue as soon as it happens is the User’s method of helping.

So how do we reconcile these three schedules?  Programmers need to meet with managers (they determine priority) and users (they determine requirements); in fact, the Agile Manifesto states that

Business people and developers must work together daily throughout the project.

How do you keep the conversation focused on the scheduled deliverable and not the bug of the moment?  You have to keep moving forward, but you also have to be willing to acknowledge the Manager’s need for status reports and the User’s need to report issues and request features.  I am no expert in this, but these are the principles I am starting to implement in my own schedule.

  1. I’m working with Management to find appropriate times to schedule status reports.  I’m trying to fit them in either right before lunch (either the meeting ends on time, or I may get a free meal out of it), or in the last hour before the end of the day (sometimes meetings go long, which is unfortunate).    This takes care of the Management/Maker disconnect.
  2. To avoid addressing issues Now(), I have started closing my email, forwarding my phone, and setting my IM status to Do Not Disturb (note: for a feature in Office Communicator, I wish I had a way to set different statuses for different contacts; DND doesn’t raise an alert, but I wish I could let my boss through) for 45 minutes out of every hour.  The last 15 minutes, I stop coding, and check email, etc.  This keeps my finger on rising issues, but is less interruptive than  constant contact.  Of course, I work remotely most days, so I don’t have to deal with Spring-Loaded-Butt Syndrome (and I’m not talking about hinges).
  3. When I do contact users to deal with the bug-of-the-moment, I try to reassure them that the a) bug is being recorded, and b) will be prioritized.  We use Team Foundation Server, which is OK for a bug tracking system.  The biggest problem that I see in my current environment is that Users don’t often follow up with Managers to make sure that the issues are prioritized.
  4. When discussing features for rollout, and the User attempts to bring up the bug-of-the-moment, I ask them to hold off on that discussion until the end of our stated objectives, and I encourage them to write it out.  By writing out the issue, they begin specifying the core elements of a bug report/requirements document. 

Is this perfect? No, but it’s a start.  I’d be interested in hearing what your ideas are on the subject, and what steps you have taken to coordinate Maker’s time, Manager’s time, and User’s time.