A day in the life of an XP developer is pretty easy to
understand. There isn’t much involved. Because developers
are relieved from making any business decisions, this saves time.
Because a customer is readily available to ask questions when they
arise, this saves time. Because you have unit tests in place to
test code when writing and refactoring, this saves time. In XP,
developers only work 8 hours a day, so the more time spent writing
code, naturally, is time best spent by you and money best spent by the
customer.
The day of a developer starts with coffee, Pepsi or Mountain
Dew. But seriously, the day of a developer begins with the other
developers in a quick stand up meeting. This meeting is meant to
be quick and to discuss what you did yesterday and what you are going
to do today. This keeps everybody in the loop.
After the meeting, developers pair up. Somedays you might be
the driver and writing code, other days you might be the navigator
keeping everything in check. In the meeting you’ve already
discussed the goals for the day. Now its time to git er done!
Because developer tasks are small, the next part of the day may or
may not repeat itself, depending on the number of tasks you wish to
accomplish this day.
Start writing your unit tests. Make sure your tests
fail. Now write your code. Only write enough code to make
the test pass. Once the test passes, now refactor the code.
Keep refactoring and removing lines of code until any single line
removed from that point on will make the test fail. This is part
of simple design.
Now, assuming you have completed the task during the same day you
started it, integrate it into the project source control. Now
everybody else has access to it: the latest version of the code.
If you have more tasks you can complete in the same day, start
it. Maybe pair up with someone different this time. Begin
the cycle of test-code-refactor-integrate again. If it gets to
the end of the day, which is 8 working hours, and you have not
completed a particular task, throw it away. Don’t check it in,
don’t integrate it. Since your tasks are small and simple, you
can start again on it in the morning. The time you’ve spent
working on it so far is time well spent. You’ll come back
tomorrow with good ideas and a better idea of the task and what is
needed to accomplish the task. If you keep working, you’ll
start to get tired, frustrated and produce bad code. Just throw
it away and take away what you’ve learned from it.
Go home, spend some time with your family. Play a game on the
computer, watch a movie, play your guitar, read to your kids or do
whatever it is you do to relax.