Putting the "Journey" in Journeyman Software Developer: An Interview with Corey Haines
When it comes to colorful careers in software development, it's hard to top Corey Haines. Yes, he had the classic career as a programmer, earning a college degree in mathematics and spending fourteen years programming and developing software. Then, in 2008, Corey did something different.
He took a road trip.
Corey took a classic journeyman approach to software development, by actually going on a journey, spending around nine months on the road, offering to pair program with anyone who would give him space and put him up for the night.
Along the way, he got exposure to dozens of different organizations, the technologies they used, and the way they develop software.
Shortly after announcing his trip, the emergent field of software as craft began to develop. Corey attended the 2008 Software Craftsmanship Summit, helped author its manifesto, helped organize the Software Craftsmanship North America Conference in 2009, and provided the closing keynote in 2010. He'll be giving a keynote at this year's conference, as well.
Still focusing on craft and what programmers do, Corey has been talking more and more about value--what value the technical staff can bring to the table, how to translate that into value for the customers, how to focus on it, communicate about it, and deliver more of it.
Matt Heusser: Can you tell us a little bit about software as craft? How is that different than being a "good programmer"?
Corey Haines: Software craftsmanship is more than just being a "good programmer." It is about the reasons and values behind why you would want to be a good programmer. At the 2010 SCNA, Enrique Comba gave a talk on the forgotten value in the manifesto: productive partnerships. Because the general talk around craftsmanship is centered in the development communities, the focus is on development-type topics: practices, processes, techniques, methodologies, etc. However, these are there to provide concrete value to our clients.
So, for example, test-driven development is a core practice, both as a design tool and a method for generating a comprehensive, fast regression suite of verification checks. It is important to ask why we want these particular things. The loosely-coupled designs to which TDD guides and supports us takes advantage more fully of the promised benefit of modular design: minimizing the cost of change of a system. The comprehensive suite of regression tests allows us to save time and money by shrinking the feedback loop between doing something and finding out if we broke something. On my application, MercuryApp, for example, our entire release-focused test suite takes less than 5 minutes. This means that I can click a button and find out within 5 minutes if the application worked like it did yesterday. This also adds to the ability to change our software fairly easily. Why do we want to minimize the cost of change? What value does that give? Businesses change. Businesses evolve. The more rapidly the software supporting the business can evolve, the more easily a business can adapt to change. This is especially true in small businesses and startups: you need to be able to rapidly try things out, as you are looking to learn what works.
Matt: Tell us about MercuryApp. What does it do? How large is the codebase? What kind of apps do you think should have a test suite that runs in five minutes--all of them? Are there cases where that is not good advice?
Corey: MercuryApp is a tool to help tools and individuals make better decisions by capturing how they feel about things over time. Think of micro-journaling with a bit of extra information about your general feeling. You pick a topic that you want to track, and at certain intervals (every day, several times a day, every few days, etc.), MercuryApp contacts you and asks you how you are feeling about that topic and why. Responding can be done via email (and soon to be via twitter dm), and feedback from our users has shown this takes less than 30 seconds. Then, you can view a graph of your feelings linked with the notes you have left.
Often, we think we are making decisions based on quantified, hard data, but just as often we make our choices based on a gut feeling. Take a team that is experimenting with some specific process change or new toolset to improve their productivity. They might time-box the experiment and set up a decision-making meeting. We've all been in that situation where the decision is based on our “at the moment” feeling of the topic. Perhaps you struggled with the tool yesterday or had one-to-many meetings yesterday and are in a bad mood. This has a serious impact on our objectivity. But, with MercuryApp, you come into the meeting with concrete information captured over the course of time. While at the time of decision you might be feeling negative, looking back at your journal illuminates your real views over time.
My girlfriend, Sarah, and I have been working on MercuryApp for around a year now, and the codebase is between 10 and 15 thousand lines of code. It is built using Ruby on Rails, which dramatically decreases the lines of code needed to get the same feature as some other tools. It is a really fun codebase to work in. It has been refreshing to really work on my own project, because I've been able to take all of the techniques and ideas that I have around writing maintainable code and apply them. So, after a year, the codebase is still pretty malleable, accepting new features fairly readily. We do our best to keep it clean, especially after building a new feature in.
I've also been able to use it as a guide for improving my understanding of doing TDD on a framework-based application. As an example, our unit test suite was beginning to reach the outer edge of acceptability for me; we had around 800 examples that were starting to push upwards of 15 seconds. This necessarily makes the TDD workflow cumbersome, as you want to be running your unit tests very frequently. Even when just running a focused set of tests around the current area of development, I was seeing multi-second run times. I like to say that the main difference between test-first and test-driven development is your reaction to pain in the testing process: with test-first, you alter your tests; with test-driven, you alter your system design. So, I took a look at what was causing this pain. The major culprit was loading the Rails framework. As your system gets larger, the startup time for the framework increases. I did some research and investigation into my codebase and realized that I was definitely coupling myself too tightly to Rails. Parts of my system that were business-logic, independent of the database or the web, were still reliant in some way or another on the Rails framework. Or, if they weren't directly coupled to it, their tests were still loading up the framework. So, I took a couple hours one night, found the code that was completely independent of the web and the database and set up a way to run them without loading Rails. This immediately brought the run down to a couple seconds. I continued to investigate and found that one tool I was using, Bundler, added overhead of 1.2 seconds to the suite. So, I looked to see if that was necessary. It wasn't. I cut that out of my development process tool chain. I had now taken a >10 second run for about 100 unit tests and dropped it to sub-second. I then began looking at a few other business-logic-oriented components that were coupled to the Rails framework. I took a few of them and isolated the code from Rails-coupled techniques, such as a heavy reliance on ActiveRecord finders. I was able to bring over a lot more unit tests into the sub-second range. Now, we still have 800 tests that are in the Rails-dependent test suite, which takes around 20-30 seconds to run. We have a "no rails" test suite that contains about 400 tests and runs in about .5 seconds, and a majority of that is actually the overhead of loading and parsing the files. As we make changes to existing parts of the codebase that is being tested with the slow suite, we move the tests over to the fast suite. So, as I'm working on a specific unit, and I need to run only one or two test files, I can run them almost instantaneously.
To the question of what kind of apps should have a test suite that runs in five minutes, my answer would probably be any one that I've ever worked on. And frankly, probably on any one that the readers of this interview work on. Often times we blame our test suite on other factors, but I find that a slow test suite, especially at the unit level, is because of a poor design, not because of inherent problem in the tools. This generally comes out via sloppy or inexperienced design practices around coupling.
Are there cases where a fast test suite is not good advice? I don't know. I haven't seen one. I've heard a lot of people give me examples, but, after further discussion, it boils down to a design issue. Are there very large systems, such as an operating system, that might potentially have enough parts to it that you can't have a complete test suite that runs in 5 minutes? I don't know. But, if you apply good modular design techniques, I think you can break it up in such a way that any individual subsystem can be tested independently and effectively within a reasonable amount of time. Most of the people I deal with, though, are building business applications, web applications, etc., and the long test suites I've seen have always been because of faulty designs.
Matt: You went from “enterprise software developer” to traveling software journeyman within the course of a year. Can you tell us about how that happened?
Corey: In 2007, I was increasingly frustrated with the large corporate environment. At the same time, I was getting more and more frustrated with the technology I was using. I was deeply entrenched in the Microsoft ecosystem, having spent most of my professional career using their tools. As I was getting more experience with evolutionary design and test-driven development, it felt like the tools I was using were actively battling me. I had been fooling around with Ruby for a bit of time, and I really enjoyed the time that I spent working in that language. So, I decided I was going to get a job doing Ruby on Rails. I spend the summer and fall of 2007 writing small web applications, and I finally was approached to work at a startup in Cleveland, OH, where I was living at the time. So, in February of 2008, I left the enterprise behind and joined a small startup. They were beginning a redo of their application and platform. I spent the summer in a haze, working a lot of hours, seeing the effect of the "we need to get users so we can sell the company" mentality. In the end, my attitude and approach to software development, deeply grounded in XP, caused a lot of stress and misunderstandings in a team that did not share those values and practices. So, in the end, when you have a member of a team that does not fit in, the time comes when you have to cut that person. I got fired.
I spent a month thinking and relaxing, then decided to take a sabbatical. Over the years, my friend and mentor, Joe Rainsberger, and I had thought wistfully about how much fun it would be to go wandering out, Paul Erdos-style, programming with lots of different people. It occurred to me that this might just be my opportunity. I knew a lot of people who worked from home, independents, remote workers, etc. So, I figured it wouldn't be hard to take a few weeks and visit them.
I was working on the idea when I went to the 2008 RubyConf, and spent some time with David Chelimsky. He and I always seemed to end up pairing whenever we saw each other, and this was no different. I mentioned my idea to him, and he told me to come to Chicago. So, I set out on a three-week trip to spend time programming with people in exchange for room and board. When I left Cleveland at the beginning of December, heading to David Chelimsky's in Chicago, I barely had the first week of places organized. By mid-week, I had the entire three weeks planned, ranging from Chicago, through Indiana, down to Cincinnati and Columbus finally back to Cleveland. The idea started to gain popularity and following, so I figured I would just keep going. I started doing smaller trips in the winter and spring of 2009, mostly around the Ohio, Illinois, Michigan area, then organized a three-month trip along the east coast for the summer.
Matt: Can you tell us about the results of that trip? Not just the blogs, videos and talks, though we'd be happy to check them out, but also, how were your opinions and ideas shaped by those new experiences? What did you learn?
Corey: The trip was definitely one of the most formative experiences of my career and life. While there were a lot of intangibles--network building, fun, etc.--I'll talk about two specific take-aways: dropping in on a codebase and adding value, and having a more realistic view of my own skill level.
Moving from place to place, spending anywhere from one to five days, I was often in the situation where I needed to add value to a system with only a cursory understanding of it. Think about sitting down at a codebase with one day to add some value. What are the techniques you'd use, how would you apply the right focus? I learned the extreme value of pairing in this situation. I've loved pair-programming since I first started doing it in 2004, and I've seen a lot of different benefits to it. The sheer power of using it to bring someone (in this case, me) up to speed on a codebase was amazing. It allowed me to clear my mind of larger concerns, relying on my partner to have the larger context, and I could focus on the detail of what we were working on. After doing this repeatedly over the course of the year, I found myself incredibly comfortable just focusing on a small part of the system that I'm working in. Sometimes you need to have the larger context, but not always. Now that I'm doing a lot more technical consulting and training, I find this skill to be incredibly useful to increase the value that I can provide for my clients.
For most of the time, we work and surround ourselves with the same people, and we have a good sense of our skill level relative to this group. Have you ever had that experience where you sit down at a conference with a developer you've never coded with and are completely blown away by how good they are? You thought you were pretty high level, based on your normal group, then you code with someone who blows your mind. Or, you think you aren't that great, but you sit down with someone and realize that you are much more advanced in your understandings than they are. Now, imagine going around and doing this constantly for a year, working with new people. You would definitely get a great sense of your own skill level. It is a fantastically grounding experience. As I've facilitated coderetreat trainings around the world, as well, one of the most common responses I get during the closing circle reflection is that a person gets a real sense of their strengths and weaknesses by pairing with 6 other people during the day; now imagine doing that for a year.
These are just two of the many things that immediately spring to mind.
Matt: Along those same lines, what are you working on right now? What is new and exciting in the world of software craft, and, more importantly, in your world?
Corey: There are a couple major things I'm focusing on these days. First, my own coding projects. I spend a lot of time traveling to speak and hold trainings. This is a wonderful thing to do, but it comes with the danger of skill atrophy. So, I make sure that I deliver actual working, complete software frequently. This is a great way to keep my skills up-to-date. My main focus right now is on MercuryApp, plus a few other projects that Sarah and I are starting.
Also, Sarah and I are actively working with non-technical founders of startups to help them better understand the software development process. We keep hearing horrific war stories from founders that could be alleviated with some guidance and education. So, we are sitting down and talking about concrete value they can demand from software development freelancers and workshops. Rather than focus on the technical practices, we start with an understanding of the end result. As an example, it is reasonable to expect working software every week. Rather than receiving a status report of what is being worked on, they should be provided with a URL that they can see and use. Shrinking the feedback loop between asking for something and seeing it actually implemented allows the founder to adjust their idea more quickly. We also talk about the ability to replace the human, “click around the application to see if works” process with a computer doing the same tasks. Having the ability to rapidly verify that the system continues to work like it did yesterday (or five minutes ago) can allow much more freedom when adjusting priorities and the specifics of features. While explaining these things they can expect, we also talk about trade-offs if they choose not to demand this. That way, they have a bit more information in their hands when they are talking to a prospective contractor.
On the side, I've been having an absolute blast playing with Scratch. I'm helping a friend teach a game design course to high school students this summer, and so I have been learning Scratch. It is an amazing environment, and I'm finding myself smiling and laughing when I build things in it. It was amazing to see a group of high school students with no programming experience build a functioning version of Pong during a 1.5-hour class. The Software Craftsmanship community talks a lot about our responsibility to others, especially the way people are brought into a software development career and how we mentor them in skill improvement. This small amount of time with Scratch has really given me a new energy towards helping young people learn about programming. With the teacher that I'm helping this summer, I'm planning to put together a four-week night course for parent-child pairs to learn to build games using Scratch. I caught the programming bug early on through games, and I hope that I can share it the same way.
And last, but not least, I'm focused on taking the last two-and-a-half years of coderetreat to the next level. I've spent the time establishing the coderetreat format, and I've seen the format go from an idea in a hallway to a world-wide phenomenon. I've started using the format effectively at companies for in-house private trainings, and the feedback there has been outstanding. I'm also planning an event called "Global Day of Coderetreat" with the goal of 32 hours where there is a coderetreat going on somewhere the whole time. My dream is to facilitate the first one (most likely in Australia) and the last one (most likely in Hawaii).
Matt: Thank you for participating. One final question: say the reader saw something here that sparked their interest. Where can people go to learn more?
Corey: Twitter! A lot of fantastic discussions happen there. The 140-character limit is a big constraint, but it also is a bit freeing. Say I have an offhand idea. I can put it on Twitter and immediately start getting feedback on it. Last fall, I was sitting in a hotel room in Belgium, and I put out the statement, "Design Patterns are inappropriate to teach to beginners. Discuss," and had a fantastic conversation with people all over the world.
The Software Craftsmanship mailing list often has interesting discussions, as does the XP and TDD mailing lists.
And conferences! Come to the Software Craftsmanship North America conference. Go to the Software Craftsmanship UK conference. There are loads of Software Craftsmanship user groups around the world. Attend a coderetreat in your area. If there is nothing happening in your area, then start something. Put out word that you are going to be sitting at the local coffee shop on Tuesday night, doing some hacking. Invite people. Don't think you have to make some huge plan and organization. Just Do It!
In the end, it all boils down to one piece of advice. Software development is a community activity. If you aren't taking part, then you are missing out.